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

Commit 2841f107 authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Add a hidden API to query quarantine state.

Bug: 297934650
Test: manual
Change-Id: Ic1f295e61cdbc2c51d04c998c08d7bd4c7cb9aae
parent 7f170bae
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2945,6 +2945,17 @@ public class ApplicationPackageManager extends PackageManager {
        return isPackageSuspendedForUser(mContext.getOpPackageName(), getUserId());
    }

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

    /** @hide */
    @Override
    public void setApplicationCategoryHint(String packageName, int categoryHint) {
+12 −0
Original line number Diff line number Diff line
@@ -9859,6 +9859,18 @@ public abstract class PackageManager {
        throw new UnsupportedOperationException("getSuspendedPackageAppExtras not implemented");
    }

    /**
     * Query if an app is currently quarantined.
     *
     * @return {@code true} if the given package is quarantined, {@code false} otherwise
     * @throws NameNotFoundException if the package could not be found.
     *
     * @hide
     */
    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.