Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7250e65a authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "PACKAGE_UNSTOPPED broadcast" into main

parents 04728873 b630f15f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -10992,6 +10992,7 @@ package android.content {
    field public static final String ACTION_PACKAGE_REMOVED = "android.intent.action.PACKAGE_REMOVED";
    field public static final String ACTION_PACKAGE_REPLACED = "android.intent.action.PACKAGE_REPLACED";
    field public static final String ACTION_PACKAGE_RESTARTED = "android.intent.action.PACKAGE_RESTARTED";
    field @FlaggedApi("android.content.pm.stay_stopped") public static final String ACTION_PACKAGE_UNSTOPPED = "android.intent.action.PACKAGE_UNSTOPPED";
    field public static final String ACTION_PACKAGE_VERIFIED = "android.intent.action.PACKAGE_VERIFIED";
    field public static final String ACTION_PASTE = "android.intent.action.PASTE";
    field public static final String ACTION_PICK = "android.intent.action.PICK";
@@ -12673,6 +12674,7 @@ package android.content.pm {
    method public boolean isDeviceUpgrading();
    method public abstract boolean isInstantApp();
    method public abstract boolean isInstantApp(@NonNull String);
    method @FlaggedApi("android.content.pm.stay_stopped") public boolean isPackageStopped(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean isPackageSuspended(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public boolean isPackageSuspended();
    method @CheckResult public abstract boolean isPermissionRevokedByPolicy(@NonNull String, @NonNull String);
+11 −0
Original line number Diff line number Diff line
@@ -2954,6 +2954,17 @@ public class ApplicationPackageManager extends PackageManager {
        }
    }

    @Override
    public boolean isPackageStopped(@NonNull String packageName) throws NameNotFoundException {
        try {
            return mPM.isPackageStoppedForUser(packageName, getUserId());
        } catch (IllegalArgumentException ie) {
            throw new NameNotFoundException(packageName);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /** @hide */
    @Override
    public void setApplicationCategoryHint(String packageName, int categoryHint) {
+14 −0
Original line number Diff line number Diff line
@@ -2790,6 +2790,20 @@ public class Intent implements Parcelable, Cloneable {
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_PACKAGE_CHANGED = "android.intent.action.PACKAGE_CHANGED";
    /**
     * Broadcast Action: An application package that was previously in the stopped state has been
     * started and is no longer considered stopped.
     * <ul>
     * <li> {@link #EXTRA_UID} containing the integer uid assigned to the package.
     * </ul>
     *
     * <p class="note">This is a protected intent that can only be sent by the system.
     */
    @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
    @FlaggedApi(android.content.pm.Flags.FLAG_STAY_STOPPED)
    public static final String ACTION_PACKAGE_UNSTOPPED = "android.intent.action.PACKAGE_UNSTOPPED";
    /**
     * Broadcast Action: Sent to the system rollback manager when a package
     * needs to have rollback enabled.
+2 −0
Original line number Diff line number Diff line
@@ -308,6 +308,8 @@ interface IPackageManager {

    boolean isPackageQuarantinedForUser(String packageName, int userId);

    boolean isPackageStoppedForUser(String packageName, int userId);

    Bundle getSuspendedPackageAppExtras(String packageName, int userId);

    /**
+12 −1
Original line number Diff line number Diff line
@@ -9877,6 +9877,18 @@ public abstract class PackageManager {
        throw new UnsupportedOperationException("getSuspendedPackageAppExtras not implemented");
    }

    /**
     * Query if an app is currently stopped.
     *
     * @return {@code true} if the given package is stopped, {@code false} otherwise
     * @throws NameNotFoundException if the package could not be found.
     * @see ApplicationInfo#FLAG_STOPPED
     */
    @FlaggedApi(android.content.pm.Flags.FLAG_STAY_STOPPED)
    public boolean isPackageStopped(@NonNull String packageName) throws NameNotFoundException {
        throw new UnsupportedOperationException("isPackageStopped not implemented");
    }

    /**
     * Query if an app is currently quarantined.
     *
@@ -9888,7 +9900,6 @@ public abstract class PackageManager {
    public boolean isPackageQuarantined(@NonNull String packageName) throws NameNotFoundException {
        throw new UnsupportedOperationException("isPackageQuarantined not implemented");
    }

    /**
     * Provide a hint of what the {@link ApplicationInfo#category} value should
     * be for the given package.
Loading