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

Commit 05bb8769 authored by Güliz Seray Tuncay's avatar Güliz Seray Tuncay
Browse files

Migrate wellbeing to use role

Migrate wellbeing to use the role infrastructure. Based on ag/13357357.

Bug: 158878560

Test: atest com.google.android.wellbeing.gts.WellbeingTest
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Test: atest FrameworksServicesTests:AppStandbyControllerTests
Change-Id: I0a6c986fe9a53be52013f300ba7795dfdd0887e6
parent 0029787f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2042,7 +2042,9 @@ public class AppStandbyController
                if (activityManager.isLowRamDevice() || ActivityManager.isSmallBatteryDevice()) {
                    mAutoRestrictedBucketDelayMs = 12 * ONE_HOUR;
                }

            } else if (phase == PHASE_BOOT_COMPLETED) {
                // mWellbeingApp needs to be initialized lazily after boot to allow for roles to be
                // parsed and the wellbeing role-holder to be assigned
                final PackageManager packageManager = mContext.getPackageManager();
                mWellbeingApp = packageManager.getWellbeingPackageName();
            }
+2 −1
Original line number Diff line number Diff line
@@ -358,6 +358,7 @@ package android {
    field public static final int config_systemGallery = 17039399; // 0x1040027
    field public static final int config_systemShell = 17039402; // 0x104002a
    field public static final int config_systemSpeechRecognizer = 17039406; // 0x104002e
    field public static final int config_systemWellbeing = 17039408; // 0x1040030
    field public static final int config_systemWifiCoexManager = 17039407; // 0x104002f
  }
@@ -2689,7 +2690,7 @@ package android.content.pm {
    field public static final int PROTECTION_FLAG_RETAIL_DEMO = 16777216; // 0x1000000
    field public static final int PROTECTION_FLAG_ROLE = 67108864; // 0x4000000
    field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000
    field public static final int PROTECTION_FLAG_WELLBEING = 131072; // 0x20000
    field @Deprecated public static final int PROTECTION_FLAG_WELLBEING = 131072; // 0x20000
    field @Nullable public final String backgroundPermission;
    field @StringRes public int requestRes;
  }
+2 −4
Original line number Diff line number Diff line
@@ -200,6 +200,8 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
     * to the <code>wellbeing</code> value of
     * {@link android.R.attr#protectionLevel}.
     *
     * @deprecated this protectionLevel is obsolete. Permissions previously granted through this
     * protectionLevel have been migrated to use <code>role</code> instead
     * @hide
     */
    @SystemApi
@@ -307,7 +309,6 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
            PROTECTION_FLAG_OEM,
            PROTECTION_FLAG_VENDOR_PRIVILEGED,
            PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER,
            PROTECTION_FLAG_WELLBEING,
            PROTECTION_FLAG_DOCUMENTER,
            PROTECTION_FLAG_CONFIGURATOR,
            PROTECTION_FLAG_INCIDENT_REPORT_APPROVER,
@@ -560,9 +561,6 @@ public class PermissionInfo extends PackageItemInfo implements Parcelable {
        if ((level & PermissionInfo.PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER) != 0) {
            protLevel.append("|textClassifier");
        }
        if ((level & PermissionInfo.PROTECTION_FLAG_WELLBEING) != 0) {
            protLevel.append("|wellbeing");
        }
        if ((level & PermissionInfo.PROTECTION_FLAG_DOCUMENTER) != 0) {
            protLevel.append("|documenter");
        }
+4 −4
Original line number Diff line number Diff line
@@ -1915,7 +1915,7 @@
         @hide
    -->
    <permission android:name="android.permission.SUSPEND_APPS"
        android:protectionLevel="signature|wellbeing" />
        android:protectionLevel="signature|role" />

    <!-- Allows applications to discover and pair bluetooth devices.
         <p>Protection level: normal
@@ -2789,7 +2789,7 @@

         <p>Not for use by third-party applications. -->
    <permission android:name="android.permission.SYSTEM_APPLICATION_OVERLAY"
                android:protectionLevel="signature|recents|wellbeing"/>
                android:protectionLevel="signature|recents|role"/>

    <!-- @deprecated Use {@link android.Manifest.permission#REQUEST_COMPANION_RUN_IN_BACKGROUND}
         @hide
@@ -5138,7 +5138,7 @@
    <!-- @SystemApi Allows the holder to access and manage instant applications on the device.
         @hide -->
    <permission android:name="android.permission.ACCESS_INSTANT_APPS"
            android:protectionLevel="signature|installer|verifier|wellbeing" />
            android:protectionLevel="signature|installer|verifier|role" />
    <uses-permission android:name="android.permission.ACCESS_INSTANT_APPS"/>

    <!-- Allows the holder to view the instant applications on the device.
@@ -5318,7 +5318,7 @@
    <!-- @SystemApi Allows an application to turn on / off quiet mode.
         @hide -->
    <permission android:name="android.permission.MODIFY_QUIET_MODE"
                android:protectionLevel="signature|privileged|wellbeing|development" />
                android:protectionLevel="signature|privileged|development" />

    <!-- Allows internal management of the camera framework
         @hide -->
+0 −3
Original line number Diff line number Diff line
@@ -285,9 +285,6 @@
        <!-- Additional flag from base permission type: this permission can be automatically
            granted to the system default text classifier -->
        <flag name="textClassifier" value="0x10000" />
        <!-- Additional flag from base permission type: this permission will be granted to the
             wellbeing app, as defined by the OEM. -->
        <flag name="wellbeing" value="0x20000" />
        <!-- Additional flag from base permission type: this permission can be automatically
            granted to the document manager -->
        <flag name="documenter" value="0x40000" />
Loading