AppOpsManagerCompat

public final class AppOpsManagerCompat


Helper for accessing features in android.app.AppOpsManager.

Summary

Constants

static final int

Result from noteOp: the given caller is allowed to perform the given operation.

static final int

Result from noteOp: the given caller should use its default security check.

static final int

Result from noteOpNoThrow: the given caller is not allowed to perform the given operation, and this attempt should cause it to have a fatal error, typically a SecurityException.

static final int

Result from noteOp: the given caller is not allowed to perform the given operation, and this attempt should silently fail (it should not cause the app to crash).

Public constructors

Public methods

static int
checkOrNoteProxyOp(
    @NonNull Context context,
    int proxyUid,
    @NonNull String op,
    @NonNull String proxiedPackageName
)

Check op for both proxy and proxied packages.

static int
noteOp(
    @NonNull Context context,
    @NonNull String op,
    int uid,
    @NonNull String packageName
)

Make note of an application performing an operation.

static int
noteOpNoThrow(
    @NonNull Context context,
    @NonNull String op,
    int uid,
    @NonNull String packageName
)

Like noteOp but instead of throwing a SecurityException it returns MODE_ERRORED.

static int
noteProxyOp(
    @NonNull Context context,
    @NonNull String op,
    @NonNull String proxiedPackageName
)

Make note of an application performing an operation on behalf of another application when handling an IPC.

static int
noteProxyOpNoThrow(
    @NonNull Context context,
    @NonNull String op,
    @NonNull String proxiedPackageName
)

Like noteProxyOp but instead of throwing a