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

Commit 33f5ddd1 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Add permissions associated with app ops.

Change-Id: I575ad7a3ceea59486ca601f69760b14f6269511d
parent 66e207ec
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3820,6 +3820,7 @@ package android.app {
    method public void startWatchingMode(java.lang.String, java.lang.String, android.app.AppOpsManager.OnOpChangedListener);
    method public void stopWatchingMode(android.app.AppOpsManager.OnOpChangedListener);
    field public static final int MODE_ALLOWED = 0; // 0x0
    field public static final int MODE_DEFAULT = 3; // 0x3
    field public static final int MODE_ERRORED = 2; // 0x2
    field public static final int MODE_IGNORED = 1; // 0x1
    field public static final java.lang.String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -8877,6 +8878,7 @@ package android.content.pm {
    field public static final android.os.Parcelable.Creator CREATOR;
    field public static final int FLAG_COSTS_MONEY = 1; // 0x1
    field public static final int PROTECTION_DANGEROUS = 1; // 0x1
    field public static final int PROTECTION_FLAG_APPOP = 64; // 0x40
    field public static final int PROTECTION_FLAG_DEVELOPMENT = 32; // 0x20
    field public static final int PROTECTION_FLAG_SYSTEM = 16; // 0x10
    field public static final int PROTECTION_MASK_BASE = 15; // 0xf
+8 −1
Original line number Diff line number Diff line
@@ -94,6 +94,13 @@ public class AppOpsManager {
     */
    public static final int MODE_ERRORED = 2;

    /**
     * Result from {@link #checkOp}, {@link #noteOp}, {@link #startOp}: the given caller should
     * use its default security check.  This mode is not normally used; it should only be used
     * with appop permissions, and callers must explicitly check for it and deal with it.
     */
    public static final int MODE_DEFAULT = 3;

    // when adding one of these:
    //  - increment _NUM_OP
    //  - add rows to sOpToSwitch, sOpToString, sOpNames, sOpPerms, sOpDefaultMode
@@ -588,7 +595,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_IGNORED, // OP_GET_USAGE_STATS
            AppOpsManager.MODE_DEFAULT, // OP_GET_USAGE_STATS
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_ALLOWED,
            AppOpsManager.MODE_IGNORED, // OP_PROJECT_MEDIA
+2 −0
Original line number Diff line number Diff line
@@ -110,6 +110,8 @@ interface IPackageManager {

    int getFlagsForUid(int uid);

    String[] getAppOpPermissionPackages(String permissionName);

    ResolveInfo resolveIntent(in Intent intent, String resolvedType, int flags, int userId);

    boolean canForwardTo(in Intent intent, String resolvedType, int sourceUserId, int targetUserId);
+10 −0
Original line number Diff line number Diff line
@@ -68,6 +68,13 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
     */
    public static final int PROTECTION_FLAG_DEVELOPMENT = 0x20;

    /**
     * Additional flag for {@link #protectionLevel}, corresponding
     * to the <code>development</code> value of
     * {@link android.R.attr#protectionLevel}.
     */
    public static final int PROTECTION_FLAG_APPOP = 0x40;

    /**
     * Mask for {@link #protectionLevel}: the basic protection type.
     */
@@ -153,6 +160,9 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
        if ((level&PermissionInfo.PROTECTION_FLAG_DEVELOPMENT) != 0) {
            protLevel += "|development";
        }
        if ((level&PermissionInfo.PROTECTION_FLAG_APPOP) != 0) {
            protLevel += "|appop";
        }
        return protLevel;
    }

+2 −2
Original line number Diff line number Diff line
@@ -2461,7 +2461,7 @@
    <permission android:name="android.permission.PACKAGE_USAGE_STATS"
        android:label="@string/permlab_pkgUsageStats"
        android:description="@string/permdesc_pkgUsageStats"
        android:protectionLevel="signature|system" />
        android:protectionLevel="signature|system|development|appop" />
    <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />

    <!-- @SystemApi Allows an application to collect battery statistics -->
@@ -2469,7 +2469,7 @@
        android:permissionGroup="android.permission-group.SYSTEM_TOOLS"
        android:label="@string/permlab_batteryStats"
        android:description="@string/permdesc_batteryStats"
        android:protectionLevel="signature|system" />
        android:protectionLevel="signature|system|development" />

    <!-- @SystemApi Allows an application to control the backup and restore process.
    <p>Not for use by third-party applications.
Loading