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

Commit 359055b1 authored by Christopher Tate's avatar Christopher Tate Committed by Android Git Automerger
Browse files

am bacc5cd0: am bd766403: am a1d3c508: Merge "Fix requestRestore() of an...

am bacc5cd0: am bd766403: am a1d3c508: Merge "Fix requestRestore() of an app\'s own package" into mnc-dev

* commit 'bacc5cd0':
  Fix requestRestore() of an app's own package
parents b8618dcb bacc5cd0
Loading
Loading
Loading
Loading
+37 −34
Original line number Diff line number Diff line
@@ -9368,8 +9368,10 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
                throw new SecurityException("No permission to restore other packages");
            }

            // So far so good; we're allowed to try to restore this package.  Now
            // check whether there is data for it in the current dataset, falling back
            // So far so good; we're allowed to try to restore this package.
            long oldId = Binder.clearCallingIdentity();
            try {
                // Check whether there is data for it in the current dataset, falling back
                // to the ancestral dataset if not.
                long token = getAvailableRestoreToken(packageName);
                if (DEBUG) Slog.v(TAG, "restorePackage pkg=" + packageName
@@ -9396,7 +9398,6 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
                mBackupHandler.removeMessages(MSG_RESTORE_TIMEOUT);

                // Ready to go:  enqueue the restore request and claim success
            long oldId = Binder.clearCallingIdentity();
                mWakelock.acquire();
                if (MORE_DEBUG) {
                    Slog.d(TAG, "restorePackage() : " + packageName);
@@ -9405,7 +9406,9 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
                msg.obj = new RestoreParams(mRestoreTransport, dirName,
                        observer, token, app, 0);
                mBackupHandler.sendMessage(msg);
            } finally {
                Binder.restoreCallingIdentity(oldId);
            }
            return 0;
        }