Loading services/core/java/com/android/server/notification/NotificationDelegate.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -87,4 +87,6 @@ public interface NotificationDelegate { */ */ void onNotificationSmartReplySent(String key, int clickedIndex, CharSequence reply, void onNotificationSmartReplySent(String key, int clickedIndex, CharSequence reply, int notificationLocation, boolean modifiedBeforeSending); int notificationLocation, boolean modifiedBeforeSending); void prepareForPossibleShutdown(); } } services/core/java/com/android/server/notification/NotificationHistoryDatabase.java +1 −3 Original line number Original line Diff line number Diff line Loading @@ -157,10 +157,8 @@ public class NotificationHistoryDatabase { } } public void forceWriteToDisk() { public void forceWriteToDisk() { if (!mFileWriteHandler.hasCallbacks(mWriteBufferRunnable)) { mFileWriteHandler.post(mWriteBufferRunnable); mFileWriteHandler.post(mWriteBufferRunnable); } } } public void onPackageRemoved(String packageName) { public void onPackageRemoved(String packageName) { RemovePackageRunnable rpr = new RemovePackageRunnable(packageName); RemovePackageRunnable rpr = new RemovePackageRunnable(packageName); Loading services/core/java/com/android/server/notification/NotificationHistoryManager.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -181,7 +181,6 @@ public class NotificationHistoryManager { } } } } // TODO: wire this up to AMS when power button is long pressed public void triggerWriteToDisk() { public void triggerWriteToDisk() { synchronized (mLock) { synchronized (mLock) { final int userCount = mUserState.size(); final int userCount = mUserState.size(); Loading services/core/java/com/android/server/notification/NotificationManagerService.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -875,6 +875,11 @@ public class NotificationManagerService extends SystemService { @VisibleForTesting @VisibleForTesting final NotificationDelegate mNotificationDelegate = new NotificationDelegate() { final NotificationDelegate mNotificationDelegate = new NotificationDelegate() { @Override public void prepareForPossibleShutdown() { mHistoryManager.triggerWriteToDisk(); } @Override @Override public void onSetDisabled(int status) { public void onSetDisabled(int status) { synchronized (mNotificationLock) { synchronized (mNotificationLock) { Loading services/core/java/com/android/server/statusbar/StatusBarManagerService.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -1169,6 +1169,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D enforceStatusBarService(); enforceStatusBarService(); long identity = Binder.clearCallingIdentity(); long identity = Binder.clearCallingIdentity(); try { try { mNotificationDelegate.prepareForPossibleShutdown(); // ShutdownThread displays UI, so give it a UI context. // ShutdownThread displays UI, so give it a UI context. mHandler.post(() -> mHandler.post(() -> ShutdownThread.shutdown(getUiContext(), ShutdownThread.shutdown(getUiContext(), Loading @@ -1186,6 +1187,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D enforceStatusBarService(); enforceStatusBarService(); long identity = Binder.clearCallingIdentity(); long identity = Binder.clearCallingIdentity(); try { try { mNotificationDelegate.prepareForPossibleShutdown(); mHandler.post(() -> { mHandler.post(() -> { // ShutdownThread displays UI, so give it a UI context. // ShutdownThread displays UI, so give it a UI context. if (safeMode) { if (safeMode) { Loading Loading
services/core/java/com/android/server/notification/NotificationDelegate.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -87,4 +87,6 @@ public interface NotificationDelegate { */ */ void onNotificationSmartReplySent(String key, int clickedIndex, CharSequence reply, void onNotificationSmartReplySent(String key, int clickedIndex, CharSequence reply, int notificationLocation, boolean modifiedBeforeSending); int notificationLocation, boolean modifiedBeforeSending); void prepareForPossibleShutdown(); } }
services/core/java/com/android/server/notification/NotificationHistoryDatabase.java +1 −3 Original line number Original line Diff line number Diff line Loading @@ -157,10 +157,8 @@ public class NotificationHistoryDatabase { } } public void forceWriteToDisk() { public void forceWriteToDisk() { if (!mFileWriteHandler.hasCallbacks(mWriteBufferRunnable)) { mFileWriteHandler.post(mWriteBufferRunnable); mFileWriteHandler.post(mWriteBufferRunnable); } } } public void onPackageRemoved(String packageName) { public void onPackageRemoved(String packageName) { RemovePackageRunnable rpr = new RemovePackageRunnable(packageName); RemovePackageRunnable rpr = new RemovePackageRunnable(packageName); Loading
services/core/java/com/android/server/notification/NotificationHistoryManager.java +0 −1 Original line number Original line Diff line number Diff line Loading @@ -181,7 +181,6 @@ public class NotificationHistoryManager { } } } } // TODO: wire this up to AMS when power button is long pressed public void triggerWriteToDisk() { public void triggerWriteToDisk() { synchronized (mLock) { synchronized (mLock) { final int userCount = mUserState.size(); final int userCount = mUserState.size(); Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +5 −0 Original line number Original line Diff line number Diff line Loading @@ -875,6 +875,11 @@ public class NotificationManagerService extends SystemService { @VisibleForTesting @VisibleForTesting final NotificationDelegate mNotificationDelegate = new NotificationDelegate() { final NotificationDelegate mNotificationDelegate = new NotificationDelegate() { @Override public void prepareForPossibleShutdown() { mHistoryManager.triggerWriteToDisk(); } @Override @Override public void onSetDisabled(int status) { public void onSetDisabled(int status) { synchronized (mNotificationLock) { synchronized (mNotificationLock) { Loading
services/core/java/com/android/server/statusbar/StatusBarManagerService.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -1169,6 +1169,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D enforceStatusBarService(); enforceStatusBarService(); long identity = Binder.clearCallingIdentity(); long identity = Binder.clearCallingIdentity(); try { try { mNotificationDelegate.prepareForPossibleShutdown(); // ShutdownThread displays UI, so give it a UI context. // ShutdownThread displays UI, so give it a UI context. mHandler.post(() -> mHandler.post(() -> ShutdownThread.shutdown(getUiContext(), ShutdownThread.shutdown(getUiContext(), Loading @@ -1186,6 +1187,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D enforceStatusBarService(); enforceStatusBarService(); long identity = Binder.clearCallingIdentity(); long identity = Binder.clearCallingIdentity(); try { try { mNotificationDelegate.prepareForPossibleShutdown(); mHandler.post(() -> { mHandler.post(() -> { // ShutdownThread displays UI, so give it a UI context. // ShutdownThread displays UI, so give it a UI context. if (safeMode) { if (safeMode) { Loading