Loading services/core/java/com/android/server/pm/PackageManagerService.java +41 −36 Original line number Diff line number Diff line Loading @@ -12836,7 +12836,6 @@ public class PackageManagerService extends IPackageManager.Stub final List<String> unactionedPackages = new ArrayList<>(packageNames.length); final long callingId = Binder.clearCallingIdentity(); try { synchronized (mPackages) { for (int i = 0; i < packageNames.length; i++) { final String packageName = packageNames[i]; if (callingPackage.equals(packageName)) { Loading @@ -12845,7 +12844,9 @@ public class PackageManagerService extends IPackageManager.Stub unactionedPackages.add(packageName); continue; } final PackageSetting pkgSetting = mSettings.mPackages.get(packageName); PackageSetting pkgSetting; synchronized (mPackages) { pkgSetting = mSettings.mPackages.get(packageName); if (pkgSetting == null || filterAppAccessLPr(pkgSetting, callingUid, userId)) { Slog.w(TAG, "Could not find package setting for package: " + packageName Loading @@ -12853,16 +12854,21 @@ public class PackageManagerService extends IPackageManager.Stub unactionedPackages.add(packageName); continue; } if (suspended && !canSuspendPackageForUserLocked(packageName, userId)) { } if (suspended && !canSuspendPackageForUserInternal(packageName, userId)) { unactionedPackages.add(packageName); continue; } synchronized (mPackages) { pkgSetting = mSettings.mPackages.get(packageName); if (pkgSetting != null) { pkgSetting.setSuspended(suspended, callingPackage, dialogInfo, appExtras, launcherExtras, userId); } } changedPackagesList.add(packageName); changedUids.add(UserHandle.getUid(userId, pkgSetting.appId)); } } } finally { Binder.restoreCallingIdentity(callingId); } Loading Loading @@ -13018,16 +13024,13 @@ public class PackageManagerService extends IPackageManager.Stub } final long identity = Binder.clearCallingIdentity(); try { synchronized (mPackages) { return canSuspendPackageForUserLocked(packageName, userId); } return canSuspendPackageForUserInternal(packageName, userId); } finally { Binder.restoreCallingIdentity(identity); } } @GuardedBy("mPackages") private boolean canSuspendPackageForUserLocked(String packageName, int userId) { private boolean canSuspendPackageForUserInternal(String packageName, int userId) { if (isPackageDeviceAdmin(packageName, userId)) { Slog.w(TAG, "Cannot suspend package \"" + packageName + "\": has an active device admin"); Loading Loading @@ -13071,6 +13074,7 @@ public class PackageManagerService extends IPackageManager.Stub return false; } synchronized (mPackages) { if (mProtectedPackages.isPackageStateProtected(userId, packageName)) { Slog.w(TAG, "Cannot suspend package \"" + packageName + "\": protected package"); Loading @@ -13087,6 +13091,7 @@ public class PackageManagerService extends IPackageManager.Stub + pkg.staticSharedLibName); return false; } } if (PLATFORM_PACKAGE_NAME.equals(packageName)) { Slog.w(TAG, "Cannot suspend the platform package: " + packageName); Loading
services/core/java/com/android/server/pm/PackageManagerService.java +41 −36 Original line number Diff line number Diff line Loading @@ -12836,7 +12836,6 @@ public class PackageManagerService extends IPackageManager.Stub final List<String> unactionedPackages = new ArrayList<>(packageNames.length); final long callingId = Binder.clearCallingIdentity(); try { synchronized (mPackages) { for (int i = 0; i < packageNames.length; i++) { final String packageName = packageNames[i]; if (callingPackage.equals(packageName)) { Loading @@ -12845,7 +12844,9 @@ public class PackageManagerService extends IPackageManager.Stub unactionedPackages.add(packageName); continue; } final PackageSetting pkgSetting = mSettings.mPackages.get(packageName); PackageSetting pkgSetting; synchronized (mPackages) { pkgSetting = mSettings.mPackages.get(packageName); if (pkgSetting == null || filterAppAccessLPr(pkgSetting, callingUid, userId)) { Slog.w(TAG, "Could not find package setting for package: " + packageName Loading @@ -12853,16 +12854,21 @@ public class PackageManagerService extends IPackageManager.Stub unactionedPackages.add(packageName); continue; } if (suspended && !canSuspendPackageForUserLocked(packageName, userId)) { } if (suspended && !canSuspendPackageForUserInternal(packageName, userId)) { unactionedPackages.add(packageName); continue; } synchronized (mPackages) { pkgSetting = mSettings.mPackages.get(packageName); if (pkgSetting != null) { pkgSetting.setSuspended(suspended, callingPackage, dialogInfo, appExtras, launcherExtras, userId); } } changedPackagesList.add(packageName); changedUids.add(UserHandle.getUid(userId, pkgSetting.appId)); } } } finally { Binder.restoreCallingIdentity(callingId); } Loading Loading @@ -13018,16 +13024,13 @@ public class PackageManagerService extends IPackageManager.Stub } final long identity = Binder.clearCallingIdentity(); try { synchronized (mPackages) { return canSuspendPackageForUserLocked(packageName, userId); } return canSuspendPackageForUserInternal(packageName, userId); } finally { Binder.restoreCallingIdentity(identity); } } @GuardedBy("mPackages") private boolean canSuspendPackageForUserLocked(String packageName, int userId) { private boolean canSuspendPackageForUserInternal(String packageName, int userId) { if (isPackageDeviceAdmin(packageName, userId)) { Slog.w(TAG, "Cannot suspend package \"" + packageName + "\": has an active device admin"); Loading Loading @@ -13071,6 +13074,7 @@ public class PackageManagerService extends IPackageManager.Stub return false; } synchronized (mPackages) { if (mProtectedPackages.isPackageStateProtected(userId, packageName)) { Slog.w(TAG, "Cannot suspend package \"" + packageName + "\": protected package"); Loading @@ -13087,6 +13091,7 @@ public class PackageManagerService extends IPackageManager.Stub + pkg.staticSharedLibName); return false; } } if (PLATFORM_PACKAGE_NAME.equals(packageName)) { Slog.w(TAG, "Cannot suspend the platform package: " + packageName);