Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd5494b8 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android (Google) Code Review
Browse files

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.
parents ec098efc c9ce0abe
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -727,6 +727,10 @@ public class PhoneStatusBar extends BaseStatusBar {
         */

        if (notification.notification.fullScreenIntent != null) {
            // Stop screensaver if the notification has a full-screen intent.
            // (like an incoming phone call)
            awakenDreams();

            // not immersive & a full-screen alert should be shown
            Slog.d(TAG, "Notification has fullScreenIntent; sending fullScreenIntent");
            try {
+1 −14
Original line number Diff line number Diff line
@@ -151,8 +151,6 @@ public class NotificationManagerService extends INotificationManager.Stub
    private AtomicFile mPolicyFile;
    private HashSet<String> mBlockedPackages = new HashSet<String>();

    private IDreamManager mSandman;

    private static final int DB_VERSION = 1;

    private static final String TAG_BODY = "notification-policy";
@@ -658,8 +656,6 @@ public class NotificationManagerService extends INotificationManager.Stub
    void systemReady() {
        mAudioService = IAudioService.Stub.asInterface(
                ServiceManager.getService(Context.AUDIO_SERVICE));
        mSandman = IDreamManager.Stub.asInterface(
                ServiceManager.getService("dreams"));

        // no beeping until we're basically done booting
        mSystemReady = true;
@@ -995,16 +991,6 @@ public class NotificationManagerService extends INotificationManager.Stub
                        | Notification.FLAG_NO_CLEAR;
            }

            // Stop screensaver if the notification has a full-screen intent.
            // (like an incoming phone call)
            if (notification.fullScreenIntent != null && mSandman != null) {
                try {
                    mSandman.awaken();
                } catch (RemoteException e) {
                    // noop
                }
            }

            if (notification.icon != 0) {
                StatusBarNotification n = new StatusBarNotification(pkg, id, tag,
                        r.uid, r.initialPid, score, notification);
@@ -1047,6 +1033,7 @@ public class NotificationManagerService extends INotificationManager.Stub
            if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0)
                    && (!(old != null
                        && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))
                    && (r.userId == UserHandle.USER_ALL || r.userId == userId)
                    && mSystemReady) {

                final AudioManager audioManager = (AudioManager) mContext