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

Commit 8a613f86 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Remove unneccessary locking

Backup/restore don't read or write directly to the storage file.

Test: reboot device, let it sit
Change-Id: I08bb6d566e138863c9132342fd8782cc2dc40682
Fixes: 120932400
parent d7888357
Loading
Loading
Loading
Loading
+12 −17
Original line number Diff line number Diff line
@@ -583,7 +583,6 @@ public class NotificationManagerService extends SystemService {
    private void loadPolicyFile() {
        if (DBG) Slog.d(TAG, "loadPolicyFile");
        synchronized (mPolicyFile) {

            InputStream infile = null;
            try {
                infile = mPolicyFile.openRead();
@@ -3357,7 +3356,6 @@ 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*/);
@@ -3365,7 +3363,6 @@ public class NotificationManagerService extends SystemService {
            } catch (IOException e) {
                Slog.w(TAG, "getBackupPayload: error writing payload for user " + user, e);
            }
            }
            return null;
        }

@@ -3383,7 +3380,6 @@ 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*/);
@@ -3392,7 +3388,6 @@ public class NotificationManagerService extends SystemService {
                Slog.w(TAG, "applyRestore: error reading payload", e);
            }
        }
        }

        @Override
        public boolean isNotificationPolicyAccessGranted(String pkg) {