Loading services/java/com/android/server/NotificationManagerService.java +11 −5 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ class NotificationManagerService extends INotificationManager.Stub private NotificationRecord mSoundNotification; private AsyncPlayer mSound; private int mDisabledNotifications; private boolean mSystemReady; private int mDisabledNotifications = StatusBarManager.DISABLE_NOTIFICATION_ALERTS; private NotificationRecord mVibrateNotification; private Vibrator mVibrator = new Vibrator(); Loading Loading @@ -377,6 +378,11 @@ class NotificationManagerService extends INotificationManager.Stub mSettingsObserver.observe(); } void systemReady() { // no beeping until we're basically done booting mSystemReady = true; } // Toasts // ============================================================================ public void enqueueToast(String pkg, ITransientNotification callback, int duration) Loading Loading @@ -637,7 +643,7 @@ class NotificationManagerService extends INotificationManager.Stub } } sendAccessibilityEventTypeNotificationChangedDoCheck(notification, pkg); sendAccessibilityEvent(notification, pkg); } else { if (old != null && old.statusBarKey != null) { Loading @@ -654,7 +660,8 @@ class NotificationManagerService extends INotificationManager.Stub // If we're not supposed to beep, vibrate, etc. then don't. if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0) && (!(old != null && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))) { && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 )) && mSystemReady) { // sound final boolean useDefaultSound = (notification.defaults & Notification.DEFAULT_SOUND) != 0; Loading Loading @@ -721,8 +728,7 @@ class NotificationManagerService extends INotificationManager.Stub idOut[0] = id; } private void sendAccessibilityEventTypeNotificationChangedDoCheck(Notification notification, CharSequence packageName) { private void sendAccessibilityEvent(Notification notification, CharSequence packageName) { AccessibilityManager manager = AccessibilityManager.getInstance(mContext); if (!manager.isEnabled()) { return; Loading services/java/com/android/server/SystemServer.java +8 −2 Original line number Diff line number Diff line Loading @@ -190,6 +190,7 @@ class ServerThread extends Thread { StatusBarService statusBar = null; InputMethodManagerService imm = null; AppWidgetService appWidget = null; NotificationManagerService notification = null; if (factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) { try { Loading Loading @@ -240,8 +241,8 @@ class ServerThread extends Thread { try { Log.i(TAG, "Starting Notification Manager."); ServiceManager.addService(Context.NOTIFICATION_SERVICE, new NotificationManagerService(context, statusBar, hardware)); notification = new NotificationManagerService(context, statusBar, hardware); ServiceManager.addService(Context.NOTIFICATION_SERVICE, notification); } catch (Throwable e) { Log.e(TAG, "Failure starting Notification Manager", e); } Loading Loading @@ -348,6 +349,11 @@ class ServerThread extends Thread { // It is now time to start up the app processes... boolean safeMode = wm.detectSafeMode(); if (notification != null) { notification.systemReady(); } if (statusBar != null) { statusBar.systemReady(); } Loading Loading
services/java/com/android/server/NotificationManagerService.java +11 −5 Original line number Diff line number Diff line Loading @@ -88,7 +88,8 @@ class NotificationManagerService extends INotificationManager.Stub private NotificationRecord mSoundNotification; private AsyncPlayer mSound; private int mDisabledNotifications; private boolean mSystemReady; private int mDisabledNotifications = StatusBarManager.DISABLE_NOTIFICATION_ALERTS; private NotificationRecord mVibrateNotification; private Vibrator mVibrator = new Vibrator(); Loading Loading @@ -377,6 +378,11 @@ class NotificationManagerService extends INotificationManager.Stub mSettingsObserver.observe(); } void systemReady() { // no beeping until we're basically done booting mSystemReady = true; } // Toasts // ============================================================================ public void enqueueToast(String pkg, ITransientNotification callback, int duration) Loading Loading @@ -637,7 +643,7 @@ class NotificationManagerService extends INotificationManager.Stub } } sendAccessibilityEventTypeNotificationChangedDoCheck(notification, pkg); sendAccessibilityEvent(notification, pkg); } else { if (old != null && old.statusBarKey != null) { Loading @@ -654,7 +660,8 @@ class NotificationManagerService extends INotificationManager.Stub // If we're not supposed to beep, vibrate, etc. then don't. if (((mDisabledNotifications & StatusBarManager.DISABLE_NOTIFICATION_ALERTS) == 0) && (!(old != null && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 ))) { && (notification.flags & Notification.FLAG_ONLY_ALERT_ONCE) != 0 )) && mSystemReady) { // sound final boolean useDefaultSound = (notification.defaults & Notification.DEFAULT_SOUND) != 0; Loading Loading @@ -721,8 +728,7 @@ class NotificationManagerService extends INotificationManager.Stub idOut[0] = id; } private void sendAccessibilityEventTypeNotificationChangedDoCheck(Notification notification, CharSequence packageName) { private void sendAccessibilityEvent(Notification notification, CharSequence packageName) { AccessibilityManager manager = AccessibilityManager.getInstance(mContext); if (!manager.isEnabled()) { return; Loading
services/java/com/android/server/SystemServer.java +8 −2 Original line number Diff line number Diff line Loading @@ -190,6 +190,7 @@ class ServerThread extends Thread { StatusBarService statusBar = null; InputMethodManagerService imm = null; AppWidgetService appWidget = null; NotificationManagerService notification = null; if (factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) { try { Loading Loading @@ -240,8 +241,8 @@ class ServerThread extends Thread { try { Log.i(TAG, "Starting Notification Manager."); ServiceManager.addService(Context.NOTIFICATION_SERVICE, new NotificationManagerService(context, statusBar, hardware)); notification = new NotificationManagerService(context, statusBar, hardware); ServiceManager.addService(Context.NOTIFICATION_SERVICE, notification); } catch (Throwable e) { Log.e(TAG, "Failure starting Notification Manager", e); } Loading Loading @@ -348,6 +349,11 @@ class ServerThread extends Thread { // It is now time to start up the app processes... boolean safeMode = wm.detectSafeMode(); if (notification != null) { notification.systemReady(); } if (statusBar != null) { statusBar.systemReady(); } Loading