Loading api/system-current.txt +1 −4 Original line number Diff line number Diff line Loading @@ -1580,7 +1580,7 @@ package android.content.pm { method @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public abstract void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle); method public void sendDeviceCustomizationReadyBroadcast(); method @RequiresPermission(allOf={android.Manifest.permission.SET_PREFERRED_APPLICATIONS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public abstract boolean setDefaultBrowserPackageNameAsUser(String, int); method @NonNull @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setDistractingPackageRestrictions(@NonNull String[], @android.content.pm.PackageManager.DistractionRestriction int); method @NonNull @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setDistractingPackageRestrictions(@NonNull String[], int); method @RequiresPermission(android.Manifest.permission.SET_HARMFUL_APP_WARNINGS) public void setHarmfulAppWarning(@NonNull String, @Nullable CharSequence); method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(@Nullable String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, @Nullable String); method @Nullable @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(@Nullable String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, @Nullable android.content.pm.SuspendDialogInfo); Loading Loading @@ -1658,9 +1658,6 @@ package android.content.pm { method public abstract void onDexModuleRegistered(String, boolean, String); } @IntDef(flag=true, prefix={"RESTRICTION_"}, value={android.content.pm.PackageManager.RESTRICTION_NONE, android.content.pm.PackageManager.RESTRICTION_HIDE_FROM_SUGGESTIONS, android.content.pm.PackageManager.RESTRICTION_HIDE_NOTIFICATIONS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PackageManager.DistractionRestriction { } public static interface PackageManager.OnPermissionsChangedListener { method public void onPermissionsChanged(int); } Loading core/java/android/content/pm/PackageManager.java +9 −8 Original line number Diff line number Diff line Loading @@ -5910,24 +5910,24 @@ public abstract class PackageManager { /** * Flag to denote no restrictions. This should be used to clear any restrictions that may have * been previously set for the package. * @see PackageManager.DistractionRestriction * @hide * @see #setDistractingPackageRestrictions(String[], int) */ @SystemApi public static final int RESTRICTION_NONE = 0x0; /** * Flag to denote that a package should be hidden from any suggestions to the user. * @see PackageManager.DistractionRestriction * @hide * @see #setDistractingPackageRestrictions(String[], int) */ @SystemApi public static final int RESTRICTION_HIDE_FROM_SUGGESTIONS = 0x00000001; /** * Flag to denote that a package's notifications should be hidden. * @see PackageManager.DistractionRestriction * @hide * @see #setDistractingPackageRestrictions(String[], int) */ @SystemApi public static final int RESTRICTION_HIDE_NOTIFICATIONS = 0x00000002; Loading @@ -5939,7 +5939,6 @@ public abstract class PackageManager { * @see #setDistractingPackageRestrictions(String[], int) * @hide */ @SystemApi @IntDef(flag = true, prefix = {"RESTRICTION_"}, value = { RESTRICTION_NONE, RESTRICTION_HIDE_FROM_SUGGESTIONS, Loading @@ -5957,14 +5956,16 @@ public abstract class PackageManager { * <p>The caller must hold {@link android.Manifest.permission#SUSPEND_APPS} to use this API. * * @param packages Packages to mark as distracting. * @param restrictionFlags Any combination of {@link DistractionRestriction restrictions} to * impose on the given packages. {@link #RESTRICTION_NONE} can be used * to clear any existing restrictions. * @param restrictionFlags Any combination of restrictions to impose on the given packages. * {@link #RESTRICTION_NONE} can be used to clear any existing * restrictions. * @return A list of packages that could not have the {@code restrictionFlags} set. The system * may prevent restricting critical packages to preserve normal device function. * * @see DistractionRestriction * @hide * @see #RESTRICTION_NONE * @see #RESTRICTION_HIDE_FROM_SUGGESTIONS * @see #RESTRICTION_HIDE_NOTIFICATIONS */ @SystemApi @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) Loading services/core/java/com/android/server/pm/PackageManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -12803,7 +12803,7 @@ public class PackageManagerService extends IPackageManager.Stub public String[] setDistractingPackageRestrictionsAsUser(String[] packageNames, int restrictionFlags, int userId) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SUSPEND_APPS, "setPackagesSuspendedAsUser"); "setDistractingPackageRestrictionsAsUser"); final int callingUid = Binder.getCallingUid(); if (callingUid != Process.ROOT_UID && callingUid != Process.SYSTEM_UID Loading
api/system-current.txt +1 −4 Original line number Diff line number Diff line Loading @@ -1580,7 +1580,7 @@ package android.content.pm { method @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public abstract void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull android.os.UserHandle); method public void sendDeviceCustomizationReadyBroadcast(); method @RequiresPermission(allOf={android.Manifest.permission.SET_PREFERRED_APPLICATIONS, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}) public abstract boolean setDefaultBrowserPackageNameAsUser(String, int); method @NonNull @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setDistractingPackageRestrictions(@NonNull String[], @android.content.pm.PackageManager.DistractionRestriction int); method @NonNull @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setDistractingPackageRestrictions(@NonNull String[], int); method @RequiresPermission(android.Manifest.permission.SET_HARMFUL_APP_WARNINGS) public void setHarmfulAppWarning(@NonNull String, @Nullable CharSequence); method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(@Nullable String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, @Nullable String); method @Nullable @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) public String[] setPackagesSuspended(@Nullable String[], boolean, @Nullable android.os.PersistableBundle, @Nullable android.os.PersistableBundle, @Nullable android.content.pm.SuspendDialogInfo); Loading Loading @@ -1658,9 +1658,6 @@ package android.content.pm { method public abstract void onDexModuleRegistered(String, boolean, String); } @IntDef(flag=true, prefix={"RESTRICTION_"}, value={android.content.pm.PackageManager.RESTRICTION_NONE, android.content.pm.PackageManager.RESTRICTION_HIDE_FROM_SUGGESTIONS, android.content.pm.PackageManager.RESTRICTION_HIDE_NOTIFICATIONS}) @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) public static @interface PackageManager.DistractionRestriction { } public static interface PackageManager.OnPermissionsChangedListener { method public void onPermissionsChanged(int); } Loading
core/java/android/content/pm/PackageManager.java +9 −8 Original line number Diff line number Diff line Loading @@ -5910,24 +5910,24 @@ public abstract class PackageManager { /** * Flag to denote no restrictions. This should be used to clear any restrictions that may have * been previously set for the package. * @see PackageManager.DistractionRestriction * @hide * @see #setDistractingPackageRestrictions(String[], int) */ @SystemApi public static final int RESTRICTION_NONE = 0x0; /** * Flag to denote that a package should be hidden from any suggestions to the user. * @see PackageManager.DistractionRestriction * @hide * @see #setDistractingPackageRestrictions(String[], int) */ @SystemApi public static final int RESTRICTION_HIDE_FROM_SUGGESTIONS = 0x00000001; /** * Flag to denote that a package's notifications should be hidden. * @see PackageManager.DistractionRestriction * @hide * @see #setDistractingPackageRestrictions(String[], int) */ @SystemApi public static final int RESTRICTION_HIDE_NOTIFICATIONS = 0x00000002; Loading @@ -5939,7 +5939,6 @@ public abstract class PackageManager { * @see #setDistractingPackageRestrictions(String[], int) * @hide */ @SystemApi @IntDef(flag = true, prefix = {"RESTRICTION_"}, value = { RESTRICTION_NONE, RESTRICTION_HIDE_FROM_SUGGESTIONS, Loading @@ -5957,14 +5956,16 @@ public abstract class PackageManager { * <p>The caller must hold {@link android.Manifest.permission#SUSPEND_APPS} to use this API. * * @param packages Packages to mark as distracting. * @param restrictionFlags Any combination of {@link DistractionRestriction restrictions} to * impose on the given packages. {@link #RESTRICTION_NONE} can be used * to clear any existing restrictions. * @param restrictionFlags Any combination of restrictions to impose on the given packages. * {@link #RESTRICTION_NONE} can be used to clear any existing * restrictions. * @return A list of packages that could not have the {@code restrictionFlags} set. The system * may prevent restricting critical packages to preserve normal device function. * * @see DistractionRestriction * @hide * @see #RESTRICTION_NONE * @see #RESTRICTION_HIDE_FROM_SUGGESTIONS * @see #RESTRICTION_HIDE_NOTIFICATIONS */ @SystemApi @RequiresPermission(android.Manifest.permission.SUSPEND_APPS) Loading
services/core/java/com/android/server/pm/PackageManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -12803,7 +12803,7 @@ public class PackageManagerService extends IPackageManager.Stub public String[] setDistractingPackageRestrictionsAsUser(String[] packageNames, int restrictionFlags, int userId) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.SUSPEND_APPS, "setPackagesSuspendedAsUser"); "setDistractingPackageRestrictionsAsUser"); final int callingUid = Binder.getCallingUid(); if (callingUid != Process.ROOT_UID && callingUid != Process.SYSTEM_UID