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

Commit 09057f8a authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Persist pending notification history on shutdown" into rvc-dev...

Merge "Merge "Persist pending notification history on shutdown" into rvc-dev am: f460a9cd am: b5fe464e am: e6759f8e am: 092cb4f4" into rvc-qpr-dev-plus-aosp
parents 20652887 48c1aaa6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -87,4 +87,6 @@ public interface NotificationDelegate {
     */
    void onNotificationSmartReplySent(String key, int clickedIndex, CharSequence reply,
            int notificationLocation, boolean modifiedBeforeSending);

    void prepareForPossibleShutdown();
}
+1 −3
Original line number Diff line number Diff line
@@ -157,10 +157,8 @@ public class NotificationHistoryDatabase {
    }

    public void forceWriteToDisk() {
        if (!mFileWriteHandler.hasCallbacks(mWriteBufferRunnable)) {
        mFileWriteHandler.post(mWriteBufferRunnable);
    }
    }

    public void onPackageRemoved(String packageName) {
        RemovePackageRunnable rpr = new RemovePackageRunnable(packageName);
+0 −1
Original line number Diff line number Diff line
@@ -181,7 +181,6 @@ public class NotificationHistoryManager {
        }
    }

    // TODO: wire this up to AMS when power button is long pressed
    public void triggerWriteToDisk() {
        synchronized (mLock) {
            final int userCount = mUserState.size();
+5 −0
Original line number Diff line number Diff line
@@ -875,6 +875,11 @@ public class NotificationManagerService extends SystemService {
    @VisibleForTesting
    final NotificationDelegate mNotificationDelegate = new NotificationDelegate() {

        @Override
        public void prepareForPossibleShutdown() {
            mHistoryManager.triggerWriteToDisk();
        }

        @Override
        public void onSetDisabled(int status) {
            synchronized (mNotificationLock) {
+2 −0
Original line number Diff line number Diff line
@@ -1169,6 +1169,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
        enforceStatusBarService();
        long identity = Binder.clearCallingIdentity();
        try {
            mNotificationDelegate.prepareForPossibleShutdown();
            // ShutdownThread displays UI, so give it a UI context.
            mHandler.post(() ->
                    ShutdownThread.shutdown(getUiContext(),
@@ -1186,6 +1187,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub implements D
        enforceStatusBarService();
        long identity = Binder.clearCallingIdentity();
        try {
            mNotificationDelegate.prepareForPossibleShutdown();
            mHandler.post(() -> {
                // ShutdownThread displays UI, so give it a UI context.
                if (safeMode) {
Loading