diff options
38 files changed, 635 insertions, 953 deletions
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index 4b054f49d910..8ac8e5e2224e 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -5387,8 +5387,8 @@ public class Notification implements Parcelable contentView.setInt(R.id.expand_button, "setDefaultPillColor", pillColor); // Use different highlighted colors for conversations' unread count if (p.mHighlightExpander) { - pillColor = Colors.flattenAlpha(getPrimaryAccentColor(p), bgColor); - textColor = Colors.flattenAlpha(bgColor, pillColor); + pillColor = Colors.flattenAlpha(getColors(p).getTertiaryAccentColor(), bgColor); + textColor = Colors.flattenAlpha(getColors(p).getOnAccentTextColor(), pillColor); } contentView.setInt(R.id.expand_button, "setHighlightTextColor", textColor); contentView.setInt(R.id.expand_button, "setHighlightPillColor", pillColor); @@ -12305,6 +12305,8 @@ public class Notification implements Parcelable private int mSecondaryTextColor = COLOR_INVALID; private int mPrimaryAccentColor = COLOR_INVALID; private int mSecondaryAccentColor = COLOR_INVALID; + private int mTertiaryAccentColor = COLOR_INVALID; + private int mOnAccentTextColor = COLOR_INVALID; private int mErrorColor = COLOR_INVALID; private int mContrastColor = COLOR_INVALID; private int mRippleAlpha = 0x33; @@ -12362,7 +12364,7 @@ public class Notification implements Parcelable if (isColorized) { if (rawColor == COLOR_DEFAULT) { - int[] attrs = {R.attr.colorAccentTertiary}; + int[] attrs = {R.attr.colorAccentSecondary}; try (TypedArray ta = obtainDayNightAttributes(ctx, attrs)) { mBackgroundColor = getColor(ta, 0, Color.WHITE); } @@ -12379,6 +12381,8 @@ public class Notification implements Parcelable mContrastColor = mPrimaryTextColor; mPrimaryAccentColor = mPrimaryTextColor; mSecondaryAccentColor = mSecondaryTextColor; + mTertiaryAccentColor = flattenAlpha(mPrimaryTextColor, mBackgroundColor); + mOnAccentTextColor = mBackgroundColor; mErrorColor = mPrimaryTextColor; mRippleAlpha = 0x33; } else { @@ -12389,6 +12393,8 @@ public class Notification implements Parcelable R.attr.textColorSecondary, R.attr.colorAccent, R.attr.colorAccentSecondary, + R.attr.colorAccentTertiary, + R.attr.textColorOnAccent, R.attr.colorError, R.attr.colorControlHighlight }; @@ -12399,8 +12405,10 @@ public class Notification implements Parcelable mSecondaryTextColor = getColor(ta, 3, COLOR_INVALID); mPrimaryAccentColor = getColor(ta, 4, COLOR_INVALID); mSecondaryAccentColor = getColor(ta, 5, COLOR_INVALID); - mErrorColor = getColor(ta, 6, COLOR_INVALID); - mRippleAlpha = Color.alpha(getColor(ta, 7, 0x33ffffff)); + mTertiaryAccentColor = getColor(ta, 6, COLOR_INVALID); + mOnAccentTextColor = getColor(ta, 7, COLOR_INVALID); + mErrorColor = getColor(ta, 8, COLOR_INVALID); + mRippleAlpha = Color.alpha(getColor(ta, 9, 0x33ffffff)); } mContrastColor = calculateContrastColor(ctx, rawColor, mPrimaryAccentColor, mBackgroundColor, nightMode); @@ -12420,6 +12428,14 @@ public class Notification implements Parcelable if (mSecondaryAccentColor == COLOR_INVALID) { mSecondaryAccentColor = mContrastColor; } + if (mTertiaryAccentColor == COLOR_INVALID) { + mTertiaryAccentColor = mContrastColor; + } + if (mOnAccentTextColor == COLOR_INVALID) { + mOnAccentTextColor = ColorUtils.setAlphaComponent( + ContrastColorUtil.resolvePrimaryColor( + ctx, mTertiaryAccentColor, nightMode), 0xFF); + } if (mErrorColor == COLOR_INVALID) { mErrorColor = mPrimaryTextColor; } @@ -12485,6 +12501,16 @@ public class Notification implements Parcelable return mSecondaryAccentColor; } + /** @return the theme's tertiary accent color for colored UI elements. */ + public @ColorInt int getTertiaryAccentColor() { + return mTertiaryAccentColor; + } + + /** @return the theme's text color to be used on the tertiary accent color. */ + public @ColorInt int getOnAccentTextColor() { + return mOnAccentTextColor; + } + /** * @return the contrast-adjusted version of the color provided by the app, or the * primary text color when colorized. diff --git a/core/java/com/android/internal/util/ContrastColorUtil.java b/core/java/com/android/internal/util/ContrastColorUtil.java index 8b3c1337c0c8..7a712e50e6a8 100644 --- a/core/java/com/android/internal/util/ContrastColorUtil.java +++ b/core/java/com/android/internal/util/ContrastColorUtil.java @@ -291,10 +291,10 @@ public class ContrastColorUtil { * Finds a suitable color such that there's enough contrast. * * @param color the color to start searching from. - * @param other the color to ensure contrast against. Assumed to be lighter than {@param color} - * @param findFg if true, we assume {@param color} is a foreground, otherwise a background. + * @param other the color to ensure contrast against. Assumed to be lighter than {@code color} + * @param findFg if true, we assume {@code color} is a foreground, otherwise a background. * @param minRatio the minimum contrast ratio required. - * @return a color with the same hue as {@param color}, potentially darkened to meet the + * @return a color with the same hue as {@code color}, potentially darkened to meet the * contrast ratio. */ public static int findContrastColor(int color, int other, boolean findFg, double minRatio) { @@ -331,7 +331,7 @@ public class ContrastColorUtil { * @param color the color to start searching from. * @param backgroundColor the color to ensure contrast against. * @param minRatio the minimum contrast ratio required. - * @return the same color as {@param color} with potentially modified alpha to meet contrast + * @return the same color as {@code color} with potentially modified alpha to meet contrast */ public static int findAlphaToMeetContrast(int color, int backgroundColor, double minRatio) { int fg = color; @@ -361,10 +361,10 @@ public class ContrastColorUtil { * Finds a suitable color such that there's enough contrast. * * @param color the color to start searching from. - * @param other the color to ensure contrast against. Assumed to be darker than {@param color} - * @param findFg if true, we assume {@param color} is a foreground, otherwise a background. + * @param other the color to ensure contrast against. Assumed to be darker than {@code color} + * @param findFg if true, we assume {@code color} is a foreground, otherwise a background. * @param minRatio the minimum contrast ratio required. - * @return a color with the same hue as {@param color}, potentially darkened to meet the + * @return a color with the same hue as {@code color}, potentially lightened to meet the * contrast ratio. */ public static int findContrastColorAgainstDark(int color, int other, boolean findFg, @@ -393,7 +393,8 @@ public class ContrastColorUtil { low = l; } } - return findFg ? fg : bg; + hsl[2] = high; + return ColorUtilsFromCompat.HSLToColor(hsl); } public static int ensureTextContrastOnBlack(int color) { @@ -452,7 +453,7 @@ public class ContrastColorUtil { } /** - * Resolves {@param color} to an actual color if it is {@link Notification#COLOR_DEFAULT} + * Resolves {@code color} to an actual color if it is {@link Notification#COLOR_DEFAULT} */ public static int resolveColor(Context context, int color, boolean defaultBackgroundIsDark) { if (color == Notification.COLOR_DEFAULT) { diff --git a/core/tests/coretests/src/android/app/NotificationTest.java b/core/tests/coretests/src/android/app/NotificationTest.java index cd07d464ee65..685671b083c4 100644 --- a/core/tests/coretests/src/android/app/NotificationTest.java +++ b/core/tests/coretests/src/android/app/NotificationTest.java @@ -399,6 +399,8 @@ public class NotificationTest { assertEquals(cDay.getSecondaryTextColor(), cNight.getSecondaryTextColor()); assertEquals(cDay.getPrimaryAccentColor(), cNight.getPrimaryAccentColor()); assertEquals(cDay.getSecondaryAccentColor(), cNight.getSecondaryAccentColor()); + assertEquals(cDay.getTertiaryAccentColor(), cNight.getTertiaryAccentColor()); + assertEquals(cDay.getOnAccentTextColor(), cNight.getOnAccentTextColor()); assertEquals(cDay.getProtectionColor(), cNight.getProtectionColor()); assertEquals(cDay.getContrastColor(), cNight.getContrastColor()); assertEquals(cDay.getRippleAlpha(), cNight.getRippleAlpha()); @@ -413,20 +415,26 @@ public class NotificationTest { assertThat(c.getSecondaryTextColor()).isNotEqualTo(Notification.COLOR_INVALID); assertThat(c.getPrimaryAccentColor()).isNotEqualTo(Notification.COLOR_INVALID); assertThat(c.getSecondaryAccentColor()).isNotEqualTo(Notification.COLOR_INVALID); + assertThat(c.getTertiaryAccentColor()).isNotEqualTo(Notification.COLOR_INVALID); + assertThat(c.getOnAccentTextColor()).isNotEqualTo(Notification.COLOR_INVALID); assertThat(c.getErrorColor()).isNotEqualTo(Notification.COLOR_INVALID); assertThat(c.getContrastColor()).isNotEqualTo(Notification.COLOR_INVALID); assertThat(c.getRippleAlpha()).isAtLeast(0x00); assertThat(c.getRippleAlpha()).isAtMost(0xff); - // Assert that various colors have sufficient contrast + // Assert that various colors have sufficient contrast with the background assertContrastIsAtLeast(c.getPrimaryTextColor(), c.getBackgroundColor(), 4.5); assertContrastIsAtLeast(c.getSecondaryTextColor(), c.getBackgroundColor(), 4.5); assertContrastIsAtLeast(c.getPrimaryAccentColor(), c.getBackgroundColor(), 4.5); assertContrastIsAtLeast(c.getErrorColor(), c.getBackgroundColor(), 4.5); assertContrastIsAtLeast(c.getContrastColor(), c.getBackgroundColor(), 4.5); - // This accent color is only used for emphasized buttons + // These colors are only used for emphasized buttons; they do not need contrast assertContrastIsAtLeast(c.getSecondaryAccentColor(), c.getBackgroundColor(), 1); + assertContrastIsAtLeast(c.getTertiaryAccentColor(), c.getBackgroundColor(), 1); + + // The text that is used within the accent color DOES need to have contrast + assertContrastIsAtLeast(c.getOnAccentTextColor(), c.getTertiaryAccentColor(), 4.5); } private void assertContrastIsAtLeast(int foreground, int background, double minContrast) { diff --git a/core/tests/coretests/src/com/android/internal/util/ContrastColorUtilTest.java b/core/tests/coretests/src/com/android/internal/util/ContrastColorUtilTest.java new file mode 100644 index 000000000000..9da720cbfa87 --- /dev/null +++ b/core/tests/coretests/src/com/android/internal/util/ContrastColorUtilTest.java @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.android.internal.util; + +import static androidx.core.graphics.ColorUtils.calculateContrast; + +import static com.google.common.truth.Truth.assertThat; + +import android.graphics.Color; + +import androidx.test.filters.SmallTest; + +import junit.framework.TestCase; + +public class ContrastColorUtilTest extends TestCase { + + @SmallTest + public void testEnsureTextContrastAgainstDark() { + int darkBg = 0xFF35302A; + + int blueContrastColor = ContrastColorUtil.ensureTextContrast(Color.BLUE, darkBg, true); + assertContrastIsWithinRange(blueContrastColor, darkBg, 4.5, 4.75); + + int redContrastColor = ContrastColorUtil.ensureTextContrast(Color.RED, darkBg, true); + assertContrastIsWithinRange(redContrastColor, darkBg, 4.5, 4.75); + + final int darkGreen = 0xff008800; + int greenContrastColor = ContrastColorUtil.ensureTextContrast(darkGreen, darkBg, true); + assertContrastIsWithinRange(greenContrastColor, darkBg, 4.5, 4.75); + + int grayContrastColor = ContrastColorUtil.ensureTextContrast(Color.DKGRAY, darkBg, true); + assertContrastIsWithinRange(grayContrastColor, darkBg, 4.5, 4.75); + + int selfContrastColor = ContrastColorUtil.ensureTextContrast(darkBg, darkBg, true); + assertContrastIsWithinRange(selfContrastColor, darkBg, 4.5, 4.75); + } + + @SmallTest + public void testEnsureTextContrastAgainstLight() { + int lightBg = 0xFFFFF8F2; + + final int lightBlue = 0xff8888ff; + int blueContrastColor = ContrastColorUtil.ensureTextContrast(lightBlue, lightBg, false); + assertContrastIsWithinRange(blueContrastColor, lightBg, 4.5, 4.75); + + int redContrastColor = ContrastColorUtil.ensureTextContrast(Color.RED, lightBg, false); + assertContrastIsWithinRange(redContrastColor, lightBg, 4.5, 4.75); + + int greenContrastColor = ContrastColorUtil.ensureTextContrast(Color.GREEN, lightBg, false); + assertContrastIsWithinRange(greenContrastColor, lightBg, 4.5, 4.75); + + int grayContrastColor = ContrastColorUtil.ensureTextContrast(Color.LTGRAY, lightBg, false); + assertContrastIsWithinRange(grayContrastColor, lightBg, 4.5, 4.75); + + int selfContrastColor = ContrastColorUtil.ensureTextContrast(lightBg, lightBg, false); + assertContrastIsWithinRange(selfContrastColor, lightBg, 4.5, 4.75); + } + + private void assertContrastIsWithinRange(int foreground, int background, + double minContrast, double maxContrast) { + assertContrastIsAtLeast(foreground, background, minContrast); + assertContrastIsAtMost(foreground, background, maxContrast); + } + + private void assertContrastIsAtLeast(int foreground, int background, double minContrast) { + try { + assertThat(calculateContrast(foreground, background)).isAtLeast(minContrast); + } catch (AssertionError e) { + throw new AssertionError( + String.format("Insufficient contrast: foreground=#%08x background=#%08x", + foreground, background), e); + } + } + + private void assertContrastIsAtMost(int foreground, int background, double maxContrast) { + try { + assertThat(calculateContrast(foreground, background)).isAtMost(maxContrast); + } catch (AssertionError e) { + throw new AssertionError( + String.format("Excessive contrast: foreground=#%08x background=#%08x", + foreground, background), e); + } + } + +} diff --git a/libs/hwui/Properties.cpp b/libs/hwui/Properties.cpp index b8fa55a18dac..109b5352fe30 100644 --- a/libs/hwui/Properties.cpp +++ b/libs/hwui/Properties.cpp @@ -84,7 +84,7 @@ float Properties::defaultSdrWhitePoint = 200.f; bool Properties::useHintManager = true; int Properties::targetCpuTimePercentage = 70; -bool Properties::enableWebViewOverlays = false; +bool Properties::enableWebViewOverlays = true; StretchEffectBehavior Properties::stretchEffectBehavior = StretchEffectBehavior::ShaderHWUI; @@ -139,7 +139,7 @@ bool Properties::load() { targetCpuTimePercentage = base::GetIntProperty(PROPERTY_TARGET_CPU_TIME_PERCENTAGE, 70); if (targetCpuTimePercentage <= 0 || targetCpuTimePercentage > 100) targetCpuTimePercentage = 70; - enableWebViewOverlays = base::GetBoolProperty(PROPERTY_WEBVIEW_OVERLAYS_ENABLED, false); + enableWebViewOverlays = base::GetBoolProperty(PROPERTY_WEBVIEW_OVERLAYS_ENABLED, true); return (prevDebugLayersUpdates != debugLayersUpdates) || (prevDebugOverdraw != debugOverdraw); } diff --git a/libs/hwui/WebViewFunctorManager.cpp b/libs/hwui/WebViewFunctorManager.cpp index df4101109a18..5aad821ad59f 100644 --- a/libs/hwui/WebViewFunctorManager.cpp +++ b/libs/hwui/WebViewFunctorManager.cpp @@ -100,6 +100,9 @@ WebViewFunctor::~WebViewFunctor() { destroyContext(); ATRACE_NAME("WebViewFunctor::onDestroy"); + if (mSurfaceControl) { + removeOverlays(); + } mCallbacks.onDestroyed(mFunctor, mData); } diff --git a/packages/SettingsLib/ActionBarShadow/Android.bp b/packages/SettingsLib/ActionBarShadow/Android.bp index 800ab671cedb..4a07d49fcde5 100644 --- a/packages/SettingsLib/ActionBarShadow/Android.bp +++ b/packages/SettingsLib/ActionBarShadow/Android.bp @@ -19,5 +19,5 @@ android_library { ], sdk_version: "system_current", - min_sdk_version: "21", + min_sdk_version: "28", } diff --git a/packages/SettingsLib/ActionBarShadow/lint-baseline.xml b/packages/SettingsLib/ActionBarShadow/lint-baseline.xml deleted file mode 100644 index 4d5de5f46894..000000000000 --- a/packages/SettingsLib/ActionBarShadow/lint-baseline.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0"> - - <issue - id="NewApi" - message="Call requires API level 23 (current min is 21): `android.view.View#setOnScrollChangeListener`" - errorLine1=" mScrollView.setOnScrollChangeListener(mScrollChangeWatcher);" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionBarShadow/src/com/android/settingslib/widget/ActionBarShadowController.java" - line="81" - column="25"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 23 (current min is 21): `android.view.View#setOnScrollChangeListener`" - errorLine1=" mScrollView.setOnScrollChangeListener(null);" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionBarShadow/src/com/android/settingslib/widget/ActionBarShadowController.java" - line="88" - column="21"/> - </issue> - - <issue - id="NewApi" - message="Class requires API level 23 (current min is 21): `android.view.View.OnScrollChangeListener`" - errorLine1=" final class ScrollChangeWatcher implements View.OnScrollChangeListener {" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionBarShadow/src/com/android/settingslib/widget/ActionBarShadowController.java" - line="95" - column="48"/> - </issue> - -</issues> diff --git a/packages/SettingsLib/ActionButtonsPreference/lint-baseline.xml b/packages/SettingsLib/ActionButtonsPreference/lint-baseline.xml deleted file mode 100644 index 95b7e3b8033d..000000000000 --- a/packages/SettingsLib/ActionButtonsPreference/lint-baseline.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0"> - - <issue - id="NewApi" - message="`android:Widget.DeviceDefault.Button.Borderless.Colored` requires API level 28 (current min is 21)" - errorLine1=" <style name="SettingsActionButton" parent="android:Widget.DeviceDefault.Button.Borderless.Colored">" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionButtonsPreference/res/values/styles.xml" - line="19" - column="40"/> - </issue> - - <issue - id="NewApi" - message="`android:drawableTint` requires API level 23 (current min is 21)" - errorLine1=" <item name="android:drawableTint">@*android:color/btn_colored_borderless_text_material</item>" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionButtonsPreference/res/values/styles.xml" - line="21" - column="15"/> - </issue> - - <issue - id="NewApi" - message="`?android:attr/dialogCornerRadius` requires API level 28 (current min is 21)" - errorLine1=" android:topLeftRadius="?android:attr/dialogCornerRadius"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_left_bk.xml" - line="23" - column="9"/> - </issue> - - <issue - id="NewApi" - message="`?android:attr/dialogCornerRadius` requires API level 28 (current min is 21)" - errorLine1=" android:bottomLeftRadius="?android:attr/dialogCornerRadius"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_left_bk.xml" - line="25" - column="9"/> - </issue> - - <issue - id="NewApi" - message="`?android:attr/dialogCornerRadius` requires API level 28 (current min is 21)" - errorLine1=" android:topRightRadius="?android:attr/dialogCornerRadius"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_right_bk.xml" - line="24" - column="9"/> - </issue> - - <issue - id="NewApi" - message="`?android:attr/dialogCornerRadius` requires API level 28 (current min is 21)" - errorLine1=" android:bottomRightRadius="?android:attr/dialogCornerRadius"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_right_bk.xml" - line="26" - column="9"/> - </issue> - - <issue - id="NewApi" - message="`?android:attr/dialogCornerRadius` requires API level 28 (current min is 21)" - errorLine1=" android:bottomRightRadius="?android:attr/dialogCornerRadius"" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ActionButtonsPreference/res/drawable/rounded_bk.xml" - line="23" - column="9"/> - </issue> - -</issues> diff --git a/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_left_bk.xml b/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_left_bk.xml index 16a85d694bf8..8a25726ecd17 100644 --- a/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_left_bk.xml +++ b/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_left_bk.xml @@ -17,6 +17,8 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="28" android:shape="rectangle"> <solid android:color="?androidprv:attr/colorSurface" /> <corners diff --git a/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_right_bk.xml b/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_right_bk.xml index 1b9f68fac850..7e626e50255a 100644 --- a/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_right_bk.xml +++ b/packages/SettingsLib/ActionButtonsPreference/res/drawable/half_rounded_right_bk.xml @@ -1,22 +1,24 @@ <?xml version="1.0" encoding="utf-8"?> <!-- - ~ Copyright (C) 2021 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. + Copyright (C) 2021 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="28" android:shape="rectangle"> <solid android:color="?androidprv:attr/colorSurface" /> <corners diff --git a/packages/SettingsLib/ActionButtonsPreference/res/drawable/rounded_bk.xml b/packages/SettingsLib/ActionButtonsPreference/res/drawable/rounded_bk.xml index a884ef11e835..9f4980beb76f 100644 --- a/packages/SettingsLib/ActionButtonsPreference/res/drawable/rounded_bk.xml +++ b/packages/SettingsLib/ActionButtonsPreference/res/drawable/rounded_bk.xml @@ -1,22 +1,24 @@ <?xml version="1.0" encoding="utf-8"?> <!-- - ~ Copyright (C) 2021 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. + Copyright (C) 2021 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. --> <shape xmlns:android="http://schemas.android.com/apk/res/android" xmlns:androidprv="http://schemas.android.com/apk/prv/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="28" android:shape="rectangle"> <solid android:color="?androidprv:attr/colorSurface" /> <corners diff --git a/packages/SettingsLib/ActionButtonsPreference/res/values/styles.xml b/packages/SettingsLib/ActionButtonsPreference/res/values/styles.xml index 42c7d76a80e9..8a449cfbb7c8 100644 --- a/packages/SettingsLib/ActionButtonsPreference/res/values/styles.xml +++ b/packages/SettingsLib/ActionButtonsPreference/res/values/styles.xml @@ -15,7 +15,9 @@ limitations under the License. --> -<resources> +<resources + xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="28"> <style name="SettingsLibActionButton" parent="android:Widget.DeviceDefault.Button.Borderless.Colored"> <item name="android:drawablePadding">4dp</item> <item name="android:drawableTint">@*android:color/btn_colored_borderless_text_material</item> diff --git a/packages/SettingsLib/BarChartPreference/Android.bp b/packages/SettingsLib/BarChartPreference/Android.bp index ae2606661697..4f6537334770 100644 --- a/packages/SettingsLib/BarChartPreference/Android.bp +++ b/packages/SettingsLib/BarChartPreference/Android.bp @@ -14,7 +14,7 @@ android_library { resource_dirs: ["res"], static_libs: [ - "androidx.preference_preference", + "androidx.preference_preference", ], sdk_version: "system_current", diff --git a/packages/SettingsLib/BarChartPreference/lint-baseline.xml b/packages/SettingsLib/BarChartPreference/lint-baseline.xml deleted file mode 100644 index f1043bb62fe1..000000000000 --- a/packages/SettingsLib/BarChartPreference/lint-baseline.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0"> - - <issue - id="NewApi" - message="`@android:style/Widget.DeviceDefault.Button.Borderless.Colored` requires API level 28 (current min is 21)" - errorLine1=" parent="@android:style/Widget.DeviceDefault.Button.Borderless.Colored">" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/BarChartPreference/res/values/styles.xml" - line="35" - column="12"/> - </issue> - -</issues> diff --git a/packages/SettingsLib/BarChartPreference/res/values/styles.xml b/packages/SettingsLib/BarChartPreference/res/values/styles.xml index d1f562b38760..1c4420717188 100644 --- a/packages/SettingsLib/BarChartPreference/res/values/styles.xml +++ b/packages/SettingsLib/BarChartPreference/res/values/styles.xml @@ -15,7 +15,9 @@ limitations under the License. --> -<resources> +<resources + xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="28"> <style name="SettingsBarChart"> <item name="android:layout_marginStart">10dp</item> diff --git a/packages/SettingsLib/HelpUtils/lint-baseline.xml b/packages/SettingsLib/HelpUtils/lint-baseline.xml deleted file mode 100644 index 940f027295a7..000000000000 --- a/packages/SettingsLib/HelpUtils/lint-baseline.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0"> - - <issue - id="NewApi" - message="Call requires API level 28 (current min is 21): `android.content.pm.PackageInfo#getLongVersionCode`" - errorLine1=" sCachedVersionCode = Long.toString(info.getLongVersionCode());" - errorLine2=" ~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/HelpUtils/src/com/android/settingslib/HelpUtils.java" - line="239" - column="57"/> - </issue> - -</issues> diff --git a/packages/SettingsLib/HelpUtils/src/com/android/settingslib/HelpUtils.java b/packages/SettingsLib/HelpUtils/src/com/android/settingslib/HelpUtils.java index 541a2468db45..70c8658a7f55 100644 --- a/packages/SettingsLib/HelpUtils/src/com/android/settingslib/HelpUtils.java +++ b/packages/SettingsLib/HelpUtils/src/com/android/settingslib/HelpUtils.java @@ -25,6 +25,7 @@ import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.net.Uri; +import android.os.Build; import android.provider.Settings.Global; import android.text.TextUtils; import android.util.Log; @@ -32,6 +33,7 @@ import android.view.Menu; import android.view.MenuItem; import android.view.MenuItem.OnMenuItemClickListener; +import androidx.annotation.RequiresApi; import androidx.annotation.VisibleForTesting; import com.android.settingslib.widget.R; @@ -73,6 +75,15 @@ public class HelpUtils { private HelpUtils() { } + /** + * Prepares the help menu item by doing the following. + * - If the helpUrlString is empty or null, the help menu item is made invisible. + * - Otherwise, this makes the help menu item visible and sets the intent for the help menu + * item to view the URL. + * + * @return returns whether the help menu item has been made visible. + */ + @RequiresApi(Build.VERSION_CODES.P) public static boolean prepareHelpMenuItem(Activity activity, Menu menu, String helpUri, String backupContext) { // menu contains help item, skip it @@ -84,6 +95,15 @@ public class HelpUtils { return prepareHelpMenuItem(activity, helpItem, helpUri, backupContext); } + /** + * Prepares the help menu item by doing the following. + * - If the helpUrlString is empty or null, the help menu item is made invisible. + * - Otherwise, this makes the help menu item visible and sets the intent for the help menu + * item to view the URL. + * + * @return returns whether the help menu item has been made visible. + */ + @RequiresApi(Build.VERSION_CODES.P) public static boolean prepareHelpMenuItem(Activity activity, Menu menu, int helpUriResource, String backupContext) { // menu contains help item, skip it @@ -105,6 +125,7 @@ public class HelpUtils { * @return returns whether the help menu item has been made visible. */ @VisibleForTesting + @RequiresApi(Build.VERSION_CODES.P) static boolean prepareHelpMenuItem(final Activity activity, MenuItem helpMenuItem, String helpUriString, String backupContext) { if (Global.getInt(activity.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { @@ -152,6 +173,10 @@ public class HelpUtils { } } + /** + * Get the help intent from helpUriString. + */ + @RequiresApi(Build.VERSION_CODES.P) public static Intent getHelpIntent(Context context, String helpUriString, String backupContext) { if (Global.getInt(context.getContentResolver(), Global.DEVICE_PROVISIONED, 0) == 0) { @@ -223,7 +248,8 @@ public class HelpUtils { * * @return the uri with added query parameters */ - private static Uri uriWithAddedParameters(Context context, Uri baseUri) { + @RequiresApi(Build.VERSION_CODES.P) + public static Uri uriWithAddedParameters(Context context, Uri baseUri) { Uri.Builder builder = baseUri.buildUpon(); // Add in the preferred language diff --git a/packages/SettingsLib/ProgressBar/lint-baseline.xml b/packages/SettingsLib/ProgressBar/lint-baseline.xml deleted file mode 100644 index 03d0f3f43986..000000000000 --- a/packages/SettingsLib/ProgressBar/lint-baseline.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0"> - - <issue - id="NewApi" - message="`?android:attr/colorSecondary` requires API level 25 (current min is 21)" - errorLine1=" android:background="?android:attr/colorSecondary" />" - errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/ProgressBar/res/layout/progress_header.xml" - line="27" - column="9"/> - </issue> - -</issues> diff --git a/packages/SettingsLib/ProgressBar/res/layout/progress_header.xml b/packages/SettingsLib/ProgressBar/res/layout/progress_header.xml index 268858bebf0c..52ff42cbfaad 100644 --- a/packages/SettingsLib/ProgressBar/res/layout/progress_header.xml +++ b/packages/SettingsLib/ProgressBar/res/layout/progress_header.xml @@ -17,6 +17,8 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:targetApi="25" android:layout_width="match_parent" android:layout_height="3dp"> <View diff --git a/packages/SettingsLib/RestrictedLockUtils/lint-baseline.xml b/packages/SettingsLib/RestrictedLockUtils/lint-baseline.xml deleted file mode 100644 index 173c7353ae8c..000000000000 --- a/packages/SettingsLib/RestrictedLockUtils/lint-baseline.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0"> - - <issue - id="NewApi" - message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`" - errorLine1=" ComponentName adminComponent = userContext.getSystemService(" - errorLine2=" ~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/RestrictedLockUtils/src/com/android/settingslib/RestrictedLockUtils.java" - line="59" - column="52"/> - </issue> - - <issue - id="NewApi" - message="Call requires API level 23 (current min is 21): `android.content.Context#getSystemService`" - errorLine1=" UserManager um = context.getSystemService(UserManager.class);" - errorLine2=" ~~~~~~~~~~~~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/RestrictedLockUtils/src/com/android/settingslib/RestrictedLockUtils.java" - line="101" - column="34"/> - </issue> - -</issues> diff --git a/packages/SettingsLib/RestrictedLockUtils/src/com/android/settingslib/RestrictedLockUtils.java b/packages/SettingsLib/RestrictedLockUtils/src/com/android/settingslib/RestrictedLockUtils.java index a77e34b4af1e..80f02b4ac0ee 100644 --- a/packages/SettingsLib/RestrictedLockUtils/src/com/android/settingslib/RestrictedLockUtils.java +++ b/packages/SettingsLib/RestrictedLockUtils/src/com/android/settingslib/RestrictedLockUtils.java @@ -21,11 +21,13 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; +import android.os.Build; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; import androidx.annotation.Nullable; +import androidx.annotation.RequiresApi; import java.util.Objects; @@ -34,10 +36,18 @@ import java.util.Objects; * support message dialog. */ public class RestrictedLockUtils { + /** + * Get EnforcedAdmin from DevicePolicyManager + */ + @RequiresApi(Build.VERSION_CODES.M) public static EnforcedAdmin getProfileOrDeviceOwner(Context context, UserHandle user) { return getProfileOrDeviceOwner(context, null, user); } + /** + * Get EnforcedAdmin from DevicePolicyManager + */ + @RequiresApi(Build.VERSION_CODES.M) public static EnforcedAdmin getProfileOrDeviceOwner( Context context, String enforcedRestriction, UserHandle user) { if (user == null) { @@ -73,6 +83,7 @@ public class RestrictedLockUtils { /** * Send the intent to trigger the {@code android.settings.ShowAdminSupportDetailsDialog}. */ + @RequiresApi(Build.VERSION_CODES.M) public static void sendShowAdminSupportDetailsIntent(Context context, EnforcedAdmin admin) { final Intent intent = getShowAdminSupportDetailsIntent(context, admin); int targetUserId = UserHandle.myUserId(); @@ -97,6 +108,10 @@ public class RestrictedLockUtils { return intent; } + /** + * Check if current user is profile or not + */ + @RequiresApi(Build.VERSION_CODES.M) public static boolean isCurrentUserOrProfile(Context context, int userId) { UserManager um = context.getSystemService(UserManager.class); return um.getUserProfiles().contains(UserHandle.of(userId)); diff --git a/packages/SettingsLib/SettingsSpinner/lint-baseline.xml b/packages/SettingsLib/SettingsSpinner/lint-baseline.xml deleted file mode 100644 index ae1ed38e9288..000000000000 --- a/packages/SettingsLib/SettingsSpinner/lint-baseline.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<issues format="5" by="lint 4.1.0" client="cli" variant="all" version="4.1.0"> - - <issue - id="NewApi" - message="Call requires API level 23 (current min is 21): `new android.widget.Spinner`" - errorLine1=" super(context, attrs, defStyleAttr, defStyleRes, mode, null);" - errorLine2=" ~~~~~"> - <location - file="frameworks/base/packages/SettingsLib/SettingsSpinner/src/com/android/settingslib/widget/settingsspinner/SettingsSpinner.java" - line="122" - column="9"/> - </issue> - -</issues> diff --git a/packages/SettingsLib/SettingsSpinner/src/com/android/settingslib/widget/settingsspinner/SettingsSpinner.java b/packages/SettingsLib/SettingsSpinner/src/com/android/settingslib/widget/settingsspinner/SettingsSpinner.java index 0be80a9fd466..14286fa76d8a 100644 --- a/packages/SettingsLib/SettingsSpinner/src/com/android/settingslib/widget/settingsspinner/SettingsSpinner.java +++ b/packages/SettingsLib/SettingsSpinner/src/com/android/settingslib/widget/settingsspinner/SettingsSpinner.java @@ -17,9 +17,12 @@ package com.android.settingslib.widget.settingsspinner; import android.content.Context; +import android.os.Build; import android.util.AttributeSet; import android.widget.Spinner; +import androidx.annotation.RequiresApi; + import com.android.settingslib.widget.R; /** @@ -117,6 +120,7 @@ public class SettingsSpinner extends Spinner { * @see Spinner#MODE_DIALOG * @see Spinner#MODE_DROPDOWN */ + @RequiresApi(Build.VERSION_CODES.M) public SettingsSpinner(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes, int mode) { super(context, attrs, defStyleAttr, defStyleRes, mode, null); diff --git a/packages/SystemUI/res/drawable/fingerprint_dialog_error_to_fp.xml b/packages/SystemUI/res/drawable/fingerprint_dialog_error_to_fp.xml index 33263a9131a0..0ae5dc745478 100644 --- a/packages/SystemUI/res/drawable/fingerprint_dialog_error_to_fp.xml +++ b/packages/SystemUI/res/drawable/fingerprint_dialog_error_to_fp.xml @@ -1,413 +1,242 @@ -<?xml version="1.0" encoding="utf-8"?><!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright (C) 2021 The Android Open Source Project + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> <animated-vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:aapt="http://schemas.android.com/aapt"> + xmlns:aapt="http://schemas.android.com/aapt"> <aapt:attr name="android:drawable"> - <vector - android:width="60dp" - android:height="60dp" - android:viewportHeight="60" - android:viewportWidth="60"> + <vector android:height="60dp" android:width="60dp" android:viewportHeight="60" + android:viewportWidth="60"> <group android:name="_R_G"> - <group - android:name="_R_G_L_1_G_N_4_T_0" - android:translateX="30" - android:translateY="30"> - <group - android:name="_R_G_L_1_G" - android:pivotX="114" - android:pivotY="114" - android:scaleX="0.42200000000000004" - android:scaleY="0.42200000000000004" - android:translateX="-114" - android:translateY="-114"> - <path - android:name="_R_G_L_1_G_D_0_P_0" - android:pathData=" M79.63 67.24 C79.63,67.24 111.5,47.42 147.83,67.24 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="0" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_1_G_D_1_P_0" - android:pathData=" M64.27 98.07 C64.27,98.07 80.13,73.02 113.98,73.02 C147.83,73.02 163.56,97.26 163.56,97.26 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="0" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_1_G_D_2_P_0" - android:pathData=" M72.53 151.07 C72.53,151.07 62.46,122.89 76.16,105.55 C89.86,88.21 106.72,86.73 113.98,86.73 C121.08,86.73 153.51,90.62 158.7,125.87 C159.14,128.82 158.8,132.88 157.18,136.09 C154.88,140.63 150.62,143.63 145.85,143.97 C133.78,144.85 129.76,137.92 129.26,128.49 C128.88,121.19 122.49,115.35 113.15,115.35 C102.91,115.35 95.97,126.69 99.77,139.74 C103.57,152.78 111.33,163.85 130.32,169.13 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="0" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_1_G_D_3_P_0" - android:pathData=" M100.6 167.84 C100.6,167.84 82.76,152.1 83.75,130.31 C84.75,108.53 102.58,100.7 113.73,100.7 C124.87,100.7 144.19,108.56 144.19,130.01 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="0" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_1_G_D_4_P_0" - android:pathData=" M113.73 129.17 C113.73,129.17 113.15,161.33 149.15,156.58 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="0" - android:trimPathOffset="0" - android:trimPathStart="0" /> + <group android:name="_R_G_L_1_G" android:translateX="-0.05000000000000071"> + <group android:name="_R_G_L_1_G_D_0_P_0_G_0_T_0" android:translateX="30" + android:translateY="38.75" android:scaleX="1" android:scaleY="1"> + <path android:name="_R_G_L_1_G_D_0_P_0" + android:fillColor="@color/biometric_dialog_error" + android:fillAlpha="1" android:fillType="nonZero" + android:pathData=" M-1.2 -1.25 C-1.2,-1.25 1.2,-1.25 1.2,-1.25 C1.2,-1.25 1.2,1.25 1.2,1.25 C1.2,1.25 -1.2,1.25 -1.2,1.25 C-1.2,1.25 -1.2,-1.25 -1.2,-1.25c "/> </group> - </group> - <group - android:name="_R_G_L_0_G_N_4_T_0" - android:translateX="30" - android:translateY="30"> - <group - android:name="_R_G_L_0_G" - android:translateX="-30.05" - android:translateY="-30"> - <group - android:name="_R_G_L_0_G_D_0_P_0_G_0_T_0" - android:scaleX="1" - android:scaleY="1" - android:translateX="30" - android:translateY="38.75"> - <path - android:name="_R_G_L_0_G_D_0_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_dialog_error" - android:fillType="nonZero" - android:pathData=" M-1.2 -1.25 C-1.2,-1.25 1.2,-1.25 1.2,-1.25 C1.2,-1.25 1.2,1.25 1.2,1.25 C1.2,1.25 -1.2,1.25 -1.2,1.25 C-1.2,1.25 -1.2,-1.25 -1.2,-1.25c " /> - </group> - <group - android:name="_R_G_L_0_G_D_1_P_0_G_0_T_0" - android:pivotX="0.002" - android:pivotY="7.488" - android:scaleX="1" - android:scaleY="1" - android:translateX="30" - android:translateY="25"> - <path - android:name="_R_G_L_0_G_D_1_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_dialog_error" - android:fillType="nonZero" - android:pathData=" M-1.2 -7.5 C-1.2,-7.5 1.2,-7.5 1.2,-7.5 C1.2,-7.5 1.2,7.5 1.2,7.5 C1.2,7.5 -1.2,7.5 -1.2,7.5 C-1.2,7.5 -1.2,-7.5 -1.2,-7.5c " /> - </group> - <path - android:name="_R_G_L_0_G_D_2_P_0" - android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_error" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="2.5" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="0" /> + <group android:name="_R_G_L_1_G_D_1_P_0_G_0_T_0" android:translateX="30" + android:translateY="25" android:pivotX="0.002" android:pivotY="7.488" + android:scaleX="1" android:scaleY="1"> + <path android:name="_R_G_L_1_G_D_1_P_0" + android:fillColor="@color/biometric_dialog_error" + android:fillAlpha="1" android:fillType="nonZero" + android:pathData=" M-1.2 -7.5 C-1.2,-7.5 1.2,-7.5 1.2,-7.5 C1.2,-7.5 1.2,7.5 1.2,7.5 C1.2,7.5 -1.2,7.5 -1.2,7.5 C-1.2,7.5 -1.2,-7.5 -1.2,-7.5c "/> </group> + <path android:name="_R_G_L_1_G_D_2_P_0" + android:strokeColor="@color/biometric_dialog_error" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2.5" android:strokeAlpha="1" + android:trimPathStart="0" android:trimPathEnd="1" + android:trimPathOffset="0" + android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c "/> + </group> + <group android:name="_R_G_L_0_G" android:translateX="-10.325" + android:translateY="-10.25"> + <path android:name="_R_G_L_0_G_D_0_P_0" + android:strokeColor="@color/biometric_dialog_accent" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2" android:strokeAlpha="1" android:trimPathStart="0" + android:trimPathEnd="0" android:trimPathOffset="0" + android:pathData=" M31.41 48.43 C30.78,46.69 30.78,44.91 30.78,44.91 C30.78,40.09 34.88,36.16 40.32,36.16 C45.77,36.16 49.87,40.09 49.87,44.91 C49.87,44.91 49.87,45.17 49.87,45.17 C49.87,46.97 48.41,48.43 46.61,48.43 C45.28,48.43 44.09,47.63 43.6,46.39 C43.6,46.39 42.51,43.66 42.51,43.66 C42.02,42.42 40.82,41.61 39.49,41.61 C37.69,41.61 36.23,43.07 36.23,44.87 C36.23,47.12 37.26,49.26 39.02,50.67 C39.02,50.67 39.64,51.16 39.64,51.16 "/> + <path android:name="_R_G_L_0_G_D_1_P_0" + android:strokeColor="@color/biometric_dialog_accent" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2" android:strokeAlpha="1" android:trimPathStart="0" + android:trimPathEnd="0" android:trimPathOffset="0" + android:pathData=" M32.14 27.3 C34.5,26 37.31,25.25 40.33,25.25 C43.34,25.25 46.15,26 48.51,27.3 "/> + <path android:name="_R_G_L_0_G_D_2_P_0" + android:strokeColor="@color/biometric_dialog_accent" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2" android:strokeAlpha="1" android:trimPathStart="0" + android:trimPathEnd="0" android:trimPathOffset="0" + android:pathData=" M29.42 36.16 C31.35,32.94 35.51,30.71 40.33,30.71 C45.14,30.71 49.3,32.94 51.23,36.16 "/> + <path android:name="_R_G_L_0_G_D_3_P_0" + android:strokeColor="@color/biometric_dialog_accent" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2" android:strokeAlpha="1" android:trimPathStart="0" + android:trimPathEnd="0" android:trimPathOffset="0" + android:pathData=" M47.14 52.52 C45.33,54.21 42.94,55.25 40.33,55.25 C37.71,55.25 35.32,54.21 33.51,52.52 "/> </group> </group> - <group android:name="time_group" /> + <group android:name="time_group"/> </vector> </aapt:attr> - <target android:name="_R_G_L_1_G_D_0_P_0"> + <target android:name="_R_G_L_1_G_D_0_P_0_G_0_T_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="67" + android:startOffset="0" android:valueFrom="1" android:valueTo="1.1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.853,0 0.6,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="250" - android:propertyName="trimPathEnd" - android:startOffset="83" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="67" + android:startOffset="0" android:valueFrom="1" android:valueTo="1.1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.853,0 0.6,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_1_G_D_1_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="100" + android:startOffset="67" android:valueFrom="1.1" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.92,1.06 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="250" - android:propertyName="trimPathEnd" - android:startOffset="83" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="100" + android:startOffset="67" android:valueFrom="1.1" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.92,1.06 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> </aapt:attr> </target> - <target android:name="_R_G_L_1_G_D_2_P_0"> + <target android:name="_R_G_L_1_G_D_1_P_0_G_0_T_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="67" + android:startOffset="0" android:valueFrom="1" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.659,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="250" - android:propertyName="trimPathEnd" - android:startOffset="83" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="67" + android:startOffset="0" android:valueFrom="1" android:valueTo="1.1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.6,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_1_G_D_3_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="100" + android:startOffset="67" android:valueFrom="1" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.6,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="250" - android:propertyName="trimPathEnd" - android:startOffset="83" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="100" + android:startOffset="67" android:valueFrom="1.1" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.92,1.096 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> </aapt:attr> </target> - <target android:name="_R_G_L_1_G_D_4_P_0"> + <target android:name="_R_G_L_1_G_D_2_P_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="83" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="67" + android:startOffset="0" android:valueFrom="1" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="250" - android:propertyName="trimPathEnd" - android:startOffset="83" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="133" + android:startOffset="67" android:valueFrom="1" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> </aapt:attr> </target> - <target android:name="_R_G_L_0_G_D_0_P_0_G_0_T_0"> + <target android:name="_R_G_L_0_G_D_0_P_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="67" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="1.1" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.853,0 0.6,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="1.1" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.853,0 0.6,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleX" - android:startOffset="67" - android:valueFrom="1.1" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="83" + android:startOffset="0" android:valueFrom="0" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.92,1.06 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleY" - android:startOffset="67" - android:valueFrom="1.1" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="250" + android:startOffset="83" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.92,1.06 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> </aapt:attr> </target> - <target android:name="_R_G_L_0_G_D_1_P_0_G_0_T_0"> + <target android:name="_R_G_L_0_G_D_1_P_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="67" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="83" + android:startOffset="0" android:valueFrom="0" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.659,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="1.1" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="250" + android:startOffset="83" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.6,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleX" - android:startOffset="67" - android:valueFrom="1" - android:valueTo="1" - android:valueType="floatType"> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_2_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="83" + android:startOffset="0" android:valueFrom="0" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.6,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleY" - android:startOffset="67" - android:valueFrom="1.1" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="250" + android:startOffset="83" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.8,0 0.92,1.096 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> </aapt:attr> </target> - <target android:name="_R_G_L_0_G_D_2_P_0"> + <target android:name="_R_G_L_0_G_D_3_P_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="67" - android:propertyName="trimPathEnd" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="83" + android:startOffset="0" android:valueFrom="0" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="133" - android:propertyName="trimPathEnd" - android:startOffset="67" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathEnd" android:duration="250" + android:startOffset="83" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> @@ -416,14 +245,10 @@ <target android:name="time_group"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="350" - android:propertyName="translateX" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType" /> + <objectAnimator android:propertyName="translateX" android:duration="417" + android:startOffset="0" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"/> </set> </aapt:attr> </target> -</animated-vector>
\ No newline at end of file +</animated-vector> diff --git a/packages/SystemUI/res/drawable/fingerprint_dialog_fp_to_error.xml b/packages/SystemUI/res/drawable/fingerprint_dialog_fp_to_error.xml index b899828cd85c..fc2c7d00f3a7 100644 --- a/packages/SystemUI/res/drawable/fingerprint_dialog_fp_to_error.xml +++ b/packages/SystemUI/res/drawable/fingerprint_dialog_fp_to_error.xml @@ -1,391 +1,235 @@ -<?xml version="1.0" encoding="utf-8"?><!-- - ~ Copyright (C) 2018 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License - --> +<?xml version="1.0" encoding="utf-8" ?> +<!-- Copyright (C) 2021 The Android Open Source Project + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> <animated-vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:aapt="http://schemas.android.com/aapt"> + xmlns:aapt="http://schemas.android.com/aapt"> <aapt:attr name="android:drawable"> - <vector - android:width="60dp" - android:height="60dp" - android:viewportHeight="60" - android:viewportWidth="60"> + <vector android:height="60dp" android:width="60dp" android:viewportHeight="60" + android:viewportWidth="60"> <group android:name="_R_G"> - <group - android:name="_R_G_L_1_G_N_4_T_0" - android:translateX="30" - android:translateY="30"> - <group - android:name="_R_G_L_1_G" - android:pivotX="114" - android:pivotY="114" - android:scaleX="0.42244" - android:scaleY="0.42244" - android:translateX="-114" - android:translateY="-114"> - <path - android:name="_R_G_L_1_G_D_0_P_0" - android:pathData=" M79.63 67.24 C79.63,67.24 111.5,47.42 147.83,67.24 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_1_G_D_1_P_0" - android:pathData=" M64.27 98.07 C64.27,98.07 80.13,73.02 113.98,73.02 C147.83,73.02 163.56,97.26 163.56,97.26 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_1_G_D_2_P_0" - android:pathData=" M72.53 151.07 C72.53,151.07 62.46,122.89 76.16,105.55 C89.86,88.21 106.72,86.73 113.98,86.73 C121.08,86.73 153.51,90.62 158.7,125.87 C159.14,128.82 158.8,132.88 157.18,136.09 C154.88,140.63 150.62,143.63 145.85,143.97 C133.78,144.85 129.76,137.92 129.26,128.49 C128.88,121.19 122.49,115.35 113.15,115.35 C102.91,115.35 95.97,126.69 99.77,139.74 C103.57,152.78 111.33,163.85 130.32,169.13 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_1_G_D_3_P_0" - android:pathData=" M100.6 167.84 C100.6,167.84 82.76,152.1 83.75,130.31 C84.75,108.53 102.58,100.7 113.73,100.7 C124.87,100.7 144.19,108.56 144.19,130.01 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="0" /> - <path - android:name="_R_G_L_1_G_D_4_P_0" - android:pathData=" M113.73 129.17 C113.73,129.17 113.15,161.33 149.15,156.58 " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_accent" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="5.5" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="0" /> + <group android:name="_R_G_L_1_G" android:translateX="-0.05000000000000071"> + <group android:name="_R_G_L_1_G_D_0_P_0_G_0_T_0" android:translateX="30" + android:translateY="38.75" android:scaleX="0" android:scaleY="0"> + <path android:name="_R_G_L_1_G_D_0_P_0" + android:fillColor="@color/biometric_dialog_error" + android:fillAlpha="1" android:fillType="nonZero" + android:pathData=" M-1.2 -1.25 C-1.2,-1.25 1.2,-1.25 1.2,-1.25 C1.2,-1.25 1.2,1.25 1.2,1.25 C1.2,1.25 -1.2,1.25 -1.2,1.25 C-1.2,1.25 -1.2,-1.25 -1.2,-1.25c "/> </group> - </group> - <group - android:name="_R_G_L_0_G_N_4_T_0" - android:translateX="30" - android:translateY="30"> - <group - android:name="_R_G_L_0_G" - android:translateX="-30.05" - android:translateY="-30"> - <group - android:name="_R_G_L_0_G_D_0_P_0_G_0_T_0" - android:scaleX="0" - android:scaleY="0" - android:translateX="30" - android:translateY="38.75"> - <path - android:name="_R_G_L_0_G_D_0_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_dialog_error" - android:fillType="nonZero" - android:pathData=" M-1.2 -1.25 C-1.2,-1.25 1.2,-1.25 1.2,-1.25 C1.2,-1.25 1.2,1.25 1.2,1.25 C1.2,1.25 -1.2,1.25 -1.2,1.25 C-1.2,1.25 -1.2,-1.25 -1.2,-1.25c " /> - </group> - <group - android:name="_R_G_L_0_G_D_1_P_0_G_0_T_0" - android:pivotX="0.002" - android:pivotY="7.488" - android:scaleX="1" - android:scaleY="0" - android:translateX="30" - android:translateY="25"> - <path - android:name="_R_G_L_0_G_D_1_P_0" - android:fillAlpha="1" - android:fillColor="@color/biometric_dialog_error" - android:fillType="nonZero" - android:pathData=" M-1.2 -7.5 C-1.2,-7.5 1.2,-7.5 1.2,-7.5 C1.2,-7.5 1.2,7.5 1.2,7.5 C1.2,7.5 -1.2,7.5 -1.2,7.5 C-1.2,7.5 -1.2,-7.5 -1.2,-7.5c " /> - </group> - <path - android:name="_R_G_L_0_G_D_2_P_0" - android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c " - android:strokeAlpha="1" - android:strokeColor="@color/biometric_dialog_error" - android:strokeLineCap="round" - android:strokeLineJoin="round" - android:strokeWidth="2.5" - android:trimPathEnd="1" - android:trimPathOffset="0" - android:trimPathStart="1" /> + <group android:name="_R_G_L_1_G_D_1_P_0_G_0_T_0" android:translateX="30" + android:translateY="25" android:pivotX="0.002" android:pivotY="7.488" + android:scaleX="1" android:scaleY="0"> + <path android:name="_R_G_L_1_G_D_1_P_0" + android:fillColor="@color/biometric_dialog_error" + android:fillAlpha="1" android:fillType="nonZero" + android:pathData=" M-1.2 -7.5 C-1.2,-7.5 1.2,-7.5 1.2,-7.5 C1.2,-7.5 1.2,7.5 1.2,7.5 C1.2,7.5 -1.2,7.5 -1.2,7.5 C-1.2,7.5 -1.2,-7.5 -1.2,-7.5c "/> </group> + <path android:name="_R_G_L_1_G_D_2_P_0" + android:strokeColor="@color/biometric_dialog_error" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2.5" android:strokeAlpha="1" + android:trimPathStart="1" android:trimPathEnd="1" + android:trimPathOffset="0" + android:pathData=" M30 6.2 C16.9,6.2 6.3,16.8 6.3,30 C6.3,43.2 16.9,53.8 30,53.8 C43.1,53.8 53.8,43.2 53.8,30 C53.8,16.8 43.1,6.2 30,6.2c "/> + </group> + <group android:name="_R_G_L_0_G" android:translateX="-10.325" + android:translateY="-10.25"> + <path android:name="_R_G_L_0_G_D_0_P_0" + android:strokeColor="@color/biometric_dialog_accent" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2" android:strokeAlpha="1" android:trimPathStart="0" + android:trimPathEnd="1" android:trimPathOffset="0" + android:pathData=" M31.41 48.43 C30.78,46.69 30.78,44.91 30.78,44.91 C30.78,40.09 34.88,36.16 40.32,36.16 C45.77,36.16 49.87,40.09 49.87,44.91 C49.87,44.91 49.87,45.17 49.87,45.17 C49.87,46.97 48.41,48.43 46.61,48.43 C45.28,48.43 44.09,47.63 43.6,46.39 C43.6,46.39 42.51,43.66 42.51,43.66 C42.02,42.42 40.82,41.61 39.49,41.61 C37.69,41.61 36.23,43.07 36.23,44.87 C36.23,47.12 37.26,49.26 39.02,50.67 C39.02,50.67 39.64,51.16 39.64,51.16 "/> + <path android:name="_R_G_L_0_G_D_1_P_0" + android:strokeColor="@color/biometric_dialog_accent" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2" android:strokeAlpha="1" android:trimPathStart="0" + android:trimPathEnd="1" android:trimPathOffset="0" + android:pathData=" M32.14 27.3 C34.5,26 37.31,25.25 40.33,25.25 C43.34,25.25 46.15,26 48.51,27.3 "/> + <path android:name="_R_G_L_0_G_D_2_P_0" + android:strokeColor="@color/biometric_dialog_accent" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2" android:strokeAlpha="1" android:trimPathStart="0" + android:trimPathEnd="1" android:trimPathOffset="0" + android:pathData=" M29.42 36.16 C31.35,32.94 35.51,30.71 40.33,30.71 C45.14,30.71 49.3,32.94 51.23,36.16 "/> + <path android:name="_R_G_L_0_G_D_3_P_0" + android:strokeColor="@color/biometric_dialog_accent" + android:strokeLineCap="round" android:strokeLineJoin="round" + android:strokeWidth="2" android:strokeAlpha="1" android:trimPathStart="0" + android:trimPathEnd="1" android:trimPathOffset="0" + android:pathData=" M47.14 52.52 C45.33,54.21 42.94,55.25 40.33,55.25 C37.71,55.25 35.32,54.21 33.51,52.52 "/> </group> </group> - <group android:name="time_group" /> + <group android:name="time_group"/> </vector> </aapt:attr> - <target android:name="_R_G_L_1_G_D_0_P_0"> + <target android:name="_R_G_L_1_G_D_0_P_0_G_0_T_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="167" - android:propertyName="trimPathStart" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="167" + android:startOffset="0" android:valueFrom="0" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.6,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.06 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_1_G_D_1_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="167" - android:propertyName="trimPathStart" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="167" + android:startOffset="0" android:valueFrom="0" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.6,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.06 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_1_G_D_2_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="167" - android:propertyName="trimPathStart" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="100" + android:startOffset="167" android:valueFrom="0" + android:valueTo="1.1" android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.6,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.06 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_1_G_D_3_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="167" - android:propertyName="trimPathStart" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="100" + android:startOffset="167" android:valueFrom="0" + android:valueTo="1.1" android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.6,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.06 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - </set> - </aapt:attr> - </target> - <target android:name="_R_G_L_1_G_D_4_P_0"> - <aapt:attr name="android:animation"> - <set android:ordering="together"> - <objectAnimator - android:duration="167" - android:propertyName="trimPathStart" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="67" + android:startOffset="267" android:valueFrom="1.1" + android:valueTo="1" android:valueType="floatType"> + <aapt:attr name="android:interpolator"> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.147,1 1.0,1.0"/> + </aapt:attr> + </objectAnimator> + <objectAnimator android:propertyName="scaleY" android:duration="67" + android:startOffset="267" android:valueFrom="1.1" + android:valueTo="1" android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.6,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.147,1 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> </aapt:attr> </target> - <target android:name="_R_G_L_0_G_D_0_P_0_G_0_T_0"> + <target android:name="_R_G_L_1_G_D_1_P_0_G_0_T_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="167" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="167" + android:startOffset="0" android:valueFrom="1" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.06 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="167" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="167" + android:startOffset="0" android:valueFrom="0" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.06 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.096 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleX" - android:startOffset="167" - android:valueFrom="0" - android:valueTo="1.1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="100" + android:startOffset="167" android:valueFrom="1" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.06 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleY" - android:startOffset="167" - android:valueFrom="0" - android:valueTo="1.1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="100" + android:startOffset="167" android:valueFrom="0" + android:valueTo="1.1" android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.06 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.096 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleX" - android:startOffset="267" - android:valueFrom="1.1" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleX" android:duration="67" + android:startOffset="267" android:valueFrom="1" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.147,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.341,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleY" - android:startOffset="267" - android:valueFrom="1.1" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="scaleY" android:duration="67" + android:startOffset="267" android:valueFrom="1.1" + android:valueTo="1" android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.147,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> </aapt:attr> </target> - <target android:name="_R_G_L_0_G_D_1_P_0_G_0_T_0"> + <target android:name="_R_G_L_1_G_D_2_P_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="167" - android:propertyName="scaleX" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="1" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathStart" android:duration="267" + android:startOffset="0" android:valueFrom="1" android:valueTo="0" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="167" - android:propertyName="scaleY" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="0" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.096 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleX" - android:startOffset="167" - android:valueFrom="1" - android:valueTo="1" - android:valueType="floatType"> - <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> - </aapt:attr> - </objectAnimator> - <objectAnimator - android:duration="100" - android:propertyName="scaleY" - android:startOffset="167" - android:valueFrom="0" - android:valueTo="1.1" - android:valueType="floatType"> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_0_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="trimPathStart" android:duration="167" + android:startOffset="0" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.08,0.096 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleX" - android:startOffset="267" - android:valueFrom="1" - android:valueTo="1" - android:valueType="floatType"> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_1_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="trimPathStart" android:duration="167" + android:startOffset="0" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.341,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> - <objectAnimator - android:duration="67" - android:propertyName="scaleY" - android:startOffset="267" - android:valueFrom="1.1" - android:valueTo="1" - android:valueType="floatType"> + </set> + </aapt:attr> + </target> + <target android:name="_R_G_L_0_G_D_2_P_0"> + <aapt:attr name="android:animation"> + <set android:ordering="together"> + <objectAnimator android:propertyName="trimPathStart" android:duration="167" + android:startOffset="0" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> </aapt:attr> </target> - <target android:name="_R_G_L_0_G_D_2_P_0"> + <target android:name="_R_G_L_0_G_D_3_P_0"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="267" - android:propertyName="trimPathStart" - android:startOffset="0" - android:valueFrom="1" - android:valueTo="0" - android:valueType="floatType"> + <objectAnimator android:propertyName="trimPathStart" android:duration="167" + android:startOffset="0" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"> <aapt:attr name="android:interpolator"> - <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0" /> + <pathInterpolator android:pathData="M 0.0,0.0 c0.4,0 0.2,1 1.0,1.0"/> </aapt:attr> </objectAnimator> </set> @@ -394,14 +238,10 @@ <target android:name="time_group"> <aapt:attr name="android:animation"> <set android:ordering="together"> - <objectAnimator - android:duration="350" - android:propertyName="translateX" - android:startOffset="0" - android:valueFrom="0" - android:valueTo="1" - android:valueType="floatType" /> + <objectAnimator android:propertyName="translateX" android:duration="350" + android:startOffset="0" android:valueFrom="0" android:valueTo="1" + android:valueType="floatType"/> </set> </aapt:attr> </target> -</animated-vector>
\ No newline at end of file +</animated-vector> diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index 6d5be301a82d..e71ed59d2e04 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -54,8 +54,7 @@ <com.android.keyguard.LockIconView android:id="@+id/lock_icon_view" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="center"> + android:layout_height="wrap_content"> <!-- Background protection --> <ImageView android:id="@+id/lock_icon_bg" diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconView.java b/packages/SystemUI/src/com/android/keyguard/LockIconView.java index 622419a86bfc..edb05691b530 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconView.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconView.java @@ -22,7 +22,6 @@ import android.graphics.PointF; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.AttributeSet; -import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; @@ -91,13 +90,11 @@ public class LockIconView extends FrameLayout implements Dumpable { mLockIconCenter.x + mRadius, mLockIconCenter.y + mRadius); - setX(mSensorRect.left); - setY(mSensorRect.top); - - final FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams( - (int) (mSensorRect.right - mSensorRect.left), - (int) (mSensorRect.bottom - mSensorRect.top)); - lp.gravity = Gravity.CENTER; + final FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) getLayoutParams(); + lp.width = (int) (mSensorRect.right - mSensorRect.left); + lp.height = (int) (mSensorRect.bottom - mSensorRect.top); + lp.topMargin = (int) mSensorRect.top; + lp.setMarginStart((int) mSensorRect.left); setLayoutParams(lp); } @@ -114,5 +111,6 @@ public class LockIconView extends FrameLayout implements Dumpable { public void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @NonNull String[] args) { pw.println("Center in px (x, y)= (" + mLockIconCenter.x + ", " + mLockIconCenter.y + ")"); pw.println("Radius in pixels: " + mRadius); + pw.println("topLeft= (" + getX() + ", " + getY() + ")"); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java index 86c90c7bcb2e..9eb95c409009 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/FooterView.java @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.notification.row; -import android.annotation.ColorInt; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; @@ -28,15 +27,12 @@ import com.android.systemui.statusbar.notification.stack.ExpandableViewState; import com.android.systemui.statusbar.notification.stack.ViewState; public class FooterView extends StackScrollerDecorView { - private final int mClearAllTopPadding; private FooterViewButton mDismissButton; private FooterViewButton mManageButton; private boolean mShowHistory; public FooterView(Context context, AttributeSet attrs) { super(context, attrs); - mClearAllTopPadding = context.getResources().getDimensionPixelSize( - R.dimen.clear_all_padding_top); } @Override @@ -55,11 +51,6 @@ public class FooterView extends StackScrollerDecorView { mManageButton = findViewById(R.id.manage_text); } - public void setTextColor(@ColorInt int color) { - mManageButton.setTextColor(color); - mDismissButton.setTextColor(color); - } - public void setManageButtonClickListener(OnClickListener listener) { mManageButton.setOnClickListener(listener); } @@ -95,21 +86,25 @@ public class FooterView extends StackScrollerDecorView { @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); - int textColor = getResources().getColor(R.color.notif_pill_text); - Resources.Theme theme = getContext().getTheme(); - mDismissButton.setBackground( - getResources().getDrawable(R.drawable.notif_footer_btn_background, theme)); - mDismissButton.setTextColor(textColor); - mManageButton.setBackground( - getResources().getDrawable(R.drawable.notif_footer_btn_background, theme)); - mManageButton = findViewById(R.id.manage_text); + updateColors(); mDismissButton.setText(R.string.clear_all_notifications_text); - mManageButton.setTextColor(textColor); mDismissButton.setContentDescription( mContext.getString(R.string.accessibility_clear_all)); showHistory(mShowHistory); } + /** + * Update the text and background colors for the current color palette and night mode setting. + */ + public void updateColors() { + Resources.Theme theme = mContext.getTheme(); + int textColor = getResources().getColor(R.color.notif_pill_text, theme); + mDismissButton.setBackground(theme.getDrawable(R.drawable.notif_footer_btn_background)); + mDismissButton.setTextColor(textColor); + mManageButton.setBackground(theme.getDrawable(R.drawable.notif_footer_btn_background)); + mManageButton.setTextColor(textColor); + } + @Override public ExpandableViewState createExpandableViewState() { return new FooterViewState(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 289c32f17b31..0660daab3720 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -4231,7 +4231,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable final @ColorInt int textColor = Utils.getColorAttrDefaultColor(mContext, android.R.attr.textColorPrimary); mSectionsManager.setHeaderForegroundColor(textColor); - mFooterView.setTextColor(textColor); + mFooterView.updateColors(); mEmptyShadeView.setTextColor(textColor); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java index fa6111589bff..c49de7ab0e5d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java @@ -70,6 +70,7 @@ import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dagger.qualifiers.Background; import com.android.systemui.demomode.DemoMode; import com.android.systemui.demomode.DemoModeController; +import com.android.systemui.dump.DumpManager; import com.android.systemui.settings.CurrentUserTracker; import com.android.systemui.statusbar.FeatureFlags; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; @@ -126,6 +127,7 @@ public class NetworkControllerImpl extends BroadcastReceiver private Config mConfig; private final CarrierConfigTracker mCarrierConfigTracker; private final FeatureFlags mFeatureFlags; + private final DumpManager mDumpManager; private TelephonyCallback.ActiveDataSubscriptionIdListener mPhoneStateListener; private int mActiveMobileDataSubscription = SubscriptionManager.INVALID_SUBSCRIPTION_ID; @@ -218,7 +220,8 @@ public class NetworkControllerImpl extends BroadcastReceiver AccessPointControllerImpl accessPointController, DemoModeController demoModeController, CarrierConfigTracker carrierConfigTracker, - FeatureFlags featureFlags) { + FeatureFlags featureFlags, + DumpManager dumpManager) { this(context, connectivityManager, telephonyManager, telephonyListenerManager, @@ -236,7 +239,8 @@ public class NetworkControllerImpl extends BroadcastReceiver broadcastDispatcher, demoModeController, carrierConfigTracker, - featureFlags); + featureFlags, + dumpManager); mReceiverHandler.post(mRegisterListeners); } @@ -256,7 +260,8 @@ public class NetworkControllerImpl extends BroadcastReceiver BroadcastDispatcher broadcastDispatcher, DemoModeController demoModeController, CarrierConfigTracker carrierConfigTracker, - FeatureFlags featureFlags + FeatureFlags featureFlags, + DumpManager dumpManager ) { mContext = context; mTelephonyListenerManager = telephonyListenerManager; @@ -275,6 +280,7 @@ public class NetworkControllerImpl extends BroadcastReceiver mDemoModeController = demoModeController; mCarrierConfigTracker = carrierConfigTracker; mFeatureFlags = featureFlags; + mDumpManager = dumpManager; // telephony mPhone = telephonyManager; @@ -425,6 +431,8 @@ public class NetworkControllerImpl extends BroadcastReceiver mDemoModeController.addCallback(this); mProviderModelBehavior = mFeatureFlags.isCombinedStatusBarSignalIconsEnabled(); mProviderModelSetting = mFeatureFlags.isProviderModelSettingEnabled(); + + mDumpManager.registerDumpable(TAG, this); } private final Runnable mClearForceValidated = () -> { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java index f2de26c29805..6c4ec223969a 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java @@ -70,6 +70,7 @@ import com.android.settingslib.net.DataUsageController; import com.android.systemui.SysuiTestCase; import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.demomode.DemoModeController; +import com.android.systemui.dump.DumpManager; import com.android.systemui.statusbar.FeatureFlags; import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceProvisionedListener; import com.android.systemui.statusbar.policy.NetworkController.IconState; @@ -241,7 +242,9 @@ public class NetworkControllerBaseTest extends SysuiTestCase { mMockBd, mDemoModeController, mCarrierConfigTracker, - mFeatureFlags); + mFeatureFlags, + mock(DumpManager.class) + ); setupNetworkController(); // Trigger blank callbacks to always get the current state (some tests don't trigger @@ -309,7 +312,8 @@ public class NetworkControllerBaseTest extends SysuiTestCase { mock(AccessPointControllerImpl.class), mock(DataUsageController.class), mMockSubDefaults, mock(DeviceProvisionedController.class), mMockBd, mDemoModeController, - mCarrierConfigTracker, mFeatureFlags); + mCarrierConfigTracker, mFeatureFlags, + mock(DumpManager.class)); setupNetworkController(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java index bc4c2b69e3f0..3433a14f54e7 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerDataTest.java @@ -21,6 +21,7 @@ import android.testing.TestableLooper.RunWithLooper; import com.android.settingslib.mobile.TelephonyIcons; import com.android.settingslib.net.DataUsageController; +import com.android.systemui.dump.DumpManager; import com.android.systemui.util.CarrierConfigTracker; import org.junit.Test; @@ -113,7 +114,7 @@ public class NetworkControllerDataTest extends NetworkControllerBaseTest { mock(AccessPointControllerImpl.class), mock(DataUsageController.class), mMockSubDefaults, mock(DeviceProvisionedController.class), mMockBd, mDemoModeController, - mock(CarrierConfigTracker.class), mFeatureFlags); + mock(CarrierConfigTracker.class), mFeatureFlags, mock(DumpManager.class)); setupNetworkController(); setupDefaultSignal(); diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java index 5090b0dbc2a6..4ff13011567b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerSignalTest.java @@ -41,6 +41,7 @@ import com.android.settingslib.graph.SignalDrawable; import com.android.settingslib.mobile.TelephonyIcons; import com.android.settingslib.net.DataUsageController; import com.android.systemui.R; +import com.android.systemui.dump.DumpManager; import com.android.systemui.util.CarrierConfigTracker; import org.junit.Test; @@ -67,7 +68,8 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { Looper.getMainLooper(), mFakeExecutor, mCallbackHandler, mock(AccessPointControllerImpl.class), mock(DataUsageController.class), mMockSubDefaults, mock(DeviceProvisionedController.class), mMockBd, - mDemoModeController, mock(CarrierConfigTracker.class), mFeatureFlags); + mDemoModeController, mock(CarrierConfigTracker.class), mFeatureFlags, + mock(DumpManager.class)); setupNetworkController(); verifyLastMobileDataIndicators(false, -1, 0); @@ -87,7 +89,8 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { Looper.getMainLooper(), mFakeExecutor, mCallbackHandler, mock(AccessPointControllerImpl.class), mock(DataUsageController.class), mMockSubDefaults, mock(DeviceProvisionedController.class), mMockBd, - mDemoModeController, mock(CarrierConfigTracker.class), mFeatureFlags); + mDemoModeController, mock(CarrierConfigTracker.class), mFeatureFlags, + mock(DumpManager.class)); mNetworkController.registerListeners(); // Wait for the main looper to execute the previous command @@ -155,7 +158,8 @@ public class NetworkControllerSignalTest extends NetworkControllerBaseTest { Looper.getMainLooper(), mFakeExecutor, mCallbackHandler, mock(AccessPointControllerImpl.class), mock(DataUsageController.class), mMockSubDefaults, mock(DeviceProvisionedController.class), mMockBd, - mDemoModeController, mock(CarrierConfigTracker.class), mFeatureFlags); + mDemoModeController, mock(CarrierConfigTracker.class), mFeatureFlags, + mock(DumpManager.class)); setupNetworkController(); // No Subscriptions. diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java index a56b1db1494c..c32543ae5c13 100644 --- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java +++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java @@ -3306,11 +3306,12 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku Slog.w(TAG, "Failed to retrieve app info for " + packageName + " userId=" + userId, e); } - if (newAppInfo == null) { + if (newAppInfo == null || provider.info == null + || provider.info.providerInfo == null) { continue; } ApplicationInfo oldAppInfo = provider.info.providerInfo.applicationInfo; - if (!newAppInfo.sourceDir.equals(oldAppInfo.sourceDir)) { + if (oldAppInfo == null || !newAppInfo.sourceDir.equals(oldAppInfo.sourceDir)) { // Overlay paths are generated against a particular version of an application. // The overlays paths of a newly upgraded application are incompatible with the // old version of the application. diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index 904a1f0d6f4f..c4775463ee75 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -22528,7 +22528,7 @@ public class PackageManagerService extends IPackageManager.Stub UserManagerInternal umInternal = mInjector.getUserManagerInternal(); final int flags; - if (StorageManager.isUserKeyUnlocked(userId)) { + if (umInternal.isUserUnlockingOrUnlocked(userId)) { flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE; } else if (umInternal.isUserRunning(userId)) { flags = StorageManager.FLAG_STORAGE_DE; @@ -25395,7 +25395,7 @@ public class PackageManagerService extends IPackageManager.Stub UserManagerInternal umInternal = mInjector.getUserManagerInternal(); for (UserInfo user : mUserManager.getUsers(false /* includeDying */)) { final int flags; - if (StorageManager.isUserKeyUnlocked(user.id)) { + if (umInternal.isUserUnlockingOrUnlocked(user.id)) { flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE; } else if (umInternal.isUserRunning(user.id)) { flags = StorageManager.FLAG_STORAGE_DE; @@ -25735,7 +25735,7 @@ public class PackageManagerService extends IPackageManager.Stub StorageManagerInternal smInternal = mInjector.getLocalService(StorageManagerInternal.class); for (UserInfo user : mUserManager.getUsers(false /*excludeDying*/)) { final int flags; - if (StorageManager.isUserKeyUnlocked(user.id)) { + if (umInternal.isUserUnlockingOrUnlocked(user.id)) { flags = StorageManager.FLAG_STORAGE_DE | StorageManager.FLAG_STORAGE_CE; } else if (umInternal.isUserRunning(user.id)) { flags = StorageManager.FLAG_STORAGE_DE; @@ -25749,7 +25749,7 @@ public class PackageManagerService extends IPackageManager.Stub // Note: this code block is executed with the Installer lock // already held, since it's invoked as a side-effect of // executeBatchLI() - if (StorageManager.isUserKeyUnlocked(user.id)) { + if (umInternal.isUserUnlockingOrUnlocked(user.id)) { // Prepare app data on external storage; currently this is used to // setup any OBB dirs that were created by the installer correctly. int uid = UserHandle.getUid(user.id, UserHandle.getAppId(pkg.getUid())); diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java index 08a67d7f4bb5..1133faabcf69 100644 --- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java +++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java @@ -217,6 +217,8 @@ public class PermissionManagerService extends IPermissionManager.Stub { /** All storage permissions */ private static final List<String> STORAGE_PERMISSIONS = new ArrayList<>(); + /** All nearby devices permissions */ + private static final List<String> NEARBY_DEVICES_PERMISSIONS = new ArrayList<>(); /** If the permission of the value is granted, so is the key */ private static final Map<String, String> FULLER_PERMISSION_MAP = new HashMap<>(); @@ -233,6 +235,9 @@ public class PermissionManagerService extends IPermissionManager.Stub { STORAGE_PERMISSIONS.add(Manifest.permission.READ_EXTERNAL_STORAGE); STORAGE_PERMISSIONS.add(Manifest.permission.WRITE_EXTERNAL_STORAGE); STORAGE_PERMISSIONS.add(Manifest.permission.ACCESS_MEDIA_LOCATION); + NEARBY_DEVICES_PERMISSIONS.add(Manifest.permission.BLUETOOTH_ADVERTISE); + NEARBY_DEVICES_PERMISSIONS.add(Manifest.permission.BLUETOOTH_CONNECT); + NEARBY_DEVICES_PERMISSIONS.add(Manifest.permission.BLUETOOTH_SCAN); } /** Set of source package names for Privileged Permission Allowlist */ @@ -3076,13 +3081,26 @@ public class PermissionManagerService extends IPermissionManager.Stub { Permission bp = mRegistry.getPermission(permission); if (bp != null && bp.isRuntime()) { int flags = ps.getPermissionFlags(permission); - if ((flags & FLAG_PERMISSION_REVOKE_WHEN_REQUESTED) != 0) { - int flagsToRemove = FLAG_PERMISSION_REVOKE_WHEN_REQUESTED; + // We're willing to preserve an implicit "Nearby devices" + // permission grant if this app was already able to interact + // with nearby devices via background location access + boolean preserveGrant = false; + if (ArrayUtils.contains(NEARBY_DEVICES_PERMISSIONS, permission) + && ps.isPermissionGranted( + android.Manifest.permission.ACCESS_BACKGROUND_LOCATION) + && (ps.getPermissionFlags( + android.Manifest.permission.ACCESS_BACKGROUND_LOCATION) + & (FLAG_PERMISSION_REVOKE_WHEN_REQUESTED + | FLAG_PERMISSION_REVOKED_COMPAT)) == 0) { + preserveGrant = true; + } + if ((flags & BLOCKING_PERMISSION_FLAGS) == 0 - && supportsRuntimePermissions) { + && supportsRuntimePermissions + && !preserveGrant) { if (ps.revokePermission(bp)) { if (DEBUG_PERMISSIONS) { Slog.i(TAG, "Revoking runtime permission " diff --git a/services/net/Android.bp b/services/net/Android.bp index a822257e1a74..53ce6b264651 100644 --- a/services/net/Android.bp +++ b/services/net/Android.bp @@ -52,7 +52,6 @@ java_library { // classes generated by netd_aidl_interfaces-platform-java above. "netd_aidl_interface-V3-java", "networkstack-client", - "modules-utils-build_system", ], apex_available: [ "com.android.wifi", |