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

Commit 07e850a9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add new permission / appop for reading loader data"

parents 4833658f b0948d4c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ package android {
    field public static final String INTERACT_ACROSS_PROFILES = "android.permission.INTERACT_ACROSS_PROFILES";
    field public static final String INTERNET = "android.permission.INTERNET";
    field public static final String KILL_BACKGROUND_PROCESSES = "android.permission.KILL_BACKGROUND_PROCESSES";
    field public static final String LOADER_USAGE_STATS = "android.permission.LOADER_USAGE_STATS";
    field public static final String LOCATION_HARDWARE = "android.permission.LOCATION_HARDWARE";
    field public static final String MANAGE_DOCUMENTS = "android.permission.MANAGE_DOCUMENTS";
    field public static final String MANAGE_EXTERNAL_STORAGE = "android.permission.MANAGE_EXTERNAL_STORAGE";
+1 −0
Original line number Diff line number Diff line
@@ -392,6 +392,7 @@ package android.app {
    field public static final String OPSTR_INSTANT_APP_START_FOREGROUND = "android:instant_app_start_foreground";
    field public static final String OPSTR_INTERACT_ACROSS_PROFILES = "android:interact_across_profiles";
    field public static final String OPSTR_LEGACY_STORAGE = "android:legacy_storage";
    field public static final String OPSTR_LOADER_USAGE_STATS = "android:loader_usage_stats";
    field public static final String OPSTR_MANAGE_EXTERNAL_STORAGE = "android:manage_external_storage";
    field public static final String OPSTR_MANAGE_IPSEC_TUNNELS = "android:manage_ipsec_tunnels";
    field public static final String OPSTR_MUTE_MICROPHONE = "android:mute_microphone";
+16 −2
Original line number Diff line number Diff line
@@ -924,10 +924,12 @@ public class AppOpsManager {
     * @hide
     */
    public static final int OP_ACTIVATE_PLATFORM_VPN = 94;
    /** @hide */
    public static final int OP_LOADER_USAGE_STATS = 95;

    /** @hide */
    @UnsupportedAppUsage
    public static final int _NUM_OP = 95;
    public static final int _NUM_OP = 96;

    /** Access to coarse location information. */
    public static final String OPSTR_COARSE_LOCATION = "android:coarse_location";
@@ -1224,6 +1226,9 @@ public class AppOpsManager {
    public static final String OPSTR_INTERACT_ACROSS_PROFILES = "android:interact_across_profiles";
    /** @hide Start Platform VPN without user intervention */
    public static final String OPSTR_ACTIVATE_PLATFORM_VPN = "android:activate_platform_vpn";
    /** @hide */
    @SystemApi
    public static final String OPSTR_LOADER_USAGE_STATS = "android:loader_usage_stats";


    /** {@link #sAppOpsToNote} not initialized yet for this op */
@@ -1302,7 +1307,8 @@ public class AppOpsManager {
            OP_MANAGE_IPSEC_TUNNELS,
            OP_INSTANT_APP_START_FOREGROUND,
            OP_MANAGE_EXTERNAL_STORAGE,
            OP_INTERACT_ACROSS_PROFILES
            OP_INTERACT_ACROSS_PROFILES,
            OP_LOADER_USAGE_STATS,
    };

    /**
@@ -1409,6 +1415,7 @@ public class AppOpsManager {
            OP_MANAGE_EXTERNAL_STORAGE,         // MANAGE_EXTERNAL_STORAGE
            OP_INTERACT_ACROSS_PROFILES,        //INTERACT_ACROSS_PROFILES
            OP_ACTIVATE_PLATFORM_VPN,           // ACTIVATE_PLATFORM_VPN
            OP_LOADER_USAGE_STATS,              // LOADER_USAGE_STATS
    };

    /**
@@ -1510,6 +1517,7 @@ public class AppOpsManager {
            OPSTR_MANAGE_EXTERNAL_STORAGE,
            OPSTR_INTERACT_ACROSS_PROFILES,
            OPSTR_ACTIVATE_PLATFORM_VPN,
            OPSTR_LOADER_USAGE_STATS,
    };

    /**
@@ -1612,6 +1620,7 @@ public class AppOpsManager {
            "MANAGE_EXTERNAL_STORAGE",
            "INTERACT_ACROSS_PROFILES",
            "ACTIVATE_PLATFORM_VPN",
            "LOADER_USAGE_STATS",
    };

    /**
@@ -1715,6 +1724,7 @@ public class AppOpsManager {
            Manifest.permission.MANAGE_EXTERNAL_STORAGE,
            android.Manifest.permission.INTERACT_ACROSS_PROFILES,
            null, // no permission for OP_ACTIVATE_PLATFORM_VPN
            android.Manifest.permission.LOADER_USAGE_STATS,
    };

    /**
@@ -1818,6 +1828,7 @@ public class AppOpsManager {
            null, // MANAGE_EXTERNAL_STORAGE
            null, // INTERACT_ACROSS_PROFILES
            null, // ACTIVATE_PLATFORM_VPN
            null, // LOADER_USAGE_STATS
    };

    /**
@@ -1920,6 +1931,7 @@ public class AppOpsManager {
            false, // MANAGE_EXTERNAL_STORAGE
            false, // INTERACT_ACROSS_PROFILES
            false, // ACTIVATE_PLATFORM_VPN
            false, // LOADER_USAGE_STATS
    };

    /**
@@ -2021,6 +2033,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_DEFAULT, // MANAGE_EXTERNAL_STORAGE
            AppOpsManager.MODE_DEFAULT, // INTERACT_ACROSS_PROFILES
            AppOpsManager.MODE_IGNORED, // ACTIVATE_PLATFORM_VPN
            AppOpsManager.MODE_DEFAULT, // LOADER_USAGE_STATS
    };

    /**
@@ -2126,6 +2139,7 @@ public class AppOpsManager {
            false, // MANAGE_EXTERNAL_STORAGE
            false, // INTERACT_ACROSS_PROFILES
            false, // ACTIVATE_PLATFORM_VPN
            false, // LOADER_USAGE_STATS
    };

    /**
+2 −2
Original line number Diff line number Diff line
@@ -256,10 +256,10 @@ public final class AsyncNotedAppOp implements Parcelable {
    };

    @DataClass.Generated(
            time = 1578516519372L,
            time = 1580158740502L,
            codegenVersion = "1.0.14",
            sourceFile = "frameworks/base/core/java/android/app/AsyncNotedAppOp.java",
            inputSignatures = "private final @android.annotation.IntRange(from=0L, to=94L) int mOpCode\nprivate final @android.annotation.IntRange(from=0L) int mNotingUid\nprivate final @android.annotation.Nullable java.lang.String mFeatureId\nprivate final @android.annotation.NonNull java.lang.String mMessage\nprivate final @android.annotation.IntRange(from=0L) long mTime\npublic @android.annotation.NonNull java.lang.String getOp()\nclass AsyncNotedAppOp extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true, genHiddenConstructor=true)")
            inputSignatures = "private final @android.annotation.IntRange(from=0L, to=95L) int mOpCode\nprivate final @android.annotation.IntRange(from=0L) int mNotingUid\nprivate final @android.annotation.Nullable java.lang.String mFeatureId\nprivate final @android.annotation.NonNull java.lang.String mMessage\nprivate final @android.annotation.IntRange(from=0L) long mTime\npublic @android.annotation.NonNull java.lang.String getOp()\nclass AsyncNotedAppOp extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genEqualsHashCode=true, genAidl=true, genHiddenConstructor=true)")
    @Deprecated
    private void __metadata() {}

+9 −0
Original line number Diff line number Diff line
@@ -4047,6 +4047,15 @@
        android:protectionLevel="signature|privileged|development|appop|retailDemo" />
    <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />

    <!-- Allows a data loader to read a package's access logs. The access logs contain the
         set of pages referenced over time.
         <p>Declaring the permission implies intention to use the API and the user of the
         device can grant permission through the Settings application.
         <p>Protection level: signature|privileged|appop -->
    <permission android:name="android.permission.LOADER_USAGE_STATS"
        android:protectionLevel="signature|privileged|appop" />
    <uses-permission android:name="android.permission.LOADER_USAGE_STATS" />

    <!-- @hide @SystemApi Allows an application to observe usage time of apps. The app can register
         for callbacks when apps reach a certain usage time limit, etc. -->
    <permission android:name="android.permission.OBSERVE_APP_USAGE"