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

Commit efdede0f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Cancel alarms & jobs when an app's data is cleared"

parents 57e6b4fb 1d99c391
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2613,7 +2613,7 @@ public class ActivityManager {
            Manifest.permission.ACCESS_INSTANT_APPS})
    public boolean clearApplicationUserData(String packageName, IPackageDataObserver observer) {
        try {
            return getService().clearApplicationUserData(packageName,
            return getService().clearApplicationUserData(packageName, false,
                    observer, UserHandle.myUserId());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ interface IActivityManager {
    boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot);
    void getMemoryInfo(out ActivityManager.MemoryInfo outInfo);
    List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState();
    boolean clearApplicationUserData(in String packageName,
    boolean clearApplicationUserData(in String packageName, boolean keepState,
            in IPackageDataObserver observer, int userId);
    void forceStopPackage(in String packageName, int userId);
    boolean killPids(in int[] pids, in String reason, boolean secure);
+6 −2
Original line number Diff line number Diff line
@@ -1520,7 +1520,11 @@ public class RefactoredBackupManagerService implements BackupManagerServiceInter
    }

    // clear an application's data, blocking until the operation completes or times out
    public void clearApplicationDataSynchronous(String packageName) {
    // if keepSystemState is true, we intentionally do not also clear system state that
    // would ordinarily also be cleared, because we aren't actually wiping the app back
    // to empty; we're bringing it into the actual expected state related to the already-
    // restored notification state etc.
    public void clearApplicationDataSynchronous(String packageName, boolean keepSystemState) {
        // Don't wipe packages marked allowClearUserData=false
        try {
            PackageInfo info = mPackageManager.getPackageInfo(packageName, 0);
@@ -1541,7 +1545,7 @@ public class RefactoredBackupManagerService implements BackupManagerServiceInter
        synchronized (mClearDataLock) {
            mClearingData = true;
            try {
                mActivityManager.clearApplicationUserData(packageName, observer, 0);
                mActivityManager.clearApplicationUserData(packageName, keepSystemState, observer, 0);
            } catch (RemoteException e) {
                // can't happen because the activity manager is in this process
            }
+1 −1
Original line number Diff line number Diff line
@@ -327,7 +327,7 @@ public class FullRestoreEngine extends RestoreEngine {
                                        Slog.d(TAG,
                                                "Clearing app data preparatory to full restore");
                                    }
                                    mBackupManagerService.clearApplicationDataSynchronous(pkg);
                                    mBackupManagerService.clearApplicationDataSynchronous(pkg, true);
                                } else {
                                    if (MORE_DEBUG) {
                                        Slog.d(TAG, "backup agent ("
+1 −1
Original line number Diff line number Diff line
@@ -591,7 +591,7 @@ public class PerformAdbRestoreTask implements Runnable {
                                        Slog.d(TAG,
                                                "Clearing app data preparatory to full restore");
                                    }
                                    mBackupManagerService.clearApplicationDataSynchronous(pkg);
                                    mBackupManagerService.clearApplicationDataSynchronous(pkg, true);
                                } else {
                                    if (DEBUG) {
                                        Slog.d(TAG, "backup agent ("
Loading