Clear app data via the Activity Manager, not Package Manager

This is because doing it through the Activity Manager also makes sure that the
app has been shut down first, which is quite a desirable invariant for restore
handling.
This commit is contained in:
Christopher Tate
2009-08-06 14:57:53 -07:00
parent d87c19f7d7
commit 9dfdac5b08

View File

@@ -792,7 +792,11 @@ class BackupManagerService extends IBackupManager.Stub {
synchronized(mClearDataLock) {
mClearingData = true;
mPackageManager.clearApplicationUserData(packageName, observer);
try {
mActivityManager.clearApplicationUserData(packageName, observer);
} catch (RemoteException e) {
// can't happen because the activity manager is in this process
}
// only wait 10 seconds for the clear data to happen
long timeoutMark = System.currentTimeMillis() + TIMEOUT_INTERVAL;