Loading core/java/android/app/ApplicationPackageManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -2933,6 +2933,15 @@ public class ApplicationPackageManager extends PackageManager { } } @Override public String getSuspendingPackage(String suspendedPackage) { try { return mPM.getSuspendingPackage(suspendedPackage, getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } @Override public boolean isPackageSuspendedForUser(String packageName, int userId) { try { Loading core/java/android/content/pm/IPackageManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,8 @@ interface IPackageManager { Bundle getSuspendedPackageAppExtras(String packageName, int userId); String getSuspendingPackage(String packageName, int userId); /** * Backup/restore support - only the system uid may use these. */ Loading core/java/android/content/pm/PackageManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -9964,6 +9964,21 @@ public abstract class PackageManager { throw new UnsupportedOperationException("getSuspendedPackageAppExtras not implemented"); } /** * Get the name of the package that suspended the given package. Packages can be suspended by * device administrators or apps holding {@link android.Manifest.permission#MANAGE_USERS} or * {@link android.Manifest.permission#SUSPEND_APPS}. * * @param suspendedPackage The package that has been suspended. * @return Name of the package that suspended the given package. Returns {@code null} if the * given package is not currently suspended and the platform package name - i.e. * {@code "android"} - if the package was suspended by a device admin. * @hide */ public @Nullable String getSuspendingPackage(@NonNull String suspendedPackage) { throw new UnsupportedOperationException("getSuspendingPackage not implemented"); } /** * Query if an app is currently stopped. * Loading services/core/java/com/android/server/pm/PackageManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -5215,6 +5215,18 @@ public class PackageManagerService implements PackageSender, TestUtilityService .getSuspendedPackageAppExtras(snapshot, packageName, userId, callingUid); } @Override public String getSuspendingPackage(String packageName, int userId) { final int callingUid = Binder.getCallingUid(); final Computer snapshot = snapshot(); // This will do visibility checks as well. if (!snapshot.isPackageSuspendedForUser(packageName, userId)) { return null; } return mSuspendPackageHelper.getSuspendingPackage(snapshot, packageName, userId, callingUid); } @Override public @NonNull ParceledListSlice<FeatureInfo> getSystemAvailableFeatures() { // allow instant applications Loading Loading
core/java/android/app/ApplicationPackageManager.java +9 −0 Original line number Diff line number Diff line Loading @@ -2933,6 +2933,15 @@ public class ApplicationPackageManager extends PackageManager { } } @Override public String getSuspendingPackage(String suspendedPackage) { try { return mPM.getSuspendingPackage(suspendedPackage, getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } @Override public boolean isPackageSuspendedForUser(String packageName, int userId) { try { Loading
core/java/android/content/pm/IPackageManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -312,6 +312,8 @@ interface IPackageManager { Bundle getSuspendedPackageAppExtras(String packageName, int userId); String getSuspendingPackage(String packageName, int userId); /** * Backup/restore support - only the system uid may use these. */ Loading
core/java/android/content/pm/PackageManager.java +15 −0 Original line number Diff line number Diff line Loading @@ -9964,6 +9964,21 @@ public abstract class PackageManager { throw new UnsupportedOperationException("getSuspendedPackageAppExtras not implemented"); } /** * Get the name of the package that suspended the given package. Packages can be suspended by * device administrators or apps holding {@link android.Manifest.permission#MANAGE_USERS} or * {@link android.Manifest.permission#SUSPEND_APPS}. * * @param suspendedPackage The package that has been suspended. * @return Name of the package that suspended the given package. Returns {@code null} if the * given package is not currently suspended and the platform package name - i.e. * {@code "android"} - if the package was suspended by a device admin. * @hide */ public @Nullable String getSuspendingPackage(@NonNull String suspendedPackage) { throw new UnsupportedOperationException("getSuspendingPackage not implemented"); } /** * Query if an app is currently stopped. * Loading
services/core/java/com/android/server/pm/PackageManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -5215,6 +5215,18 @@ public class PackageManagerService implements PackageSender, TestUtilityService .getSuspendedPackageAppExtras(snapshot, packageName, userId, callingUid); } @Override public String getSuspendingPackage(String packageName, int userId) { final int callingUid = Binder.getCallingUid(); final Computer snapshot = snapshot(); // This will do visibility checks as well. if (!snapshot.isPackageSuspendedForUser(packageName, userId)) { return null; } return mSuspendPackageHelper.getSuspendingPackage(snapshot, packageName, userId, callingUid); } @Override public @NonNull ParceledListSlice<FeatureInfo> getSystemAvailableFeatures() { // allow instant applications Loading