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

Commit 550ec2c8 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [15633344, 15633345, 15633457, 15633423, 15633424,...

Merge cherrypicks of [15633344, 15633345, 15633457, 15633423, 15633424, 15633425, 15633095, 15633401, 15632569, 15633426, 15633427, 15633402, 15633346, 15633347, 15633403, 15633458] into sc-release

Change-Id: If324c46091cedb24582f468faa6e57447877ca0d
parents 90caa972 5699b607
Loading
Loading
Loading
Loading
+54 −54
Original line number Diff line number Diff line
@@ -248,37 +248,37 @@
    <color name="system_accent1_0">#ffffff</color>
    <!-- Shade of the accent system color at 99% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_10">#F1FFFC</color>
    <color name="system_accent1_10">#F9FCFF</color>
    <!-- Shade of the accent system color at 95% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_50">#9CFFF2</color>
    <color name="system_accent1_50">#E0F3FF</color>
    <!-- Shade of the accent system color at 90% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_100">#8DF5E3</color>
    <color name="system_accent1_100">#C1E8FF</color>
    <!-- Shade of the accent system color at 80% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_200">#71D8C7</color>
    <color name="system_accent1_200">#76D1FF</color>
    <!-- Shade of the accent system color at 70% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_300">#53BCAC</color>
    <color name="system_accent1_300">#4BB6E8</color>
    <!-- Shade of the accent system color at 60% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_400">#34A192</color>
    <color name="system_accent1_400">#219BCC</color>
    <!-- Shade of the accent system color at 49% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_500">#008375</color>
    <color name="system_accent1_500">#007FAC</color>
    <!-- Shade of the accent system color at 40% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_600">#006C5F</color>
    <color name="system_accent1_600">#00668B</color>
    <!-- Shade of the accent system color at 30% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_700">#005747</color>
    <color name="system_accent1_700">#004C69</color>
    <!-- Shade of the accent system color at 20% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_800">#003E31</color>
    <color name="system_accent1_800">#003549</color>
    <!-- Shade of the accent system color at 10% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_900">#002214</color>
    <color name="system_accent1_900">#001E2C</color>
    <!-- Darkest shade of the accent color used by the system. Black.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent1_1000">#000000</color>
@@ -288,37 +288,37 @@
    <color name="system_accent2_0">#ffffff</color>
    <!-- Shade of the secondary accent system color at 99% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_10">#F0FFFC</color>
    <color name="system_accent2_10">#F9FCFF</color>
    <!-- Shade of the secondary accent system color at 95% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_50">#CDFAF1</color>
    <color name="system_accent2_50">#E0F3FF</color>
    <!-- Shade of the secondary accent system color at 90% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_100">#BFEBE3</color>
    <color name="system_accent2_100">#D1E5F4</color>
    <!-- Shade of the secondary accent system color at 80% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_200">#A4CFC7</color>
    <color name="system_accent2_200">#B5CAD7</color>
    <!-- Shade of the secondary accent system color at 70% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_300">#89B4AC</color>
    <color name="system_accent2_300">#9AAEBB</color>
    <!-- Shade of the secondary accent system color at 60% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_400">#6F9991</color>
    <color name="system_accent2_400">#8094A0</color>
    <!-- Shade of the secondary accent system color at 49% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_500">#537C75</color>
    <color name="system_accent2_500">#657985</color>
    <!-- Shade of the secondary accent system color at 40% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_600">#3D665F</color>
    <color name="system_accent2_600">#4E616C</color>
    <!-- Shade of the secondary accent system color at 30% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_700">#254E47</color>
    <color name="system_accent2_700">#374955</color>
    <!-- Shade of the secondary accent system color at 20% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_800">#0C3731</color>
    <color name="system_accent2_800">#20333D</color>
    <!-- Shade of the secondary accent system color at 10% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_900">#00211C</color>
    <color name="system_accent2_900">#091E28</color>
    <!-- Darkest shade of the secondary accent color used by the system. Black.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent2_1000">#000000</color>
@@ -331,34 +331,34 @@
    <color name="system_accent3_10">#FFFBFF</color>
    <!-- Shade of the tertiary accent system color at 95% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_50">#F9EAFF</color>
    <color name="system_accent3_50">#F5EEFF</color>
    <!-- Shade of the tertiary accent system color at 90% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_100">#ECDBFF</color>
    <color name="system_accent3_100">#E6DEFF</color>
    <!-- Shade of the tertiary accent system color at 80% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_200">#CFBFEB</color>
    <color name="system_accent3_200">#CAC1EA</color>
    <!-- Shade of the tertiary accent system color at 70% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_300">#B3A4CF</color>
    <color name="system_accent3_300">#AEA6CE</color>
    <!-- Shade of the tertiary accent system color at 60% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_400">#988AB3</color>
    <color name="system_accent3_400">#938CB1</color>
    <!-- Shade of the tertiary accent system color at 49% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_500">#7B6E96</color>
    <color name="system_accent3_500">#787296</color>
    <!-- Shade of the tertiary accent system color at 40% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_600">#64587F</color>
    <color name="system_accent3_600">#605A7C</color>
    <!-- Shade of the tertiary accent system color at 30% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_700">#4C4165</color>
    <color name="system_accent3_700">#484264</color>
    <!-- Shade of the tertiary accent system color at 20% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_800">#352B4D</color>
    <color name="system_accent3_800">#322C4C</color>
    <!-- Shade of the tertiary accent system color at 10% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_900">#1E1636</color>
    <color name="system_accent3_900">#1D1736</color>
    <!-- Darkest shade of the tertiary accent color used by the system. Black.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_accent3_1000">#000000</color>
@@ -368,37 +368,37 @@
    <color name="system_neutral1_0">#ffffff</color>
    <!-- Shade of the neutral system color at 99% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_10">#fbfbfb</color>
    <color name="system_neutral1_10">#FCFCFF</color>
    <!-- Shade of the neutral system color at 95% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_50">#f0f0f0</color>
    <color name="system_neutral1_50">#F0F0F3</color>
    <!-- Shade of the neutral system color at 90% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_100">#e2e2e2</color>
    <color name="system_neutral1_100">#E1E3E5</color>
    <!-- Shade of the neutral system color at 80% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_200">#c6c6c6</color>
    <color name="system_neutral1_200">#C5C7C9</color>
    <!-- Shade of the neutral system color at 70% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_300">#ababab</color>
    <color name="system_neutral1_300">#AAABAE</color>
    <!-- Shade of the neutral system color at 60% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_400">#909090</color>
    <color name="system_neutral1_400">#8F9193</color>
    <!-- Shade of the neutral system color at 49% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_500">#757575</color>
    <color name="system_neutral1_500">#747679</color>
    <!-- Shade of the neutral system color at 40% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_600">#5e5e5e</color>
    <color name="system_neutral1_600">#5C5F61</color>
    <!-- Shade of the neutral system color at 30% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_700">#464646</color>
    <color name="system_neutral1_700">#454749</color>
    <!-- Shade of the neutral system color at 20% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_800">#303030</color>
    <color name="system_neutral1_800">#2E3133</color>
    <!-- Shade of the neutral system color at 10% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_900">#1b1b1b</color>
    <color name="system_neutral1_900">#191C1E</color>
    <!-- Darkest shade of the neutral color used by the system. Black.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral1_1000">#000000</color>
@@ -408,37 +408,37 @@
    <color name="system_neutral2_0">#ffffff</color>
    <!-- Shade of the secondary neutral system color at 99% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_10">#fbfbfb</color>
    <color name="system_neutral2_10">#F9FCFF</color>
    <!-- Shade of the secondary neutral system color at 95% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_50">#f0f0f0</color>
    <color name="system_neutral2_50">#EBF1F8</color>
    <!-- Shade of the secondary neutral system color at 90% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_100">#e2e2e2</color>
    <color name="system_neutral2_100">#DCE3E9</color>
    <!-- Shade of the secondary neutral system color at 80% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_200">#c6c6c6</color>
    <color name="system_neutral2_200">#C0C7CD</color>
    <!-- Shade of the secondary neutral system color at 70% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_300">#ababab</color>
    <color name="system_neutral2_300">#A5ACB2</color>
    <!-- Shade of the secondary neutral system color at 60% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_400">#909090</color>
    <color name="system_neutral2_400">#8A9297</color>
    <!-- Shade of the secondary neutral system color at 49% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_500">#757575</color>
    <color name="system_neutral2_500">#70777C</color>
    <!-- Shade of the secondary neutral system color at 40% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_600">#5e5e5e</color>
    <color name="system_neutral2_600">#585F65</color>
    <!-- Shade of the secondary neutral system color at 30% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_700">#464646</color>
    <color name="system_neutral2_700">#40484D</color>
    <!-- Shade of the secondary neutral system color at 20% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_800">#303030</color>
    <color name="system_neutral2_800">#2A3136</color>
    <!-- Shade of the secondary neutral system color at 10% lightness.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_900">#1b1b1b</color>
    <color name="system_neutral2_900">#161C20</color>
    <!-- Darkest shade of the secondary neutral color used by the system. Black.
     This value can be overlaid at runtime by OverlayManager RROs. -->
    <color name="system_neutral2_1000">#000000</color>
+0 −1
Original line number Diff line number Diff line
@@ -2122,7 +2122,6 @@ final class DisplayPowerController implements AutomaticBrightnessController.Call

    private void ignoreProximitySensorUntilChangedInternal() {
        if (!mIgnoreProximityUntilChanged
                && mPowerRequest.useProximitySensor
                && mProximity == PROXIMITY_POSITIVE) {
            // Only ignore if it is still reporting positive (near)
            mIgnoreProximityUntilChanged = true;
+2 −3
Original line number Diff line number Diff line
@@ -196,9 +196,8 @@ public final class AppOpsPolicy implements AppOpsManagerInternal.CheckOpsDelegat
    }

    private static boolean isHotwordDetectionServiceRequired(PackageManager pm) {
        // The HotwordDetectionService APIs aren't ready yet for Auto or TV.
        return !(pm.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)
                || pm.hasSystemFeature(PackageManager.FEATURE_LEANBACK));
        // Usage of the HotwordDetectionService won't be enforced until a later release.
        return false;
    }

    @Override
+10 −1
Original line number Diff line number Diff line
@@ -532,6 +532,11 @@ public final class PowerManagerService extends SystemService
    // True if the proximity sensor reads a positive result.
    private boolean mProximityPositive;

    // Indicates that we have already intercepted the power key to temporarily ignore the proximity
    // wake lock and turn the screen back on. This should get reset when prox reads 'far' again
    // (when {@link #mProximityPositive} is set to false).
    private boolean mInterceptedPowerKeyForProximity;

    // Screen brightness setting limits.
    public final float mScreenBrightnessMinimum;
    public final float mScreenBrightnessMaximum;
@@ -3313,6 +3318,7 @@ public final class PowerManagerService extends SystemService
        public void onProximityNegative() {
            synchronized (mLock) {
                mProximityPositive = false;
                mInterceptedPowerKeyForProximity = false;
                mDirty |= DIRTY_PROXIMITY_POSITIVE;
                userActivityNoUpdateLocked(Display.DEFAULT_DISPLAY_GROUP, mClock.uptimeMillis(),
                        PowerManager.USER_ACTIVITY_EVENT_OTHER, 0, Process.SYSTEM_UID);
@@ -4153,6 +4159,8 @@ public final class PowerManagerService extends SystemService
            }
            pw.println();
            pw.println("  mRequestWaitForNegativeProximity=" + mRequestWaitForNegativeProximity);
            pw.println("  mInterceptedPowerKeyForProximity="
                    + mInterceptedPowerKeyForProximity);
            pw.println("  mSandmanScheduled=" + mSandmanScheduled);
            pw.println("  mBatteryLevelLow=" + mBatteryLevelLow);
            pw.println("  mLightDeviceIdleMode=" + mLightDeviceIdleMode);
@@ -5984,8 +5992,9 @@ public final class PowerManagerService extends SystemService
            final DisplayPowerRequest displayPowerRequest =
                    mDisplayGroupPowerStateMapper.getPowerRequestLocked(
                            Display.DEFAULT_DISPLAY_GROUP);
            if (displayPowerRequest.useProximitySensor && mProximityPositive) {
            if (mProximityPositive && !mInterceptedPowerKeyForProximity) {
                mDisplayManagerInternal.ignoreProximitySensorUntilChanged();
                mInterceptedPowerKeyForProximity = true;
                return true;
            }
        }
+24 −10
Original line number Diff line number Diff line
@@ -125,16 +125,25 @@ public class SoundTriggerMiddlewarePermission implements ISoundTriggerMiddleware
     * originator temporarily doesn't have the right permissions to use this service.
     */
    private void enforcePermissionsForPreflight(@NonNull Identity identity) {
        enforcePermissionForPreflight(mContext, identity, RECORD_AUDIO);
        enforcePermissionForPreflight(mContext, identity, CAPTURE_AUDIO_HOTWORD);
        enforcePermissionForPreflight(mContext, identity, RECORD_AUDIO,
                /* allowSoftDenial= */ true);
        enforcePermissionForPreflight(mContext, identity, CAPTURE_AUDIO_HOTWORD,
                /* allowSoftDenial= */ true);
    }

    /**
     * Throws a {@link SecurityException} iff the originator has permission to receive data.
     */
    void enforcePermissionsForDataDelivery(@NonNull Identity identity, @NonNull String reason) {
        enforcePermissionForDataDelivery(mContext, identity, RECORD_AUDIO,
                reason);
        // SoundTrigger data is treated the same as Hotword-source audio. This should incur the
        // HOTWORD op instead of the RECORD_AUDIO op. The RECORD_AUDIO permission is still required,
        // and since this is a data delivery check, soft denials aren't accepted.
        enforcePermissionForPreflight(mContext, identity, RECORD_AUDIO,
                /* allowSoftDenial= */ false);
        int hotwordOp = AppOpsManager.strOpToOp(AppOpsManager.OPSTR_RECORD_AUDIO_HOTWORD);
        mContext.getSystemService(AppOpsManager.class).noteOpNoThrow(hotwordOp, identity.uid,
                identity.packageName, identity.attributionTag, reason);

        enforcePermissionForDataDelivery(mContext, identity, CAPTURE_AUDIO_HOTWORD,
                reason);
    }
@@ -163,20 +172,25 @@ public class SoundTriggerMiddlewarePermission implements ISoundTriggerMiddleware
    /**
     * Throws a {@link SecurityException} if originator permanently doesn't have the given
     * permission.
     * Soft (temporary) denials are considered OK for preflight purposes.
     *
     * @param context         A {@link Context}, used for permission checks.
     * @param identity        The identity to check.
     * @param permission      The identifier of the permission we want to check.
     * @param allowSoftDenial If true, the operation succeeds even for soft (temporary) denials.
     */
    // TODO: Consider splitting up this method instead of using `allowSoftDenial`, to make it
    // clearer when soft denials are not allowed.
    private static void enforcePermissionForPreflight(@NonNull Context context,
            @NonNull Identity identity, @NonNull String permission) {
            @NonNull Identity identity, @NonNull String permission, boolean allowSoftDenial) {
        final int status = PermissionUtil.checkPermissionForPreflight(context, identity,
                permission);
        switch (status) {
            case PermissionChecker.PERMISSION_GRANTED:
                return;
            case PermissionChecker.PERMISSION_SOFT_DENIED:
                if (allowSoftDenial) {
                    return;
                } // else fall through
            case PermissionChecker.PERMISSION_HARD_DENIED:
                throw new SecurityException(
                        String.format("Failed to obtain permission %s for identity %s", permission,
Loading