Skip to content

Commit c9ce0ab

Browse files
committed
Make the SystemUI stop the screen saver when a full-screen notification is posted.
This keeps all the fullScreenIntent logic (including multiuser implications) in one place. Change-Id: I4ef284daf90464f105780ade1d971e9e081fbbb5
1 parent 24518e4 commit c9ce0ab

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-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
@@ -746,6 +746,10 @@ public void addNotification(IBinder key, StatusBarNotification notification) {
746746
*/
747747

748748
if (notification.notification.fullScreenIntent != null) {
749+
// Stop screensaver if the notification has a full-screen intent.
750+
// (like an incoming phone call)
751+
awakenDreams();
752+
749753
// not immersive & a full-screen alert should be shown
750754
Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
751755
try {

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

Lines changed: 0 additions & 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);

0 commit comments

Comments
 (0)