Loading api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -10956,7 +10956,7 @@ package android.content.pm { method public abstract void onPackageRemoved(java.lang.String, android.os.UserHandle); method public abstract void onPackagesAvailable(java.lang.String[], android.os.UserHandle, boolean); method public void onPackagesSuspended(java.lang.String[], android.os.UserHandle); method public void onPackagesSuspended(java.lang.String[], android.os.Bundle, android.os.UserHandle); method public void onPackagesSuspended(java.lang.String[], android.os.UserHandle, android.os.Bundle); method public abstract void onPackagesUnavailable(java.lang.String[], android.os.UserHandle, boolean); method public void onPackagesUnsuspended(java.lang.String[], android.os.UserHandle); method public void onShortcutsChanged(java.lang.String, java.util.List<android.content.pm.ShortcutInfo>, android.os.UserHandle); api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -1030,7 +1030,7 @@ package android.content.pm { method public abstract void grantRuntimePermission(java.lang.String, java.lang.String, android.os.UserHandle); method public abstract int installExistingPackage(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract int installExistingPackage(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException; method public boolean isPackageSuspended(java.lang.String); method public boolean isPackageSuspended(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; method public java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceiversAsUser(android.content.Intent, int, android.os.UserHandle); method public abstract void registerDexModule(java.lang.String, android.content.pm.PackageManager.DexModuleRegisterCallback); method public abstract void removeOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener); Loading core/java/android/app/ApplicationPackageManager.java +6 −2 Original line number Diff line number Diff line Loading @@ -2187,8 +2187,12 @@ public class ApplicationPackageManager extends PackageManager { /** @hide */ @Override public boolean isPackageSuspended(String packageName) { public boolean isPackageSuspended(String packageName) throws NameNotFoundException { try { return isPackageSuspendedForUser(packageName, mContext.getUserId()); } catch (IllegalArgumentException ie) { throw new NameNotFoundException(packageName); } } @Override Loading core/java/android/content/Intent.java +13 −2 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.os.PersistableBundle; import android.os.Process; import android.os.ResultReceiver; import android.os.ShellCommand; Loading Loading @@ -1814,8 +1815,12 @@ public class Intent implements Parcelable, Cloneable { public static final String EXTRA_PACKAGE_NAME = "android.intent.extra.PACKAGE_NAME"; /** * Intent extra: A {@link Bundle} of extras for a package being suspended. Will be sent with * {@link #ACTION_MY_PACKAGE_SUSPENDED}. * Intent extra: A {@link Bundle} of extras for a package being suspended. Will be sent as an * extra with {@link #ACTION_MY_PACKAGE_SUSPENDED}. * * <p>The contents of this {@link Bundle} are a contract between the suspended app and the * suspending app, i.e. any app with the permission {@code android.permission.SUSPEND_APPS}. * This is meant to enable the suspended app to better handle the state of being suspended. * * @see #ACTION_MY_PACKAGE_SUSPENDED * @see #ACTION_MY_PACKAGE_UNSUSPENDED Loading Loading @@ -2284,6 +2289,10 @@ public class Intent implements Parcelable, Cloneable { /** * Activity Action: Started to show more details about why an application was suspended. * * <p>Whenever the system detects an activity launch for a suspended app, it shows a dialog to * the user to inform them of the state and present them an affordance to start this activity * action to show more details about the reason for suspension. * * <p>Apps holding {@link android.Manifest.permission#SUSPEND_APPS} must declare an activity * handling this intent and protect it with * {@link android.Manifest.permission#SEND_SHOW_SUSPENDED_APP_DETAILS}. Loading @@ -2293,6 +2302,8 @@ public class Intent implements Parcelable, Cloneable { * <p class="note">This is a protected intent that can only be sent * by the system. * * @see PackageManager#setPackagesSuspended(String[], boolean, PersistableBundle, * PersistableBundle, String) * @see PackageManager#isPackageSuspended() * @see #ACTION_PACKAGES_SUSPENDED * Loading core/java/android/content/pm/LauncherApps.java +16 −8 Original line number Diff line number Diff line Loading @@ -212,7 +212,7 @@ public class LauncherApps { * an applicaton. * * <p>Note: On devices running {@link android.os.Build.VERSION_CODES#P Android P} or higher, * any apps that override {@link #onPackagesSuspended(String[], Bundle, UserHandle)} will * any apps that override {@link #onPackagesSuspended(String[], UserHandle, Bundle)} will * not receive this callback. * * @param packageNames The names of the packages that have just been Loading @@ -226,15 +226,20 @@ public class LauncherApps { * Indicates that one or more packages have been suspended. A device administrator or an app * with {@code android.permission.SUSPEND_APPS} can do this. * * <p>A suspending app with the permission {@code android.permission.SUSPEND_APPS} can * optionally provide a {@link Bundle} of extra information that it deems helpful for the * launcher to handle the suspended state of these packages. The contents of this * {@link Bundle} supposed to be a contract between the suspending app and the launcher. * * @param packageNames The names of the packages that have just been suspended. * @param launcherExtras A {@link Bundle} of extras for the launcher. * @param user the user for which the given packages were suspended. * * @param launcherExtras A {@link Bundle} of extras for the launcher, if provided to the * system, {@code null} otherwise. * @see PackageManager#isPackageSuspended() * @see #getSuspendedPackageLauncherExtras(String, UserHandle) */ public void onPackagesSuspended(String[] packageNames, @Nullable Bundle launcherExtras, UserHandle user) { public void onPackagesSuspended(String[] packageNames, UserHandle user, @Nullable Bundle launcherExtras) { onPackagesSuspended(packageNames, user); } Loading Loading @@ -662,6 +667,9 @@ public class LauncherApps { * {@code PackageManager#setPackagesSuspended(String[], boolean, PersistableBundle, * PersistableBundle, String)}. * * <p>The contents of this {@link Bundle} are supposed to be a contract between the suspending * app and the launcher. * * <p>Note: This just returns whatever extras were provided to the system, <em>which might * even be {@code null}.</em> * Loading @@ -670,7 +678,7 @@ public class LauncherApps { * @return A {@link Bundle} of launcher extras. Or {@code null} if the package is not currently * suspended. * * @see Callback#onPackagesSuspended(String[], Bundle, UserHandle) * @see Callback#onPackagesSuspended(String[], UserHandle, Bundle) * @see PackageManager#isPackageSuspended() */ public @Nullable Bundle getSuspendedPackageLauncherExtras(String packageName, UserHandle user) { Loading Loading @@ -1298,8 +1306,8 @@ public class LauncherApps { mCallback.onPackagesUnavailable(info.packageNames, info.user, info.replacing); break; case MSG_SUSPENDED: mCallback.onPackagesSuspended(info.packageNames, info.launcherExtras, info.user); mCallback.onPackagesSuspended(info.packageNames, info.user, info.launcherExtras ); break; case MSG_UNSUSPENDED: mCallback.onPackagesUnsuspended(info.packageNames, info.user); Loading Loading
api/current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -10956,7 +10956,7 @@ package android.content.pm { method public abstract void onPackageRemoved(java.lang.String, android.os.UserHandle); method public abstract void onPackagesAvailable(java.lang.String[], android.os.UserHandle, boolean); method public void onPackagesSuspended(java.lang.String[], android.os.UserHandle); method public void onPackagesSuspended(java.lang.String[], android.os.Bundle, android.os.UserHandle); method public void onPackagesSuspended(java.lang.String[], android.os.UserHandle, android.os.Bundle); method public abstract void onPackagesUnavailable(java.lang.String[], android.os.UserHandle, boolean); method public void onPackagesUnsuspended(java.lang.String[], android.os.UserHandle); method public void onShortcutsChanged(java.lang.String, java.util.List<android.content.pm.ShortcutInfo>, android.os.UserHandle);
api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -1030,7 +1030,7 @@ package android.content.pm { method public abstract void grantRuntimePermission(java.lang.String, java.lang.String, android.os.UserHandle); method public abstract int installExistingPackage(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; method public abstract int installExistingPackage(java.lang.String, int) throws android.content.pm.PackageManager.NameNotFoundException; method public boolean isPackageSuspended(java.lang.String); method public boolean isPackageSuspended(java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException; method public java.util.List<android.content.pm.ResolveInfo> queryBroadcastReceiversAsUser(android.content.Intent, int, android.os.UserHandle); method public abstract void registerDexModule(java.lang.String, android.content.pm.PackageManager.DexModuleRegisterCallback); method public abstract void removeOnPermissionsChangeListener(android.content.pm.PackageManager.OnPermissionsChangedListener); Loading
core/java/android/app/ApplicationPackageManager.java +6 −2 Original line number Diff line number Diff line Loading @@ -2187,8 +2187,12 @@ public class ApplicationPackageManager extends PackageManager { /** @hide */ @Override public boolean isPackageSuspended(String packageName) { public boolean isPackageSuspended(String packageName) throws NameNotFoundException { try { return isPackageSuspendedForUser(packageName, mContext.getUserId()); } catch (IllegalArgumentException ie) { throw new NameNotFoundException(packageName); } } @Override Loading
core/java/android/content/Intent.java +13 −2 Original line number Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; import android.os.PersistableBundle; import android.os.Process; import android.os.ResultReceiver; import android.os.ShellCommand; Loading Loading @@ -1814,8 +1815,12 @@ public class Intent implements Parcelable, Cloneable { public static final String EXTRA_PACKAGE_NAME = "android.intent.extra.PACKAGE_NAME"; /** * Intent extra: A {@link Bundle} of extras for a package being suspended. Will be sent with * {@link #ACTION_MY_PACKAGE_SUSPENDED}. * Intent extra: A {@link Bundle} of extras for a package being suspended. Will be sent as an * extra with {@link #ACTION_MY_PACKAGE_SUSPENDED}. * * <p>The contents of this {@link Bundle} are a contract between the suspended app and the * suspending app, i.e. any app with the permission {@code android.permission.SUSPEND_APPS}. * This is meant to enable the suspended app to better handle the state of being suspended. * * @see #ACTION_MY_PACKAGE_SUSPENDED * @see #ACTION_MY_PACKAGE_UNSUSPENDED Loading Loading @@ -2284,6 +2289,10 @@ public class Intent implements Parcelable, Cloneable { /** * Activity Action: Started to show more details about why an application was suspended. * * <p>Whenever the system detects an activity launch for a suspended app, it shows a dialog to * the user to inform them of the state and present them an affordance to start this activity * action to show more details about the reason for suspension. * * <p>Apps holding {@link android.Manifest.permission#SUSPEND_APPS} must declare an activity * handling this intent and protect it with * {@link android.Manifest.permission#SEND_SHOW_SUSPENDED_APP_DETAILS}. Loading @@ -2293,6 +2302,8 @@ public class Intent implements Parcelable, Cloneable { * <p class="note">This is a protected intent that can only be sent * by the system. * * @see PackageManager#setPackagesSuspended(String[], boolean, PersistableBundle, * PersistableBundle, String) * @see PackageManager#isPackageSuspended() * @see #ACTION_PACKAGES_SUSPENDED * Loading
core/java/android/content/pm/LauncherApps.java +16 −8 Original line number Diff line number Diff line Loading @@ -212,7 +212,7 @@ public class LauncherApps { * an applicaton. * * <p>Note: On devices running {@link android.os.Build.VERSION_CODES#P Android P} or higher, * any apps that override {@link #onPackagesSuspended(String[], Bundle, UserHandle)} will * any apps that override {@link #onPackagesSuspended(String[], UserHandle, Bundle)} will * not receive this callback. * * @param packageNames The names of the packages that have just been Loading @@ -226,15 +226,20 @@ public class LauncherApps { * Indicates that one or more packages have been suspended. A device administrator or an app * with {@code android.permission.SUSPEND_APPS} can do this. * * <p>A suspending app with the permission {@code android.permission.SUSPEND_APPS} can * optionally provide a {@link Bundle} of extra information that it deems helpful for the * launcher to handle the suspended state of these packages. The contents of this * {@link Bundle} supposed to be a contract between the suspending app and the launcher. * * @param packageNames The names of the packages that have just been suspended. * @param launcherExtras A {@link Bundle} of extras for the launcher. * @param user the user for which the given packages were suspended. * * @param launcherExtras A {@link Bundle} of extras for the launcher, if provided to the * system, {@code null} otherwise. * @see PackageManager#isPackageSuspended() * @see #getSuspendedPackageLauncherExtras(String, UserHandle) */ public void onPackagesSuspended(String[] packageNames, @Nullable Bundle launcherExtras, UserHandle user) { public void onPackagesSuspended(String[] packageNames, UserHandle user, @Nullable Bundle launcherExtras) { onPackagesSuspended(packageNames, user); } Loading Loading @@ -662,6 +667,9 @@ public class LauncherApps { * {@code PackageManager#setPackagesSuspended(String[], boolean, PersistableBundle, * PersistableBundle, String)}. * * <p>The contents of this {@link Bundle} are supposed to be a contract between the suspending * app and the launcher. * * <p>Note: This just returns whatever extras were provided to the system, <em>which might * even be {@code null}.</em> * Loading @@ -670,7 +678,7 @@ public class LauncherApps { * @return A {@link Bundle} of launcher extras. Or {@code null} if the package is not currently * suspended. * * @see Callback#onPackagesSuspended(String[], Bundle, UserHandle) * @see Callback#onPackagesSuspended(String[], UserHandle, Bundle) * @see PackageManager#isPackageSuspended() */ public @Nullable Bundle getSuspendedPackageLauncherExtras(String packageName, UserHandle user) { Loading Loading @@ -1298,8 +1306,8 @@ public class LauncherApps { mCallback.onPackagesUnavailable(info.packageNames, info.user, info.replacing); break; case MSG_SUSPENDED: mCallback.onPackagesSuspended(info.packageNames, info.launcherExtras, info.user); mCallback.onPackagesSuspended(info.packageNames, info.user, info.launcherExtras ); break; case MSG_UNSUSPENDED: mCallback.onPackagesUnsuspended(info.packageNames, info.user); Loading