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

Commit d4ab19ec authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Remove unnecessary internal APIs.

Test: Built
Change-Id: I5391ac4989d7d5712982f5608f9fc28cf7935b00
parent ec142a52
Loading
Loading
Loading
Loading
+0 −29
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package android.app;

import android.annotation.NonNull;
import android.util.SparseIntArray;

import com.android.internal.util.function.QuadFunction;
@@ -75,32 +74,4 @@ public abstract class AppOpsManagerInternal {
     * access to app ops for their user.
     */
    public abstract void setDeviceAndProfileOwners(SparseIntArray owners);

    /**
     * Sets the app-ops mode for a certain app-op and uid.
     *
     * <p>Similar as {@link AppOpsManager#setUidMode} but does not require the package manager to be
     * working. Hence this can be used very early during boot.
     *
     * <p>Only for internal callers. Does <u>not</u> verify that package name belongs to uid.
     *
     * @param code The op code to set.
     * @param uid The UID for which to set.
     * @param mode The new mode to set.
     */
    public abstract void setUidMode(int code, int uid, int mode);

    /**
     * Get the (raw) mode of an app-op.
     *
     * <p>Does <u>not</u> verify that package belongs to uid. The caller needs to do that.
     *
     * @param code The code of the op
     * @param uid The uid of the package the op belongs to
     * @param packageName The package the op belongs to
     *
     * @return The mode of the op
     */
    public abstract @AppOpsManager.Mode int checkOperationUnchecked(int code, int uid,
            @NonNull String packageName);
}
+2 −29
Original line number Diff line number Diff line
@@ -1722,14 +1722,6 @@ public class AppOpsService extends IAppOpsService.Stub {
        return checkOperationUnchecked(code, uid, resolvedPackageName, raw);
    }

    /**
     * @see #checkOperationUnchecked(int, int, String, boolean, boolean)
     */
    private @Mode int checkOperationUnchecked(int code, int uid, @NonNull String packageName,
            boolean raw) {
        return checkOperationUnchecked(code, uid, packageName, raw, true);
    }

    /**
     * Get the mode of an app-op.
     *
@@ -1737,21 +1729,12 @@ public class AppOpsService extends IAppOpsService.Stub {
     * @param uid The uid of the package the op belongs to
     * @param packageName The package the op belongs to
     * @param raw If the raw state of eval-ed state should be checked.
     * @param verify If the code should check the package belongs to the uid
     *
     * @return The mode of the op
     */
    private @Mode int checkOperationUnchecked(int code, int uid, @NonNull String packageName,
                boolean raw, boolean verify) {
        boolean isPrivileged;
        try {
            isPrivileged = verifyAndGetIsPrivileged(uid, packageName);
        } catch (Exception e) {
            if (verify) {
                throw e;
            }
            return AppOpsManager.MODE_IGNORED;
        }
                boolean raw) {
        boolean isPrivileged = verifyAndGetIsPrivileged(uid, packageName);

        synchronized (this) {
            if (isOpRestrictedLocked(uid, code, packageName, isPrivileged)) {
@@ -4590,15 +4573,5 @@ public class AppOpsService extends IAppOpsService.Stub {
                mProfileOwners = owners;
            }
        }

        @Override
        public void setUidMode(int code, int uid, int mode) {
            AppOpsService.this.setUidMode(code, uid, mode);
        }

        @Override
        public @Mode int checkOperationUnchecked(int code, int uid, @NonNull String packageName) {
            return AppOpsService.this.checkOperationUnchecked(code, uid, packageName, true, false);
        }
    }
}