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

Commit 8109e321 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Add a hidden API to query quarantine state." into main

parents b46d691c 2841f107
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2943,6 +2943,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
@@ -9876,6 +9876,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.