Loading services/core/java/com/android/server/pm/PackageManagerService.java +8 −2 Original line number Diff line number Diff line Loading @@ -24019,6 +24019,13 @@ public class PackageManagerService extends IPackageManager.Stub final int permission = mContext.checkCallingOrSelfPermission( android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE); final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED); if (!allowedByPermission && !ArrayUtils.contains(getPackagesForUid(callingUid), packageName)) { throw new SecurityException( "Permission Denial: attempt to change stopped state from pid=" + Binder.getCallingPid() + ", uid=" + callingUid + ", package=" + packageName); } enforceCrossUserPermission(callingUid, userId, true /* requireFullPermission */, true /* checkShell */, "stop package"); boolean shouldUnhibernate = false; Loading @@ -24029,8 +24036,7 @@ public class PackageManagerService extends IPackageManager.Stub shouldUnhibernate = true; } if (!shouldFilterApplicationLocked(ps, callingUid, userId) && mSettings.setPackageStoppedStateLPw(this, packageName, stopped, allowedByPermission, callingUid, userId)) { && mSettings.setPackageStoppedStateLPw(this, packageName, stopped, userId)) { scheduleWritePackageRestrictionsLocked(userId); } } services/core/java/com/android/server/pm/Settings.java +1 −8 Original line number Diff line number Diff line Loading @@ -4188,18 +4188,11 @@ public final class Settings implements Watchable, Snappable { } boolean setPackageStoppedStateLPw(PackageManagerService pm, String packageName, boolean stopped, boolean allowedByPermission, int uid, int userId) { int appId = UserHandle.getAppId(uid); boolean stopped, int userId) { final PackageSetting pkgSetting = mPackages.get(packageName); if (pkgSetting == null) { throw new IllegalArgumentException("Unknown package: " + packageName); } if (!allowedByPermission && (appId != pkgSetting.appId)) { throw new SecurityException( "Permission Denial: attempt to change stopped state from pid=" + Binder.getCallingPid() + ", uid=" + uid + ", package uid=" + pkgSetting.appId); } if (DEBUG_STOPPED) { if (stopped) { RuntimeException e = new RuntimeException("here"); Loading Loading
services/core/java/com/android/server/pm/PackageManagerService.java +8 −2 Original line number Diff line number Diff line Loading @@ -24019,6 +24019,13 @@ public class PackageManagerService extends IPackageManager.Stub final int permission = mContext.checkCallingOrSelfPermission( android.Manifest.permission.CHANGE_COMPONENT_ENABLED_STATE); final boolean allowedByPermission = (permission == PackageManager.PERMISSION_GRANTED); if (!allowedByPermission && !ArrayUtils.contains(getPackagesForUid(callingUid), packageName)) { throw new SecurityException( "Permission Denial: attempt to change stopped state from pid=" + Binder.getCallingPid() + ", uid=" + callingUid + ", package=" + packageName); } enforceCrossUserPermission(callingUid, userId, true /* requireFullPermission */, true /* checkShell */, "stop package"); boolean shouldUnhibernate = false; Loading @@ -24029,8 +24036,7 @@ public class PackageManagerService extends IPackageManager.Stub shouldUnhibernate = true; } if (!shouldFilterApplicationLocked(ps, callingUid, userId) && mSettings.setPackageStoppedStateLPw(this, packageName, stopped, allowedByPermission, callingUid, userId)) { && mSettings.setPackageStoppedStateLPw(this, packageName, stopped, userId)) { scheduleWritePackageRestrictionsLocked(userId); } }
services/core/java/com/android/server/pm/Settings.java +1 −8 Original line number Diff line number Diff line Loading @@ -4188,18 +4188,11 @@ public final class Settings implements Watchable, Snappable { } boolean setPackageStoppedStateLPw(PackageManagerService pm, String packageName, boolean stopped, boolean allowedByPermission, int uid, int userId) { int appId = UserHandle.getAppId(uid); boolean stopped, int userId) { final PackageSetting pkgSetting = mPackages.get(packageName); if (pkgSetting == null) { throw new IllegalArgumentException("Unknown package: " + packageName); } if (!allowedByPermission && (appId != pkgSetting.appId)) { throw new SecurityException( "Permission Denial: attempt to change stopped state from pid=" + Binder.getCallingPid() + ", uid=" + uid + ", package uid=" + pkgSetting.appId); } if (DEBUG_STOPPED) { if (stopped) { RuntimeException e = new RuntimeException("here"); Loading