diff options
| author | 2013-03-07 17:50:11 -0800 | |
|---|---|---|
| committer | 2013-03-07 17:50:11 -0800 | |
| commit | a83cab0001ca4d90abe622c22a7af1b0da54f739 (patch) | |
| tree | 51bec7849647a103e8d24179201e7f7e95e46b01 | |
| parent | 09ed05ceaecc5fca46e25fe9bd9e8c0ee61fd31d (diff) | |
Do not hang in pm clear on an invalid package name
The Activity Manager was not properly informing the observer that
the operation had concluded (unsuccessfully).
Bug 8222595
Change-Id: I8234e32d8edf4112c8c7a5e20e341d0b41e23014
| -rw-r--r-- | cmds/pm/src/com/android/commands/pm/Pm.java | 5 | ||||
| -rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java index 22ce8412a47e..98c82b56625b 100644 --- a/cmds/pm/src/com/android/commands/pm/Pm.java +++ b/cmds/pm/src/com/android/commands/pm/Pm.java @@ -1149,10 +1149,7 @@ public final class Pm { ClearDataObserver obs = new ClearDataObserver(); try { - if (!ActivityManagerNative.getDefault().clearApplicationUserData(pkg, obs, userId)) { - System.err.println("Failed"); - } - + ActivityManagerNative.getDefault().clearApplicationUserData(pkg, obs, userId); synchronized (obs) { while (!obs.finished) { try { diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index d8bcf2cd4494..6f092bf6d50d 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -3499,7 +3499,14 @@ public final class ActivityManagerService extends ActivityManagerNative } catch (RemoteException e) { } if (pkgUid == -1) { - Slog.w(TAG, "Invalid packageName:" + packageName); + Slog.w(TAG, "Invalid packageName: " + packageName); + if (observer != null) { + try { + observer.onRemoveCompleted(packageName, false); + } catch (RemoteException e) { + Slog.i(TAG, "Observer no longer exists."); + } + } return false; } if (uid == pkgUid || checkComponentPermission( |