Skip to content

Commit fd5494b

Browse files
dsandlerAndroid (Google) Code Review
authored andcommitted
Merge changes I4ef284da,Ie8cc69bd into jb-mr1-dev
* changes: Make the SystemUI stop the screen saver when a full-screen notification is posted. Do not play sounds or vibes for background users' notifications.
2 parents ec098ef + c9ce0ab commit fd5494b

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,10 @@ public void addNotification(IBinder key, StatusBarNotification notification) {
727727
*/
728728

729729
if (notification.notification.fullScreenIntent != null) {
730+
// Stop screensaver if the notification has a full-screen intent.
731+
// (like an incoming phone call)
732+
awakenDreams();
733+
730734
// not immersive & a full-screen alert should be shown
731735
Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
732736
try {

services/java/com/android/server/NotificationManagerService.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,6 @@ public class NotificationManagerService extends INotificationManager.Stub
151151
private AtomicFile mPolicyFile;
152152
private HashSet<String> mBlockedPackages = new HashSet<String>();
153153

154-
private IDreamManager mSandman;
155-
156154
private static final int DB_VERSION = 1;
157155

158156
private static final String TAG_BODY = "notification-policy";
@@ -658,8 +656,6 @@ public void update() {
658656
void systemReady() {
659657
mAudioService = IAudioService.Stub.asInterface(
660658
ServiceManager.getService(Context.AUDIO_SERVICE));
661-
mSandman = IDreamManager.Stub.asInterface(
662-
ServiceManager.getService("dreams"));
663659

664660
// no beeping until we're basically done booting
665661
mSystemReady = true;
@@ -995,16 +991,6 @@ public void enqueueNotificationInternal(String pkg, int callingUid, int callingP
995991
| Notification.FLAG_NO_CLEAR;
996992
}
997993

998-
// Stop screensaver if the notification has a full-screen intent.
999-
// (like an incoming phone call)
1000-
if (notification.fullScreenIntent != null && mSandman != null) {
1001-
try {
1002-
mSandman.awaken();
1003-
} catch (RemoteException e) {
1004-
// noop
1005-
}
1006-
}
1007-
1008994
if (notification.icon != 0) {
1009995
StatusBarNotification n = new StatusBarNotification(pkg, id, tag,
1010996
r.uid, r.initialPid, score, notification);
@@ -1047,6 +1033,7 @@ public void enqueueNotificationInternal(String pkg, int callingUid, int callingP
10471033
if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0)
10481034
&& (!(old != null
10491035
&& (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
1036+
&& (r.userId == UserHandle.USER_ALL || r.userId == userId)
10501037
&& mSystemReady) {
10511038

10521039
final AudioManager audioManager = (AudioManager) mContext

0 commit comments

Comments
 (0)