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

Commit d530d1bf authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "[NotificationManagerService]: Fixes the thread-safe issue."

parents 3d57eb0b 9bf22715
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -2078,6 +2078,7 @@ public class NotificationManagerService extends SystemService {
                Slog.w(TAG, "getBackupPayload: cannot backup policy for user " + user);
                return null;
            }
            synchronized(mPolicyFile) {
                final ByteArrayOutputStream baos = new ByteArrayOutputStream();
                try {
                    writePolicyXml(baos, true /*forBackup*/);
@@ -2085,6 +2086,7 @@ public class NotificationManagerService extends SystemService {
                } catch (IOException e) {
                    Slog.w(TAG, "getBackupPayload: error writing payload for user " + user, e);
                }
            }
            return null;
        }

@@ -2101,6 +2103,7 @@ public class NotificationManagerService extends SystemService {
                Slog.w(TAG, "applyRestore: cannot restore policy for user " + user);
                return;
            }
            synchronized(mPolicyFile) {
                final ByteArrayInputStream bais = new ByteArrayInputStream(payload);
                try {
                    readPolicyXml(bais, true /*forRestore*/);
@@ -2109,6 +2112,7 @@ public class NotificationManagerService extends SystemService {
                    Slog.w(TAG, "applyRestore: error reading payload", e);
                }
            }
        }

        @Override
        public boolean isNotificationPolicyAccessGranted(String pkg) {