diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-08-20 06:39:19 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-08-20 06:39:19 +0000 |
commit | 59e1cf33119e59941e9653fbfa0583040011eca4 (patch) | |
tree | 81db19f9767aa34314d28d620cc6f904f45c8c6c | |
parent | 4f61f588b30ce4e0857ba0448afdea5946db521f (diff) | |
parent | 994089511df724306da0006af8e094d6b61c05d4 (diff) | |
download | base-59e1cf33119e59941e9653fbfa0583040011eca4.tar.gz |
Merge cherrypicks of [15636132, 15634622, 15636419, 15634623, 15635081, 15636346, 15636347, 15635821, 15635822, 15635823, 15635824, 15636496, 15636421, 15635984, 15636005, 15636133, 15635225, 15635189, 15636250, 15636380, 15636422, 15636348, 15636349, 15636350, 15632848, 15636382, 15636383, 15636266, 15636351, 15636423, 15636352, 15635986, 15636220, 15636252] into sc-d1-release
Change-Id: I47bcf050a97320291050dbefbeefee426e76ffac
6 files changed, 74 insertions, 56 deletions
diff --git a/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java b/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java index 45588e831cb9..9eb7bb7149ef 100644 --- a/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java +++ b/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java @@ -3941,6 +3941,10 @@ public class DeviceIdleController extends SystemService if (idleUntil) { mAlarmManager.setIdleUntil(AlarmManager.ELAPSED_REALTIME_WAKEUP, mNextAlarmTime, "DeviceIdleController.deep", mDeepAlarmListener, mHandler); + } else if (mState == STATE_LOCATING) { + // Use setExact so we don't keep the GPS active for too long. + mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, + mNextAlarmTime, "DeviceIdleController.deep", mDeepAlarmListener, mHandler); } else { if (mConstants.USE_WINDOW_ALARMS) { mAlarmManager.setWindow(AlarmManager.ELAPSED_REALTIME_WAKEUP, diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml index 55ed83b32262..b191584345ef 100644 --- a/core/res/res/values/colors.xml +++ b/core/res/res/values/colors.xml @@ -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> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationScheduler.kt b/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationScheduler.kt index f1610d866f34..dcf8e739a76e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationScheduler.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemStatusAnimationScheduler.kt @@ -114,6 +114,10 @@ class SystemStatusAnimationScheduler @Inject constructor( Log.d(TAG, "updating current event from: $event") } scheduledEvent?.updateFromEvent(event) + if (event.forceVisible) { + hasPersistentDot = true + notifyTransitionToPersistentDot() + } } else { if (DEBUG) { Log.d(TAG, "ignoring event $event") @@ -154,6 +158,7 @@ class SystemStatusAnimationScheduler @Inject constructor( // If animations are turned off, we'll transition directly to the dot if (!event.showAnimation && event.forceVisible) { notifyTransitionToPersistentDot() + scheduledEvent = null return } diff --git a/services/core/java/com/android/server/display/DisplayPowerController.java b/services/core/java/com/android/server/display/DisplayPowerController.java index 110893765cbd..abbe13ac260f 100644 --- a/services/core/java/com/android/server/display/DisplayPowerController.java +++ b/services/core/java/com/android/server/display/DisplayPowerController.java @@ -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; diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java index db69158e63c1..3d47dcf4eadb 100644 --- a/services/core/java/com/android/server/power/PowerManagerService.java +++ b/services/core/java/com/android/server/power/PowerManagerService.java @@ -533,6 +533,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; @@ -3318,6 +3323,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); @@ -4158,6 +4164,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); @@ -5989,8 +5997,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; } } diff --git a/services/tests/mockingservicestests/src/com/android/server/DeviceIdleControllerTest.java b/services/tests/mockingservicestests/src/com/android/server/DeviceIdleControllerTest.java index acf50b4569c6..e472b062388e 100644 --- a/services/tests/mockingservicestests/src/com/android/server/DeviceIdleControllerTest.java +++ b/services/tests/mockingservicestests/src/com/android/server/DeviceIdleControllerTest.java @@ -323,6 +323,7 @@ public class DeviceIdleControllerTest { when(mPowerManager.newWakeLock(anyInt(), anyString())).thenReturn(mWakeLock); doNothing().when(mWakeLock).acquire(); doNothing().when(mAlarmManager).set(anyInt(), anyLong(), anyString(), any(), any()); + doNothing().when(mAlarmManager).setExact(anyInt(), anyLong(), anyString(), any(), any()); doNothing().when(mAlarmManager) .setWindow(anyInt(), anyLong(), anyLong(), anyString(), any(), any()); doReturn(mock(Sensor.class)).when(mSensorManager) |