Loading services/core/java/com/android/server/am/ActivityManagerService.java +25 −16 Original line number Diff line number Diff line Loading @@ -18398,27 +18398,36 @@ public class ActivityManagerService extends IActivityManager.Stub "Cannot kill the dependents of a package without its name."); } userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, ALLOW_FULL_ONLY, "killPackageDependents", null); final int[] userIds = mUserController.expandUserId(userId); final long callingId = Binder.clearCallingIdentity(); IPackageManager pm = AppGlobals.getPackageManager(); try { for (int targetUserId : userIds) { int pkgUid = -1; try { pkgUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, userId); pkgUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, targetUserId); } catch (RemoteException e) { } if (userId != UserHandle.USER_ALL && pkgUid == -1) { throw new IllegalArgumentException( "Cannot kill dependents of non-existing package " + packageName); } try { synchronized (this) { synchronized (mProcLock) { mProcessList.killPackageProcessesLSP(packageName, UserHandle.getAppId(pkgUid), userId, ProcessList.FOREGROUND_APP_ADJ, mProcessList.killPackageProcessesLSP(packageName, UserHandle.getAppId(pkgUid), targetUserId, ProcessList.FOREGROUND_APP_ADJ, ApplicationExitInfo.REASON_DEPENDENCY_DIED, ApplicationExitInfo.SUBREASON_UNKNOWN, "dep: " + packageName); } } } } finally { Binder.restoreCallingIdentity(callingId); } Loading
services/core/java/com/android/server/am/ActivityManagerService.java +25 −16 Original line number Diff line number Diff line Loading @@ -18398,27 +18398,36 @@ public class ActivityManagerService extends IActivityManager.Stub "Cannot kill the dependents of a package without its name."); } userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(), userId, true, ALLOW_FULL_ONLY, "killPackageDependents", null); final int[] userIds = mUserController.expandUserId(userId); final long callingId = Binder.clearCallingIdentity(); IPackageManager pm = AppGlobals.getPackageManager(); try { for (int targetUserId : userIds) { int pkgUid = -1; try { pkgUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, userId); pkgUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, targetUserId); } catch (RemoteException e) { } if (userId != UserHandle.USER_ALL && pkgUid == -1) { throw new IllegalArgumentException( "Cannot kill dependents of non-existing package " + packageName); } try { synchronized (this) { synchronized (mProcLock) { mProcessList.killPackageProcessesLSP(packageName, UserHandle.getAppId(pkgUid), userId, ProcessList.FOREGROUND_APP_ADJ, mProcessList.killPackageProcessesLSP(packageName, UserHandle.getAppId(pkgUid), targetUserId, ProcessList.FOREGROUND_APP_ADJ, ApplicationExitInfo.REASON_DEPENDENCY_DIED, ApplicationExitInfo.SUBREASON_UNKNOWN, "dep: " + packageName); } } } } finally { Binder.restoreCallingIdentity(callingId); }