diff options
56 files changed, 1384 insertions, 1863 deletions
diff --git a/core/java/android/app/usage/flags.aconfig b/core/java/android/app/usage/flags.aconfig index c7b168aaf81d..04c36867271c 100644 --- a/core/java/android/app/usage/flags.aconfig +++ b/core/java/android/app/usage/flags.aconfig @@ -47,3 +47,14 @@ flag { description: "Feature flag for collecting app data size by file type API" bug: "294088945" } + +flag { + name: "disable_idle_check" + namespace: "backstage_power" + description: "disable idle check for USER_SYSTEM during boot up" + is_fixed_read_only: true + bug: "337864590" + metadata { + purpose: PURPOSE_BUGFIX + } +} diff --git a/core/java/android/content/pm/multiuser.aconfig b/core/java/android/content/pm/multiuser.aconfig index cd1913bb26d9..83742eb7ae84 100644 --- a/core/java/android/content/pm/multiuser.aconfig +++ b/core/java/android/content/pm/multiuser.aconfig @@ -240,3 +240,10 @@ flag { description: "Add entrypoint in Settings Reset options for deleting private space when lock is forgotten" bug: "329601751" } + +flag { + name: "allow_main_user_to_access_blocked_number_provider" + namespace: "multiuser" + description: "Allow MAIN user to access blocked number provider" + bug: "338579331" +} diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index a23df799da59..1d70d18ac4c8 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -986,7 +986,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall updateBackgroundVisibility(surfaceUpdateTransaction); updateBackgroundColor(surfaceUpdateTransaction); - if (mLimitedHdrEnabled && hdrHeadroomChanged) { + if (mLimitedHdrEnabled && (hdrHeadroomChanged || creating)) { surfaceUpdateTransaction.setDesiredHdrHeadroom( mBlastSurfaceControl, mHdrHeadroom); } diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 7d22e9458e7b..fdf3cb119a42 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -5300,10 +5300,12 @@ public final class ViewRootImpl implements ViewParent, if (DEBUG_CONTENT_CAPTURE) { Log.v(mTag, "performContentCaptureInitialReport() on " + rootView); } + boolean traceDispatchCapture = false; try { if (!isContentCaptureEnabled()) return; - if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { + traceDispatchCapture = Trace.isTagEnabled(Trace.TRACE_TAG_VIEW); + if (traceDispatchCapture) { Trace.traceBegin(Trace.TRACE_TAG_VIEW, "dispatchContentCapture() for " + getClass().getSimpleName()); } @@ -5319,7 +5321,9 @@ public final class ViewRootImpl implements ViewParent, // Content capture is a go! rootView.dispatchInitialProvideContentCaptureStructure(); } finally { - Trace.traceEnd(Trace.TRACE_TAG_VIEW); + if (traceDispatchCapture) { + Trace.traceEnd(Trace.TRACE_TAG_VIEW); + } } } @@ -5327,10 +5331,12 @@ public final class ViewRootImpl implements ViewParent, if (DEBUG_CONTENT_CAPTURE) { Log.v(mTag, "handleContentCaptureFlush()"); } + boolean traceFlushContentCapture = false; try { if (!isContentCaptureEnabled()) return; - if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { + traceFlushContentCapture = Trace.isTagEnabled(Trace.TRACE_TAG_VIEW); + if (traceFlushContentCapture) { Trace.traceBegin(Trace.TRACE_TAG_VIEW, "flushContentCapture for " + getClass().getSimpleName()); } @@ -5342,7 +5348,9 @@ public final class ViewRootImpl implements ViewParent, } ccm.flush(ContentCaptureSession.FLUSH_REASON_VIEW_ROOT_ENTERED); } finally { - Trace.traceEnd(Trace.TRACE_TAG_VIEW); + if (traceFlushContentCapture) { + Trace.traceEnd(Trace.TRACE_TAG_VIEW); + } } } @@ -12659,10 +12667,12 @@ public final class ViewRootImpl implements ViewParent, view = mFrameRateCategoryView; } + boolean traceFrameRateCategory = false; try { if (frameRateCategory != FRAME_RATE_CATEGORY_DEFAULT && mLastPreferredFrameRateCategory != frameRateCategory) { - if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) { + traceFrameRateCategory = Trace.isTagEnabled(Trace.TRACE_TAG_VIEW); + if (traceFrameRateCategory) { String reason = reasonToString(frameRateReason); String sourceView = view == null ? "-" : view; String category = categoryToString(frameRateCategory); @@ -12680,7 +12690,9 @@ public final class ViewRootImpl implements ViewParent, } catch (Exception e) { Log.e(mTag, "Unable to set frame rate category", e); } finally { - Trace.traceEnd(Trace.TRACE_TAG_VIEW); + if (traceFrameRateCategory) { + Trace.traceEnd(Trace.TRACE_TAG_VIEW); + } } } diff --git a/core/java/android/window/flags/responsible_apis.aconfig b/core/java/android/window/flags/responsible_apis.aconfig index 33af48636f02..69cac6f3dfa5 100644 --- a/core/java/android/window/flags/responsible_apis.aconfig +++ b/core/java/android/window/flags/responsible_apis.aconfig @@ -49,3 +49,10 @@ flag { description: "Prevent BAL based on it is bound by foreground Uid but the app switch is stopped." bug: "283801068" } + +flag { + name: "bal_improved_metrics" + namespace: "responsible_apis" + description: "Improved metrics." + bug: "339245692" +} diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 5fa13bab7b0c..37d39a752c65 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -1346,51 +1346,6 @@ <attr name="materialColorTertiary" format="color"/> <!-- The error color for the app, intended to draw attention to error conditions. @hide --> <attr name="materialColorError" format="color"/> - - <!-- System Custom Tokens--> - <!-- @hide --> - <attr name="customColorWidgetBackground" format="color"/> - <!-- @hide --> - <attr name="customColorClockHour" format="color"/> - <!-- @hide --> - <attr name="customColorClockMinute" format="color"/> - <!-- @hide --> - <attr name="customColorClockSecond" format="color"/> - <!-- @hide --> - <attr name="customColorThemeApp" format="color"/> - <!-- @hide --> - <attr name="customColorOnThemeApp" format="color"/> - <!-- @hide --> - <attr name="customColorThemeAppRing" format="color"/> - <!-- @hide --> - <attr name="customColorOnThemeAppRing" format="color"/> - <!-- @hide --> - <attr name="customColorBrandA" format="color"/> - <!-- @hide --> - <attr name="customColorBrandB" format="color"/> - <!-- @hide --> - <attr name="customColorBrandC" format="color"/> - <!-- @hide --> - <attr name="customColorBrandD" format="color"/> - <!-- @hide --> - <attr name="customColorUnderSurface" format="color"/> - <!-- @hide --> - <attr name="customColorShadeActive" format="color"/> - <!-- @hide --> - <attr name="customColorOnShadeActive" format="color"/> - <!-- @hide --> - <attr name="customColorOnShadeActiveVariant" format="color"/> - <!-- @hide --> - <attr name="customColorShadeInactive" format="color"/> - <!-- @hide --> - <attr name="customColorOnShadeInactive" format="color"/> - <!-- @hide --> - <attr name="customColorOnShadeInactiveVariant" format="color"/> - <!-- @hide --> - <attr name="customColorShadeDisabled" format="color"/> - <!-- @hide --> - <attr name="customColorOverviewBackground" format="color"/> - </declare-styleable> <!-- **************************************************************** --> diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml index 5e039b5e958d..e6719195565e 100644 --- a/core/res/res/values/colors.xml +++ b/core/res/res/values/colors.xml @@ -581,51 +581,6 @@ <color name="system_on_tertiary_fixed">#FFFFFF</color> <color name="system_on_tertiary_fixed_variant">#FFFFFF</color> - <!--Colors used in Android system, from design system. These values can be overlaid at runtime - by OverlayManager RROs.--> - <color name="system_widget_background_light">#EEF0FF</color> - <color name="system_clock_hour_light">#1D2435</color> - <color name="system_clock_minute_light">#20386A</color> - <color name="system_clock_second_light">#000000</color> - <color name="system_theme_app_light">#2F4578</color> - <color name="system_on_theme_app_light">#D6DFFF</color> - <color name="system_theme_app_ring_light">#94AAE4</color> - <color name="system_on_theme_app_ring_light">#FDD7FA</color> - <color name="system_brand_a_light">#3A5084</color> - <color name="system_brand_b_light">#6E7488</color> - <color name="system_brand_c_light">#6076AC</color> - <color name="system_brand_d_light">#8C6D8C</color> - <color name="system_under_surface_light">#000000</color> - <color name="system_shade_active_light">#D9E2FF</color> - <color name="system_on_shade_active_light">#152E60</color> - <color name="system_on_shade_active_variant_light">#2F4578</color> - <color name="system_shade_inactive_light">#2F3036</color> - <color name="system_on_shade_inactive_light">#E1E2EC</color> - <color name="system_on_shade_inactive_variant_light">#C5C6D0</color> - <color name="system_shade_disabled_light">#0C0E13</color> - <color name="system_overview_background_light">#50525A</color> - <color name="system_widget_background_dark">#152E60</color> - <color name="system_clock_hour_dark">#9AA0B6</color> - <color name="system_clock_minute_dark">#D8E1FF</color> - <color name="system_clock_second_dark">#FFFFFF</color> - <color name="system_theme_app_dark">#D9E2FF</color> - <color name="system_on_theme_app_dark">#304679</color> - <color name="system_theme_app_ring_dark">#94AAE4</color> - <color name="system_on_theme_app_ring_dark">#E0BBDD</color> - <color name="system_brand_a_dark">#90A6DF</color> - <color name="system_brand_b_dark">#A4ABC1</color> - <color name="system_brand_c_dark">#7A90C8</color> - <color name="system_brand_d_dark">#A886A6</color> - <color name="system_under_surface_dark">#000000</color> - <color name="system_shade_active_dark">#D9E2FF</color> - <color name="system_on_shade_active_dark">#001945</color> - <color name="system_on_shade_active_variant_dark">#2F4578</color> - <color name="system_shade_inactive_dark">#2F3036</color> - <color name="system_on_shade_inactive_dark">#E1E2EC</color> - <color name="system_on_shade_inactive_variant_dark">#C5C6D0</color> - <color name="system_shade_disabled_dark">#0C0E13</color> - <color name="system_overview_background_dark">#C5C6D0</color> - <!-- Accessibility shortcut icon background color --> <color name="accessibility_feature_background">#5F6368</color> <!-- Google grey 700 --> <color name="accessibility_magnification_background">#F50D60</color> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 877d11e0a09a..edaf8b568c70 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -6093,6 +6093,18 @@ <!-- Whether displaying letterbox education is enabled for letterboxed fullscreen apps. --> <bool name="config_letterboxIsEducationEnabled">false</bool> + <!-- The width in dp to use to detect vertical thin letterboxing. + If W is the available width and w is the letterbox width, an app + is thin letterboxed if the value here is < (W - w) / 2 + If the value is < 0 the thin letterboxing policy is disabled --> + <dimen name="config_letterboxThinLetterboxWidthDp">-1dp</dimen> + + <!-- The height in dp to use to detect horizontal thin letterboxing + If H is the available height and h is the letterbox height, an app + is thin letterboxed if the value here is < (H - h) / 2 + If the value is < 0 the thin letterboxing policy is disabled --> + <dimen name="config_letterboxThinLetterboxHeightDp">-1dp</dimen> + <!-- Default min aspect ratio for unresizable apps which are eligible for size compat mode. Values <= 1.0 will be ignored. Activity min/max aspect ratio restrictions will still be espected so this override can control the maximum screen area that can be occupied by diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 1fca4f859294..59e4161b2e0b 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -6484,4 +6484,23 @@ ul.</string> <string name="satellite_notification_how_it_works">How it works</string> <!-- Initial/System provided label shown for an app which gets unarchived. [CHAR LIMIT=64]. --> <string name="unarchival_session_app_label">Pending...</string> + + <!-- Fingerprint dangling notification title --> + <string name="fingerprint_dangling_notification_title">Set up Fingerprint Unlock again</string> + <!-- Fingerprint dangling notification content for only 1 fingerprint deleted --> + <string name="fingerprint_dangling_notification_msg_1"><xliff:g id="fingerprint">%s</xliff:g> wasn\'t working well and was deleted to improve performance</string> + <!-- Fingerprint dangling notification content for more than 1 fingerprints deleted --> + <string name="fingerprint_dangling_notification_msg_2"><xliff:g id="fingerprint">%1$s</xliff:g> and <xliff:g id="fingerprint">%2$s</xliff:g> weren\'t working well and were deleted to improve performance</string> + <!-- Fingerprint dangling notification content for only 1 fingerprint deleted and no fingerprint left--> + <string name="fingerprint_dangling_notification_msg_all_deleted_1"><xliff:g id="fingerprint">%s</xliff:g> wasn\'t working well and was deleted. Set it up again to unlock your phone with fingerprint.</string> + <!-- Fingerprint dangling notification content for more than 1 fingerprints deleted and no fingerprint left --> + <string name="fingerprint_dangling_notification_msg_all_deleted_2"><xliff:g id="fingerprint">%1$s</xliff:g> and <xliff:g id="fingerprint">%2$s</xliff:g> weren\'t working well and were deleted. Set them up again to unlock your phone with your fingerprint.</string> + <!-- Face dangling notification title --> + <string name="face_dangling_notification_title">Set up Face Unlock again</string> + <!-- Face dangling notification content --> + <string name="face_dangling_notification_msg">Your face model wasn\'t working well and was deleted. Set it up again to unlock your phone with face.</string> + <!-- Biometric dangling notification "set up" action button --> + <string name="biometric_dangling_notification_action_set_up">Set up</string> + <!-- Biometric dangling notification "Not now" action button --> + <string name="biometric_dangling_notification_action_not_now">Not now</string> </resources> diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index e860f5a1f849..d058fb188d16 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -4717,6 +4717,8 @@ <java-symbol type="integer" name="config_letterboxDefaultPositionForTabletopModeReachability" /> <java-symbol type="bool" name="config_letterboxIsPolicyForIgnoringRequestedOrientationEnabled" /> <java-symbol type="bool" name="config_letterboxIsEducationEnabled" /> + <java-symbol type="dimen" name="config_letterboxThinLetterboxWidthDp" /> + <java-symbol type="dimen" name="config_letterboxThinLetterboxHeightDp" /> <java-symbol type="dimen" name="config_letterboxDefaultMinAspectRatioForUnresizableApps" /> <java-symbol type="bool" name="config_letterboxIsSplitScreenAspectRatioForUnresizableAppsEnabled" /> <java-symbol type="bool" name="config_letterboxIsDisplayAspectRatioForFixedOrientationLetterboxEnabled" /> @@ -5286,71 +5288,6 @@ <java-symbol name="materialColorTertiary" type="attr"/> <java-symbol name="materialColorError" type="attr"/> - <java-symbol name="customColorWidgetBackground" type="attr"/> - <java-symbol name="customColorClockHour" type="attr"/> - <java-symbol name="customColorClockMinute" type="attr"/> - <java-symbol name="customColorClockSecond" type="attr"/> - <java-symbol name="customColorThemeApp" type="attr"/> - <java-symbol name="customColorOnThemeApp" type="attr"/> - <java-symbol name="customColorThemeAppRing" type="attr"/> - <java-symbol name="customColorOnThemeAppRing" type="attr"/> - <java-symbol name="customColorBrandA" type="attr"/> - <java-symbol name="customColorBrandB" type="attr"/> - <java-symbol name="customColorBrandC" type="attr"/> - <java-symbol name="customColorBrandD" type="attr"/> - <java-symbol name="customColorUnderSurface" type="attr"/> - <java-symbol name="customColorShadeActive" type="attr"/> - <java-symbol name="customColorOnShadeActive" type="attr"/> - <java-symbol name="customColorOnShadeActiveVariant" type="attr"/> - <java-symbol name="customColorShadeInactive" type="attr"/> - <java-symbol name="customColorOnShadeInactive" type="attr"/> - <java-symbol name="customColorOnShadeInactiveVariant" type="attr"/> - <java-symbol name="customColorShadeDisabled" type="attr"/> - <java-symbol name="customColorOverviewBackground" type="attr"/> - - <java-symbol name="system_widget_background_light" type="color"/> - <java-symbol name="system_clock_hour_light" type="color"/> - <java-symbol name="system_clock_minute_light" type="color"/> - <java-symbol name="system_clock_second_light" type="color"/> - <java-symbol name="system_theme_app_light" type="color"/> - <java-symbol name="system_on_theme_app_light" type="color"/> - <java-symbol name="system_theme_app_ring_light" type="color"/> - <java-symbol name="system_on_theme_app_ring_light" type="color"/> - <java-symbol name="system_brand_a_light" type="color"/> - <java-symbol name="system_brand_b_light" type="color"/> - <java-symbol name="system_brand_c_light" type="color"/> - <java-symbol name="system_brand_d_light" type="color"/> - <java-symbol name="system_under_surface_light" type="color"/> - <java-symbol name="system_shade_active_light" type="color"/> - <java-symbol name="system_on_shade_active_light" type="color"/> - <java-symbol name="system_on_shade_active_variant_light" type="color"/> - <java-symbol name="system_shade_inactive_light" type="color"/> - <java-symbol name="system_on_shade_inactive_light" type="color"/> - <java-symbol name="system_on_shade_inactive_variant_light" type="color"/> - <java-symbol name="system_shade_disabled_light" type="color"/> - <java-symbol name="system_overview_background_light" type="color"/> - <java-symbol name="system_widget_background_dark" type="color"/> - <java-symbol name="system_clock_hour_dark" type="color"/> - <java-symbol name="system_clock_minute_dark" type="color"/> - <java-symbol name="system_clock_second_dark" type="color"/> - <java-symbol name="system_theme_app_dark" type="color"/> - <java-symbol name="system_on_theme_app_dark" type="color"/> - <java-symbol name="system_theme_app_ring_dark" type="color"/> - <java-symbol name="system_on_theme_app_ring_dark" type="color"/> - <java-symbol name="system_brand_a_dark" type="color"/> - <java-symbol name="system_brand_b_dark" type="color"/> - <java-symbol name="system_brand_c_dark" type="color"/> - <java-symbol name="system_brand_d_dark" type="color"/> - <java-symbol name="system_under_surface_dark" type="color"/> - <java-symbol name="system_shade_active_dark" type="color"/> - <java-symbol name="system_on_shade_active_dark" type="color"/> - <java-symbol name="system_on_shade_active_variant_dark" type="color"/> - <java-symbol name="system_shade_inactive_dark" type="color"/> - <java-symbol name="system_on_shade_inactive_dark" type="color"/> - <java-symbol name="system_on_shade_inactive_variant_dark" type="color"/> - <java-symbol name="system_shade_disabled_dark" type="color"/> - <java-symbol name="system_overview_background_dark" type="color"/> - <java-symbol type="attr" name="actionModeUndoDrawable" /> <java-symbol type="attr" name="actionModeRedoDrawable" /> @@ -5495,4 +5432,15 @@ <!-- For PowerManagerService to determine whether to use auto-suspend mode --> <java-symbol type="bool" name="config_useAutoSuspend" /> + + <!-- Biometric dangling notification strings --> + <java-symbol type="string" name="fingerprint_dangling_notification_title" /> + <java-symbol type="string" name="fingerprint_dangling_notification_msg_1" /> + <java-symbol type="string" name="fingerprint_dangling_notification_msg_2" /> + <java-symbol type="string" name="fingerprint_dangling_notification_msg_all_deleted_1" /> + <java-symbol type="string" name="fingerprint_dangling_notification_msg_all_deleted_2" /> + <java-symbol type="string" name="face_dangling_notification_title" /> + <java-symbol type="string" name="face_dangling_notification_msg" /> + <java-symbol type="string" name="biometric_dangling_notification_action_set_up" /> + <java-symbol type="string" name="biometric_dangling_notification_action_not_now" /> </resources> diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml index 24d493867906..ee191449ac35 100644 --- a/core/res/res/values/themes_device_defaults.xml +++ b/core/res/res/values/themes_device_defaults.xml @@ -284,28 +284,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <style name="Theme.DeviceDefault" parent="Theme.DeviceDefaultBase" /> @@ -402,28 +380,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Variant of {@link #Theme_DeviceDefault} with no action bar and no status bar. This theme @@ -519,28 +475,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Variant of {@link #Theme_DeviceDefault} with no action bar and no status bar and @@ -638,28 +572,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Variant of {@link #Theme_DeviceDefault} that has no title bar and translucent @@ -756,28 +668,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- DeviceDefault theme for dialog windows and activities. This changes the window to be @@ -882,28 +772,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Dialog} that has a nice minimum width for a @@ -999,28 +867,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Dialog} without an action bar --> @@ -1115,28 +961,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Dialog_NoActionBar} that has a nice minimum width @@ -1232,28 +1056,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Variant of Theme.DeviceDefault.Dialog that has a fixed size. --> @@ -1365,28 +1167,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- DeviceDefault theme for a window without an action bar that will be displayed either @@ -1483,28 +1263,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- DeviceDefault theme for a presentation window on a secondary display. --> @@ -1599,28 +1357,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- DeviceDefault theme for panel windows. This removes all extraneous window @@ -1717,28 +1453,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- DeviceDefault theme for windows that want to have the user's selected wallpaper appear @@ -1834,28 +1548,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- DeviceDefault theme for windows that want to have the user's selected wallpaper appear @@ -1951,28 +1643,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- DeviceDefault style for input methods, which is used by the @@ -2068,28 +1738,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- DeviceDefault style for input methods, which is used by the @@ -2185,28 +1833,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.Dialog.Alert" parent="Theme.Material.Dialog.Alert"> @@ -2302,28 +1928,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Theme for the dialog shown when an app crashes or ANRs. --> @@ -2424,28 +2028,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <style name="Theme.DeviceDefault.Dialog.NoFrame" parent="Theme.Material.Dialog.NoFrame"> @@ -2539,28 +2121,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <!-- Variant of {@link #Theme_DeviceDefault} with a light-colored style --> @@ -2792,28 +2352,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of the DeviceDefault (light) theme that has a solid (opaque) action bar with an @@ -2909,28 +2447,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Light} with no action bar --> @@ -3025,28 +2541,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Light} with no action bar and no status bar. @@ -3142,28 +2636,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Light} with no action bar and no status bar @@ -3261,28 +2733,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Light} that has no title bar and translucent @@ -3379,28 +2829,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- DeviceDefault light theme for dialog windows and activities. This changes the window to be @@ -3503,28 +2931,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Light_Dialog} that has a nice minimum width for a @@ -3623,28 +3029,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Light_Dialog} without an action bar --> @@ -3742,28 +3126,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Light_Dialog_NoActionBar} that has a nice minimum @@ -3862,28 +3224,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of Theme.DeviceDefault.Dialog that has a fixed size. --> @@ -3963,28 +3303,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of Theme.DeviceDefault.Dialog.NoActionBar that has a fixed size. --> @@ -4064,28 +3382,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- DeviceDefault light theme for a window that will be displayed either full-screen on smaller @@ -4184,28 +3480,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- DeviceDefault light theme for a window without an action bar that will be displayed either @@ -4305,28 +3579,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- DeviceDefault light theme for a presentation window on a secondary display. --> @@ -4424,28 +3676,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- DeviceDefault light theme for panel windows. This removes all extraneous window @@ -4542,28 +3772,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.Light.Dialog.Alert" parent="Theme.Material.Light.Dialog.Alert"> @@ -4659,28 +3867,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.Dialog.Alert.DayNight" parent="Theme.DeviceDefault.Light.Dialog.Alert" /> @@ -4776,28 +3962,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.Light.Voice" parent="Theme.Material.Light.Voice"> @@ -4891,28 +4055,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- DeviceDefault theme for a window that should look like the Settings app. --> @@ -5014,28 +4156,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.SystemUI" parent="Theme.DeviceDefault.Light"> @@ -5118,28 +4238,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.SystemUI.Dialog" parent="Theme.DeviceDefault.Light.Dialog"> @@ -5214,28 +4312,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Variant of {@link #Theme_DeviceDefault_Settings_Dark} with no action bar --> @@ -5331,28 +4407,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <style name="Theme.DeviceDefault.Settings.DialogBase" parent="Theme.Material.Light.BaseDialog"> @@ -5432,28 +4486,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.Settings.Dialog" parent="Theme.DeviceDefault.Settings.DialogBase"> @@ -5573,28 +4605,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.Settings.Dialog.Alert" parent="Theme.Material.Settings.Dialog.Alert"> @@ -5692,28 +4702,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.Settings.Dialog.NoActionBar" parent="Theme.DeviceDefault.Light.Dialog.NoActionBar" /> @@ -5837,28 +4825,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <style name="ThemeOverlay.DeviceDefault.Accent.Light"> @@ -5912,28 +4878,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <!-- Theme overlay that replaces colorAccent with the colorAccent from {@link #Theme_DeviceDefault_DayNight}. --> @@ -5991,28 +4935,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <style name="Theme.DeviceDefault.Light.Dialog.Alert.UserSwitchingDialog" parent="Theme.DeviceDefault.NoActionBar.Fullscreen"> @@ -6066,28 +4988,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_light</item> <item name="materialColorTertiary">@color/system_tertiary_light</item> <item name="materialColorError">@color/system_error_light</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_light</item> - <item name="customColorClockHour">@color/system_clock_hour_light</item> - <item name="customColorClockMinute">@color/system_clock_minute_light</item> - <item name="customColorClockSecond">@color/system_clock_second_light</item> - <item name="customColorThemeApp">@color/system_theme_app_light</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_light</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_light</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_light</item> - <item name="customColorBrandA">@color/system_brand_a_light</item> - <item name="customColorBrandB">@color/system_brand_b_light</item> - <item name="customColorBrandC">@color/system_brand_c_light</item> - <item name="customColorBrandD">@color/system_brand_d_light</item> - <item name="customColorUnderSurface">@color/system_under_surface_light</item> - <item name="customColorShadeActive">@color/system_shade_active_light</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_light</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_light</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_light</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_light</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_light</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_light</item> - <item name="customColorOverviewBackground">@color/system_overview_background_light</item> </style> <style name="Theme.DeviceDefault.Notification" parent="@style/Theme.Material.Notification"> @@ -6152,28 +5052,6 @@ easier. <item name="materialColorSecondary">@color/system_secondary_dark</item> <item name="materialColorTertiary">@color/system_tertiary_dark</item> <item name="materialColorError">@color/system_error_dark</item> - - <item name="customColorWidgetBackground">@color/system_widget_background_dark</item> - <item name="customColorClockHour">@color/system_clock_hour_dark</item> - <item name="customColorClockMinute">@color/system_clock_minute_dark</item> - <item name="customColorClockSecond">@color/system_clock_second_dark</item> - <item name="customColorThemeApp">@color/system_theme_app_dark</item> - <item name="customColorOnThemeApp">@color/system_on_theme_app_dark</item> - <item name="customColorThemeAppRing">@color/system_theme_app_ring_dark</item> - <item name="customColorOnThemeAppRing">@color/system_on_theme_app_ring_dark</item> - <item name="customColorBrandA">@color/system_brand_a_dark</item> - <item name="customColorBrandB">@color/system_brand_b_dark</item> - <item name="customColorBrandC">@color/system_brand_c_dark</item> - <item name="customColorBrandD">@color/system_brand_d_dark</item> - <item name="customColorUnderSurface">@color/system_under_surface_dark</item> - <item name="customColorShadeActive">@color/system_shade_active_dark</item> - <item name="customColorOnShadeActive">@color/system_on_shade_active_dark</item> - <item name="customColorOnShadeActiveVariant">@color/system_on_shade_active_variant_dark</item> - <item name="customColorShadeInactive">@color/system_shade_inactive_dark</item> - <item name="customColorOnShadeInactive">@color/system_on_shade_inactive_dark</item> - <item name="customColorOnShadeInactiveVariant">@color/system_on_shade_inactive_variant_dark</item> - <item name="customColorShadeDisabled">@color/system_shade_disabled_dark</item> - <item name="customColorOverviewBackground">@color/system_overview_background_dark</item> </style> <style name="Theme.DeviceDefault.AutofillHalfScreenDialogList" parent="Theme.DeviceDefault.DayNight"> <item name="colorListDivider">@color/list_divider_opacity_device_default_light</item> diff --git a/libs/input/SpriteController.h b/libs/input/SpriteController.h index 4e4ba6551aec..fdb15506fd0c 100644 --- a/libs/input/SpriteController.h +++ b/libs/input/SpriteController.h @@ -165,29 +165,23 @@ private: * on the sprites for a long time. * Note that the SpriteIcon holds a reference to a shared (and immutable) bitmap. */ struct SpriteState { - inline SpriteState() : - dirty(0), visible(false), - positionX(0), positionY(0), layer(0), alpha(1.0f), displayId(ADISPLAY_ID_DEFAULT), - surfaceWidth(0), surfaceHeight(0), surfaceDrawn(false), surfaceVisible(false) { - } - - uint32_t dirty; + uint32_t dirty{0}; SpriteIcon icon; - bool visible; - float positionX; - float positionY; - int32_t layer; - float alpha; + bool visible{false}; + float positionX{0}; + float positionY{0}; + int32_t layer{0}; + float alpha{1.0f}; SpriteTransformationMatrix transformationMatrix; - int32_t displayId; + int32_t displayId{ADISPLAY_ID_DEFAULT}; sp<SurfaceControl> surfaceControl; - int32_t surfaceWidth; - int32_t surfaceHeight; - bool surfaceDrawn; - bool surfaceVisible; - bool skipScreenshot; + int32_t surfaceWidth{0}; + int32_t surfaceHeight{0}; + bool surfaceDrawn{false}; + bool surfaceVisible{false}; + bool skipScreenshot{false}; inline bool wantSurfaceVisible() const { return visible && alpha > 0.0f && icon.isValid(); diff --git a/packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt b/packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt index 624f18d53a70..47a00f408460 100644 --- a/packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt +++ b/packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt @@ -133,7 +133,7 @@ class ColorScheme( @ColorInt seed: Int, darkTheme: Boolean, style: Style - ) : this(seed, darkTheme, style, 0.0) + ) : this(seed, darkTheme, style, 0.5) @JvmOverloads constructor( diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/util/kotlin/BooleanFlowOperatorsTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/util/kotlin/BooleanFlowOperatorsTest.kt index 03a39f8f07d8..2d8cd930d8fa 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/util/kotlin/BooleanFlowOperatorsTest.kt +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/util/kotlin/BooleanFlowOperatorsTest.kt @@ -23,9 +23,9 @@ import com.android.systemui.coroutines.collectLastValue import com.android.systemui.coroutines.collectValues import com.android.systemui.kosmos.testScope import com.android.systemui.testKosmos -import com.android.systemui.util.kotlin.BooleanFlowOperators.and +import com.android.systemui.util.kotlin.BooleanFlowOperators.allOf +import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf import com.android.systemui.util.kotlin.BooleanFlowOperators.not -import com.android.systemui.util.kotlin.BooleanFlowOperators.or import com.google.common.truth.Truth.assertThat import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow @@ -45,21 +45,21 @@ class BooleanFlowOperatorsTest : SysuiTestCase() { @Test fun and_allTrue_returnsTrue() = testScope.runTest { - val result by collectLastValue(and(TRUE, TRUE)) + val result by collectLastValue(allOf(TRUE, TRUE)) assertThat(result).isTrue() } @Test fun and_anyFalse_returnsFalse() = testScope.runTest { - val result by collectLastValue(and(TRUE, FALSE, TRUE)) + val result by collectLastValue(allOf(TRUE, FALSE, TRUE)) assertThat(result).isFalse() } @Test fun and_allFalse_returnsFalse() = testScope.runTest { - val result by collectLastValue(and(FALSE, FALSE, FALSE)) + val result by collectLastValue(allOf(FALSE, FALSE, FALSE)) assertThat(result).isFalse() } @@ -68,7 +68,7 @@ class BooleanFlowOperatorsTest : SysuiTestCase() { testScope.runTest { val flow1 = MutableStateFlow(false) val flow2 = MutableStateFlow(false) - val values by collectValues(and(flow1, flow2)) + val values by collectValues(allOf(flow1, flow2)) assertThat(values).containsExactly(false) flow1.value = true @@ -81,21 +81,21 @@ class BooleanFlowOperatorsTest : SysuiTestCase() { @Test fun or_allTrue_returnsTrue() = testScope.runTest { - val result by collectLastValue(or(TRUE, TRUE)) + val result by collectLastValue(anyOf(TRUE, TRUE)) assertThat(result).isTrue() } @Test fun or_anyTrue_returnsTrue() = testScope.runTest { - val result by collectLastValue(or(FALSE, TRUE, FALSE)) + val result by collectLastValue(anyOf(FALSE, TRUE, FALSE)) assertThat(result).isTrue() } @Test fun or_allFalse_returnsFalse() = testScope.runTest { - val result by collectLastValue(or(FALSE, FALSE, FALSE)) + val result by collectLastValue(anyOf(FALSE, FALSE, FALSE)) assertThat(result).isFalse() } @@ -104,7 +104,7 @@ class BooleanFlowOperatorsTest : SysuiTestCase() { testScope.runTest { val flow1 = MutableStateFlow(false) val flow2 = MutableStateFlow(false) - val values by collectValues(or(flow1, flow2)) + val values by collectValues(anyOf(flow1, flow2)) assertThat(values).containsExactly(false) flow1.value = true diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractor.kt b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractor.kt index fa19bf478453..e0334a060ee2 100644 --- a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/AlternateBouncerInteractor.kt @@ -29,7 +29,7 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInterac import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.plugins.statusbar.StatusBarStateController import com.android.systemui.statusbar.policy.KeyguardStateController -import com.android.systemui.util.kotlin.BooleanFlowOperators.or +import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf import com.android.systemui.util.time.SystemClock import dagger.Lazy import javax.inject.Inject @@ -78,7 +78,7 @@ constructor( bouncerRepository.alternateBouncerUIAvailable } private val isDozingOrAod: Flow<Boolean> = - or( + anyOf( keyguardTransitionInteractor.get().transitionValue(KeyguardState.DOZING).map { it > 0f }, diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java index fc7f513f9436..b42a903878a7 100644 --- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java +++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingCollectorImpl.java @@ -206,7 +206,7 @@ class FalsingCollectorImpl implements FalsingCollector { ); final CommunalInteractor communalInteractor = mCommunalInteractorLazy.get(); mJavaAdapter.alwaysCollectFlow( - BooleanFlowOperators.INSTANCE.and( + BooleanFlowOperators.INSTANCE.allOf( communalInteractor.isCommunalEnabled(), communalInteractor.isCommunalShowing()), this::onShowingCommunalHubChanged diff --git a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt index 0042915d0cd9..5091a99b2a64 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/domain/interactor/CommunalInteractor.kt @@ -60,9 +60,9 @@ import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.scene.shared.model.Scenes import com.android.systemui.settings.UserTracker import com.android.systemui.smartspace.data.repository.SmartspaceRepository -import com.android.systemui.util.kotlin.BooleanFlowOperators.and +import com.android.systemui.util.kotlin.BooleanFlowOperators.allOf +import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf import com.android.systemui.util.kotlin.BooleanFlowOperators.not -import com.android.systemui.util.kotlin.BooleanFlowOperators.or import com.android.systemui.util.kotlin.emitOnStart import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher @@ -127,10 +127,10 @@ constructor( /** Whether communal features are enabled and available. */ val isCommunalAvailable: Flow<Boolean> = - and( + allOf( communalSettingsInteractor.isCommunalEnabled, not(keyguardInteractor.isEncryptedOrLockdown), - or(keyguardInteractor.isKeyguardShowing, keyguardInteractor.isDreaming) + anyOf(keyguardInteractor.isKeyguardShowing, keyguardInteractor.isDreaming) ) .distinctUntilChanged() .onEach { available -> diff --git a/packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalAppWidgetHostStartable.kt b/packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalAppWidgetHostStartable.kt index 8390d62b23db..2ccab072d57f 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalAppWidgetHostStartable.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/widgets/CommunalAppWidgetHostStartable.kt @@ -23,7 +23,7 @@ import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.settings.UserTracker -import com.android.systemui.util.kotlin.BooleanFlowOperators.or +import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf import com.android.systemui.util.kotlin.pairwise import com.android.systemui.util.kotlin.sample import javax.inject.Inject @@ -46,7 +46,7 @@ constructor( ) : CoreStartable { override fun start() { - or(communalInteractor.isCommunalAvailable, communalInteractor.editModeOpen) + anyOf(communalInteractor.isCommunalAvailable, communalInteractor.editModeOpen) // Only trigger updates on state changes, ignoring the initial false value. .pairwise(false) .filter { (previous, new) -> previous != new } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt index 54d9a78620e5..faab033441c1 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGlanceableHubTransitionInteractor.kt @@ -28,7 +28,7 @@ import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepositor import com.android.systemui.keyguard.shared.model.KeyguardState import com.android.systemui.keyguard.shared.model.TransitionModeOnCanceled import com.android.systemui.power.domain.interactor.PowerInteractor -import com.android.systemui.util.kotlin.BooleanFlowOperators.and +import com.android.systemui.util.kotlin.BooleanFlowOperators.allOf import com.android.systemui.util.kotlin.BooleanFlowOperators.not import javax.inject.Inject import kotlin.time.Duration.Companion.seconds @@ -148,7 +148,7 @@ constructor( } } else { scope.launch { - and(keyguardInteractor.isKeyguardOccluded, not(keyguardInteractor.isDreaming)) + allOf(keyguardInteractor.isKeyguardOccluded, not(keyguardInteractor.isDreaming)) .filterRelevantKeyguardStateAnd { isOccludedAndNotDreaming -> isOccludedAndNotDreaming } diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt index 24a7c512a6a9..bbcea56799ea 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt @@ -42,7 +42,7 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.statusbar.notification.domain.interactor.NotificationsKeyguardInteractor import com.android.systemui.statusbar.phone.DozeParameters import com.android.systemui.statusbar.phone.ScreenOffAnimationController -import com.android.systemui.util.kotlin.BooleanFlowOperators.or +import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf import com.android.systemui.util.kotlin.pairwise import com.android.systemui.util.kotlin.sample import com.android.systemui.util.ui.AnimatableEvent @@ -64,7 +64,6 @@ import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.merge import kotlinx.coroutines.flow.onStart -import kotlinx.coroutines.launch @OptIn(ExperimentalCoroutinesApi::class) @SysUISingleton @@ -134,7 +133,7 @@ constructor( private val isOnLockscreen: Flow<Boolean> = combine( keyguardTransitionInteractor.isFinishedInState(LOCKSCREEN).onStart { emit(false) }, - or( + anyOf( keyguardTransitionInteractor.isInTransitionToState(LOCKSCREEN), keyguardTransitionInteractor.isInTransitionFromState(LOCKSCREEN), ), diff --git a/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt b/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt index 281857fb0658..6367d44bd439 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt +++ b/packages/SystemUI/src/com/android/systemui/shade/GlanceableHubContainerController.kt @@ -51,9 +51,9 @@ import com.android.systemui.scene.shared.flag.SceneContainerFlag import com.android.systemui.scene.shared.model.SceneDataSourceDelegator import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.statusbar.phone.SystemUIDialogFactory -import com.android.systemui.util.kotlin.BooleanFlowOperators.and +import com.android.systemui.util.kotlin.BooleanFlowOperators.allOf +import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf import com.android.systemui.util.kotlin.BooleanFlowOperators.not -import com.android.systemui.util.kotlin.BooleanFlowOperators.or import com.android.systemui.util.kotlin.collectFlow import javax.inject.Inject import kotlinx.coroutines.flow.Flow @@ -145,7 +145,7 @@ constructor( /** Returns a flow that tracks whether communal hub is available. */ fun communalAvailable(): Flow<Boolean> = - or(communalInteractor.isCommunalAvailable, communalInteractor.editModeOpen) + anyOf(communalInteractor.isCommunalAvailable, communalInteractor.editModeOpen) /** * Creates the container view containing the glanceable hub UI. @@ -248,7 +248,7 @@ constructor( // transition to the bouncer would be incorrectly intercepted by the hub. collectFlow( containerView, - or( + anyOf( keyguardInteractor.primaryBouncerShowing, keyguardInteractor.alternateBouncerShowing ), @@ -267,7 +267,7 @@ constructor( ) collectFlow( containerView, - and(shadeInteractor.isAnyFullyExpanded, not(shadeInteractor.isUserInteracting)), + allOf(shadeInteractor.isAnyFullyExpanded, not(shadeInteractor.isUserInteracting)), { shadeShowing = it updateTouchHandlingState() diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt index 1f1251a37f58..0ba7b3c214c6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModel.kt @@ -68,8 +68,8 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.statusbar.notification.stack.domain.interactor.NotificationStackAppearanceInteractor import com.android.systemui.statusbar.notification.stack.domain.interactor.SharedNotificationContainerInteractor import com.android.systemui.unfold.domain.interactor.UnfoldTransitionInteractor -import com.android.systemui.util.kotlin.BooleanFlowOperators.and -import com.android.systemui.util.kotlin.BooleanFlowOperators.or +import com.android.systemui.util.kotlin.BooleanFlowOperators.allOf +import com.android.systemui.util.kotlin.BooleanFlowOperators.anyOf import com.android.systemui.util.kotlin.FlowDumperImpl import com.android.systemui.util.kotlin.Utils.Companion.sample as sampleCombine import javax.inject.Inject @@ -246,7 +246,7 @@ constructor( keyguardTransitionInteractor.finishedKeyguardState.map { state -> state == GLANCEABLE_HUB }, - or( + anyOf( keyguardTransitionInteractor.isInTransitionToState(GLANCEABLE_HUB), keyguardTransitionInteractor.isInTransitionFromState(GLANCEABLE_HUB), ), @@ -424,14 +424,14 @@ constructor( while (currentCoroutineContext().isActive) { emit(false) // Ensure states are inactive to start - and( + allOf( *toFlowArray(statesForHiddenKeyguard) { state -> keyguardTransitionInteractor.transitionValue(state).map { it == 0f } } ) .first { it } // Wait for a qualifying transition to begin - or( + anyOf( *toFlowArray(statesForHiddenKeyguard) { state -> keyguardTransitionInteractor .transitionStepsToState(state) @@ -446,7 +446,7 @@ constructor( // it is considered safe to reset alpha to 1f for HUNs. combine( keyguardInteractor.statusBarState, - and( + allOf( *toFlowArray(statesForHiddenKeyguard) { state -> keyguardTransitionInteractor.transitionValue(state).map { it == 0f diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt index 226a84a78116..88ca9e5f1744 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt @@ -229,7 +229,7 @@ abstract class StatusBarPipelineModule { @SysUISingleton @OemSatelliteInputLog fun provideOemSatelliteInputLog(factory: LogBufferFactory): LogBuffer { - return factory.create("DeviceBasedSatelliteInputLog", 32) + return factory.create("DeviceBasedSatelliteInputLog", 150) } const val FIRST_MOBILE_SUB_SHOWING_NETWORK_TYPE_ICON = diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt index a7c4187afdbd..12f252d215a9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/satellite/data/prod/DeviceBasedSatelliteRepositoryImpl.kt @@ -249,11 +249,17 @@ constructor( try { sm.registerForNtnSignalStrengthChanged(bgDispatcher.asExecutor(), cb) registered = true + logBuffer.i { "Registered for signal strength successfully" } } catch (e: Exception) { logBuffer.e("error registering for signal strength", e) } - awaitClose { if (registered) sm.unregisterForNtnSignalStrengthChanged(cb) } + awaitClose { + if (registered) { + sm.unregisterForNtnSignalStrengthChanged(cb) + logBuffer.i { "Unregistered for signal strength successfully" } + } + } } .flowOn(bgDispatcher) diff --git a/packages/SystemUI/src/com/android/systemui/theme/CustomDynamicColors.java b/packages/SystemUI/src/com/android/systemui/theme/CustomDynamicColors.java deleted file mode 100644 index efeb2f919b56..000000000000 --- a/packages/SystemUI/src/com/android/systemui/theme/CustomDynamicColors.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (C) 2024 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.systemui.theme; - -import com.google.ux.material.libmonet.dynamiccolor.ContrastCurve; -import com.google.ux.material.libmonet.dynamiccolor.DynamicColor; -import com.google.ux.material.libmonet.dynamiccolor.MaterialDynamicColors; -import com.google.ux.material.libmonet.dynamiccolor.ToneDeltaPair; -import com.google.ux.material.libmonet.dynamiccolor.TonePolarity; - -class CustomDynamicColors { - private final MaterialDynamicColors mMdc; - - CustomDynamicColors(boolean isExtendedFidelity) { - this.mMdc = new MaterialDynamicColors(isExtendedFidelity); - } - - // CLOCK COLORS - - public DynamicColor widgetBackground() { - return new DynamicColor( - /* name= */ "widget_background", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> s.isDark ? 20.0 : 95.0, - /* isBackground= */ true, - /* background= */ null, - /* secondBackground= */ null, - /* contrastCurve= */ null, - /* toneDeltaPair= */ null); - } - - public DynamicColor clockHour() { - return new DynamicColor( - /* name= */ "clock_hour", - /* palette= */ (s) -> s.secondaryPalette, - /* tone= */ (s) -> s.isDark ? 30.0 : 60.0, - /* isBackground= */ false, - /* background= */ (s) -> widgetBackground(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 4.0, 5.0, 15.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(clockHour(), clockMinute(), 10.0, TonePolarity.DARKER, - false)); - } - - public DynamicColor clockMinute() { - return new DynamicColor( - /* name= */ "clock_minute", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> s.isDark ? 40.0 : 90.0, - /* isBackground= */ false, - /* background= */ (s) -> widgetBackground(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 6.5, 10.0, 15.0), - /* toneDeltaPair= */ null); - } - - public DynamicColor clockSecond() { - return new DynamicColor( - /* name= */ "clock_second", - /* palette= */ (s) -> s.tertiaryPalette, - /* tone= */ (s) -> s.isDark ? 40.0 : 90.0, - /* isBackground= */ false, - /* background= */ (s) -> widgetBackground(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 5.0, 70.0, 11.0), - /* toneDeltaPair= */ null); - } - - public DynamicColor weatherTemp() { - return new DynamicColor( - /* name= */ "clock_second", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> s.isDark ? 55.0 : 80.0, - /* isBackground= */ false, - /* background= */ (s) -> widgetBackground(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 5.0, 70.0, 11.0), - /* toneDeltaPair= */ null); - } - - // THEME APP ICONS - - public DynamicColor themeApp() { - return new DynamicColor( - /* name= */ "theme_app", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> s.isDark ? 90.0 : 30.0, // Adjusted values - /* isBackground= */ true, - /* background= */ null, - /* secondBackground= */ null, - /* contrastCurve= */ null, - /* toneDeltaPair= */ null); - } - - public DynamicColor onThemeApp() { - return new DynamicColor( - /* name= */ "on_theme_app", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> s.isDark ? 40.0 : 80.0, // Adjusted values - /* isBackground= */ false, - /* background= */ (s) -> themeApp(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 7.0, 10.0), - /* toneDeltaPair= */ null); - } - - public DynamicColor themeAppRing() { - return new DynamicColor( - /* name= */ "theme_app_ring", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> 70.0, - /* isBackground= */ true, - /* background= */ null, - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 1.0, 1.0, 1.0), - /* toneDeltaPair= */ null); - } - - public DynamicColor themeNotif() { - return new DynamicColor( - /* name= */ "theme_notif", - /* palette= */ (s) -> s.tertiaryPalette, - /* tone= */ (s) -> s.isDark ? 80.0 : 90.0, - /* isBackground= */ false, - /* background= */ (s) -> themeAppRing(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 1.0, 1.0, 1.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(themeNotif(), themeAppRing(), 10.0, TonePolarity.NEARER, - false)); - } - - // SUPER G COLORS - - public DynamicColor brandA() { - return new DynamicColor( - /* name= */ "brand_a", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> s.isDark ? 40.0 : 80.0, - /* isBackground= */ true, - /* background= */ (s) -> mMdc.surfaceContainerLow(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 7.0, 17.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(brandA(), brandB(), 10.0, TonePolarity.NEARER, false)); - } - - public DynamicColor brandB() { - return new DynamicColor( - /* name= */ "brand_b", - /* palette= */ (s) -> s.secondaryPalette, - /* tone= */ (s) -> s.isDark ? 70.0 : 98.0, - /* isBackground= */ true, - /* background= */ (s) -> mMdc.surfaceContainerLow(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 3.0, 6.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(brandB(), brandC(), 10.0, TonePolarity.NEARER, false)); - } - - public DynamicColor brandC() { - return new DynamicColor( - /* name= */ "brand_c", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> s.isDark ? 50.0 : 60.0, - /* isBackground= */ false, - /* background= */ (s) -> mMdc.surfaceContainerLow(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 4.0, 9.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(brandC(), brandD(), 10.0, TonePolarity.NEARER, false)); - } - - public DynamicColor brandD() { - return new DynamicColor( - /* name= */ "brand_d", - /* palette= */ (s) -> s.tertiaryPalette, - /* tone= */ (s) -> s.isDark ? 59.0 : 90.0, - /* isBackground= */ false, - /* background= */ (s) -> mMdc.surfaceContainerLow(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 4.0, 13.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(brandD(), brandA(), 10.0, TonePolarity.NEARER, false)); - } - - // QUICK SETTING TIILES - - public DynamicColor underSurface() { - return new DynamicColor( - /* name= */ "under_surface", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> 0.0, - /* isBackground= */ true, - /* background= */ null, - /* secondBackground= */ null, - /* contrastCurve= */ null, - /* toneDeltaPair= */ null); - } - - public DynamicColor shadeActive() { - return new DynamicColor( - /* name= */ "shade_active", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> 90.0, - /* isBackground= */ false, - /* background= */ (s) -> underSurface(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 4.5, 7.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(shadeActive(), shadeInactive(), 30.0, TonePolarity.LIGHTER, - false)); - } - - public DynamicColor onShadeActive() { - return new DynamicColor( - /* name= */ "on_shade_active", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> 10.0, - /* isBackground= */ false, - /* background= */ (s) -> shadeActive(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 4.5, 7.0, 11.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(onShadeActive(), onShadeActiveVariant(), 20.0, - TonePolarity.NEARER, false)); - } - - public DynamicColor onShadeActiveVariant() { - return new DynamicColor( - /* name= */ "on_shade_active_variant", - /* palette= */ (s) -> s.primaryPalette, - /* tone= */ (s) -> 30.0, - /* isBackground= */ false, - /* background= */ (s) -> shadeActive(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 4.5, 7.0, 11.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(onShadeActiveVariant(), onShadeActive(), 20.0, - TonePolarity.NEARER, false)); - } - - public DynamicColor shadeInactive() { - return new DynamicColor( - /* name= */ "shade_inactive", - /* palette= */ (s) -> s.neutralPalette, - /* tone= */ (s) -> 20.0, - /* isBackground= */ true, - /* background= */ (s) -> underSurface(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 1.0, 1.0, 1.0), - /* toneDeltaPair= */(s) -> new ToneDeltaPair(shadeInactive(), shadeDisabled(), 15.0, - TonePolarity.LIGHTER, false)); - } - - public DynamicColor onShadeInactive() { - return new DynamicColor( - /* name= */ "on_shade_inactive", - /* palette= */ (s) -> s.neutralVariantPalette, - /* tone= */ (s) -> 90.0, - /* isBackground= */ true, - /* background= */ (s) -> shadeInactive(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 4.5, 7.0, 11.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(onShadeInactive(), onShadeInactiveVariant(), 10.0, - TonePolarity.NEARER, false)); - } - - public DynamicColor onShadeInactiveVariant() { - return new DynamicColor( - /* name= */ "on_shade_inactive_variant", - /* palette= */ (s) -> s.neutralVariantPalette, - /* tone= */ (s) -> 80.0, - /* isBackground= */ false, - /* background= */ (s) -> shadeInactive(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 4.5, 7.0, 11.0), - /* toneDeltaPair= */ - (s) -> new ToneDeltaPair(onShadeInactiveVariant(), onShadeInactive(), 10.0, - TonePolarity.NEARER, false)); - } - - public DynamicColor shadeDisabled() { - return new DynamicColor( - /* name= */ "shade_disabled", - /* palette= */ (s) -> s.neutralPalette, - /* tone= */ (s) -> 4.0, - /* isBackground= */ false, - /* background= */ (s) -> underSurface(), - /* secondBackground= */ null, - /* contrastCurve= */ new ContrastCurve(1.0, 1.0, 1.0, 1.0), - /* toneDeltaPair= */ null); - } - - public DynamicColor overviewBackground() { - return new DynamicColor( - /* name= */ "overview_background", - /* palette= */ (s) -> s.neutralVariantPalette, - /* tone= */ (s) -> s.isDark ? 80.0 : 35.0, - /* isBackground= */ true, - /* background= */ null, - /* secondBackground= */ null, - /* contrastCurve= */null, - /* toneDeltaPair= */ null); - } -} diff --git a/packages/SystemUI/src/com/android/systemui/theme/DynamicColors.kt b/packages/SystemUI/src/com/android/systemui/theme/DynamicColors.kt index 35187597bd83..a983d2f9b78e 100644 --- a/packages/SystemUI/src/com/android/systemui/theme/DynamicColors.kt +++ b/packages/SystemUI/src/com/android/systemui/theme/DynamicColors.kt @@ -103,33 +103,5 @@ class DynamicColors { Pair.create("on_tertiary_fixed_variant", mdc.onTertiaryFixedVariant()), ) } - - @JvmStatic - fun getCustomColorsMapped(isExtendedFidelity: Boolean): List<Pair<String, DynamicColor>> { - val customMdc = CustomDynamicColors(isExtendedFidelity) - return arrayListOf( - Pair.create("widget_background", customMdc.widgetBackground()), - Pair.create("clock_hour", customMdc.clockHour()), - Pair.create("clock_minute", customMdc.clockMinute()), - Pair.create("clock_second", customMdc.weatherTemp()), - Pair.create("theme_app", customMdc.themeApp()), - Pair.create("on_theme_app", customMdc.onThemeApp()), - Pair.create("theme_app_ring", customMdc.themeAppRing()), - Pair.create("on_theme_app_ring", customMdc.themeNotif()), - Pair.create("brand_a", customMdc.brandA()), - Pair.create("brand_b", customMdc.brandB()), - Pair.create("brand_c", customMdc.brandC()), - Pair.create("brand_d", customMdc.brandD()), - Pair.create("under_surface", customMdc.underSurface()), - Pair.create("shade_active", customMdc.shadeActive()), - Pair.create("on_shade_active", customMdc.onShadeActive()), - Pair.create("on_shade_active_variant", customMdc.onShadeActiveVariant()), - Pair.create("shade_inactive", customMdc.shadeInactive()), - Pair.create("on_shade_inactive", customMdc.onShadeInactive()), - Pair.create("on_shade_inactive_variant", customMdc.onShadeInactiveVariant()), - Pair.create("shade_disabled", customMdc.shadeDisabled()), - Pair.create("overview_background", customMdc.overviewBackground()) - ) - } } } diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java index d256c4acd955..5c3bbb7ca253 100644 --- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java @@ -56,7 +56,6 @@ import android.text.TextUtils; import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; -import android.util.Pair; import android.util.SparseArray; import android.util.SparseIntArray; @@ -85,7 +84,6 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceP import com.android.systemui.util.kotlin.JavaAdapter; import com.android.systemui.util.settings.SecureSettings; -import com.google.ux.material.libmonet.dynamiccolor.DynamicColor; import com.google.ux.material.libmonet.dynamiccolor.MaterialDynamicColors; import org.json.JSONException; @@ -633,33 +631,29 @@ public class ThemeOverlayController implements CoreStartable, Dumpable { protected FabricatedOverlay createDynamicOverlay() { FabricatedOverlay overlay = newFabricatedOverlay("dynamic"); - //Themed Colors - assignColorsToOverlay(overlay, DynamicColors.allDynamicColorsMapped(mIsFidelityEnabled), - false); - // Fixed Colors - assignColorsToOverlay(overlay, DynamicColors.getFixedColorsMapped(mIsFidelityEnabled), - true); - //Custom Colors - assignColorsToOverlay(overlay, DynamicColors.getCustomColorsMapped(mIsFidelityEnabled), - false); + assignDynamicPaletteToOverlay(overlay, true /* isDark */); + assignDynamicPaletteToOverlay(overlay, false /* isDark */); + assignFixedColorsToOverlay(overlay); return overlay; } - private void assignColorsToOverlay(FabricatedOverlay overlay, - List<Pair<String, DynamicColor>> colors, Boolean isFixed) { - colors.forEach(p -> { - String prefix = "android:color/system_" + p.first; - - if (isFixed) { - overlay.setResourceValue(prefix, TYPE_INT_COLOR_ARGB8, - p.second.getArgb(mLightColorScheme.getMaterialScheme()), null); - return; - } + private void assignDynamicPaletteToOverlay(FabricatedOverlay overlay, boolean isDark) { + String suffix = isDark ? "dark" : "light"; + ColorScheme scheme = isDark ? mDarkColorScheme : mLightColorScheme; + DynamicColors.allDynamicColorsMapped(mIsFidelityEnabled).forEach(p -> { + String resourceName = "android:color/system_" + p.first + "_" + suffix; + int colorValue = p.second.getArgb(scheme.getMaterialScheme()); + overlay.setResourceValue(resourceName, TYPE_INT_COLOR_ARGB8, colorValue, + null /* configuration */); + }); + } - overlay.setResourceValue(prefix + "_light", TYPE_INT_COLOR_ARGB8, - p.second.getArgb(mLightColorScheme.getMaterialScheme()), null); - overlay.setResourceValue(prefix + "_dark", TYPE_INT_COLOR_ARGB8, - p.second.getArgb(mDarkColorScheme.getMaterialScheme()), null); + private void assignFixedColorsToOverlay(FabricatedOverlay overlay) { + DynamicColors.getFixedColorsMapped(mIsFidelityEnabled).forEach(p -> { + String resourceName = "android:color/system_" + p.first; + int colorValue = p.second.getArgb(mLightColorScheme.getMaterialScheme()); + overlay.setResourceValue(resourceName, TYPE_INT_COLOR_ARGB8, colorValue, + null /* configuration */); }); } diff --git a/packages/SystemUI/src/com/android/systemui/util/kotlin/BooleanFlowOperators.kt b/packages/SystemUI/src/com/android/systemui/util/kotlin/BooleanFlowOperators.kt index b3008856d370..a2759c6bf470 100644 --- a/packages/SystemUI/src/com/android/systemui/util/kotlin/BooleanFlowOperators.kt +++ b/packages/SystemUI/src/com/android/systemui/util/kotlin/BooleanFlowOperators.kt @@ -28,11 +28,23 @@ object BooleanFlowOperators { * * Usage: * ``` - * val result = and(flow1, flow2) + * val result = allOf(flow1, flow2) * ``` */ - fun and(vararg flows: Flow<Boolean>): Flow<Boolean> = - combine(flows.asIterable()) { values -> values.all { it } }.distinctUntilChanged() + fun allOf(vararg flows: Flow<Boolean>): Flow<Boolean> = flows.asIterable().all() + + /** + * Logical AND operator for boolean flows. Will collect all flows and [combine] them to + * determine the result. + */ + fun Array<Flow<Boolean>>.all(): Flow<Boolean> = allOf(*this) + + /** + * Logical AND operator for boolean flows. Will collect all flows and [combine] them to + * determine the result. + */ + fun Iterable<Flow<Boolean>>.all(): Flow<Boolean> = + combine(this) { values -> values.all { it } }.distinctUntilChanged() /** * Logical NOT operator for a boolean flow. @@ -48,6 +60,36 @@ object BooleanFlowOperators { * Logical OR operator for a boolean flow. Will collect all flows and [combine] them to * determine the result. */ - fun or(vararg flows: Flow<Boolean>): Flow<Boolean> = - combine(flows.asIterable()) { values -> values.any { it } }.distinctUntilChanged() + fun anyOf(vararg flows: Flow<Boolean>): Flow<Boolean> = flows.asIterable().any() + + /** + * Logical OR operator for a boolean flow. Will collect all flows and [combine] them to + * determine the result. + */ + fun Array<Flow<Boolean>>.any(): Flow<Boolean> = anyOf(*this) + + /** + * Logical OR operator for a boolean flow. Will collect all flows and [combine] them to + * determine the result. + */ + fun Iterable<Flow<Boolean>>.any(): Flow<Boolean> = + combine(this) { values -> values.any { it } }.distinctUntilChanged() + + /** + * Returns a Flow that produces `true` when all input flows are producing `false`, otherwise + * produces `false`. + */ + fun noneOf(vararg flows: Flow<Boolean>): Flow<Boolean> = not(anyOf(*flows)) + + /** + * Returns a Flow that produces `true` when all input flows are producing `false`, otherwise + * produces `false`. + */ + fun Array<Flow<Boolean>>.none(): Flow<Boolean> = noneOf(*this) + + /** + * Returns a Flow that produces `true` when all input flows are producing `false`, otherwise + * produces `false`. + */ + fun Iterable<Flow<Boolean>>.none(): Flow<Boolean> = not(any()) } diff --git a/packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.kt b/packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.kt index 85cc88dd5283..9f0e67b60c29 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.kt @@ -15,13 +15,11 @@ */ package com.android.systemui.monet +import androidx.test.filters.SmallTest import android.testing.AndroidTestingRunner import android.util.Log -import android.util.Pair -import androidx.test.filters.SmallTest import com.android.systemui.SysuiTestCase import com.android.systemui.theme.DynamicColors -import com.google.ux.material.libmonet.dynamiccolor.DynamicColor import com.google.ux.material.libmonet.hct.Hct import com.google.ux.material.libmonet.scheme.SchemeTonalSpot import java.io.File @@ -83,10 +81,6 @@ private fun commentShade(paletteName: String, tone: Int): String { @SmallTest @RunWith(AndroidTestingRunner::class) class ColorSchemeTest : SysuiTestCase() { - private val defaultContrast = 0.0 - private val defaultIsDark = false - private val defaultIsFidelity = false - @Test fun generateThemeStyles() { val document = buildDoc<Any>() @@ -113,7 +107,7 @@ class ColorSchemeTest : SysuiTestCase() { } val style = document.createElement(styleValue.name.lowercase()) - val colorScheme = ColorScheme(sourceColor.toInt(), defaultIsDark, styleValue) + val colorScheme = ColorScheme(sourceColor.toInt(), false, styleValue) style.appendChild( document.createTextNode( @@ -145,7 +139,7 @@ class ColorSchemeTest : SysuiTestCase() { document.appendWithBreak(resources) // shade colors - val colorScheme = ColorScheme(GOOGLE_BLUE, defaultIsDark) + val colorScheme = ColorScheme(GOOGLE_BLUE, false) arrayOf( Triple("accent1", "Primary", colorScheme.accent1), Triple("accent2", "Secondary", colorScheme.accent2), @@ -168,35 +162,24 @@ class ColorSchemeTest : SysuiTestCase() { resources.appendWithBreak(document.createComment(commentRoles), 2) - fun generateDynamic(pairs: List<Pair<String, DynamicColor>>) { - arrayOf(false, true).forEach { isDark -> - val suffix = if (isDark) "_dark" else "_light" - val dynamicScheme = - SchemeTonalSpot(Hct.fromInt(GOOGLE_BLUE), isDark, defaultContrast) - pairs.forEach { - resources.createColorEntry( - "system_${it.first}$suffix", - it.second.getArgb(dynamicScheme) - ) - } + // dynamic colors + arrayOf(false, true).forEach { isDark -> + val suffix = if (isDark) "_dark" else "_light" + val dynamicScheme = SchemeTonalSpot(Hct.fromInt(GOOGLE_BLUE), isDark, 0.5) + DynamicColors.allDynamicColorsMapped(false).forEach { + resources.createColorEntry( + "system_${it.first}$suffix", + it.second.getArgb(dynamicScheme) + ) } } - // dynamic colors - generateDynamic(DynamicColors.allDynamicColorsMapped(defaultIsFidelity)) - // fixed colors - val dynamicScheme = - SchemeTonalSpot(Hct.fromInt(GOOGLE_BLUE), defaultIsDark, defaultContrast) - DynamicColors.getFixedColorsMapped(defaultIsFidelity).forEach { + val dynamicScheme = SchemeTonalSpot(Hct.fromInt(GOOGLE_BLUE), false, 0.5) + DynamicColors.getFixedColorsMapped(false).forEach { resources.createColorEntry("system_${it.first}", it.second.getArgb(dynamicScheme)) } - resources.appendWithBreak(document.createComment(commentRoles), 2) - - // custom colors - generateDynamic(DynamicColors.getCustomColorsMapped(defaultIsFidelity)) - saveFile(document, "role_values.xml") } diff --git a/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java index a5e7a67b21a2..ed7c9568a9db 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java @@ -995,11 +995,9 @@ public class ThemeOverlayControllerTest extends SysuiTestCase { .setResourceValue(any(String.class), eq(TYPE_INT_COLOR_ARGB8), anyInt(), eq(null)); // All dynamic colors were added twice: light and dark them // All fixed colors were added once - // All custom dynamic tokens added twice verify(dynamic, times( DynamicColors.allDynamicColorsMapped(false).size() * 2 - + DynamicColors.getFixedColorsMapped(false).size() - + DynamicColors.getCustomColorsMapped(false).size() * 2) + + DynamicColors.getFixedColorsMapped(false).size()) ).setResourceValue(any(String.class), eq(TYPE_INT_COLOR_ARGB8), anyInt(), eq(null)); } } diff --git a/services/core/java/com/android/server/biometrics/BiometricDanglingReceiver.java b/services/core/java/com/android/server/biometrics/BiometricDanglingReceiver.java new file mode 100644 index 000000000000..3e8acee26e81 --- /dev/null +++ b/services/core/java/com/android/server/biometrics/BiometricDanglingReceiver.java @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2024 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.server.biometrics; + +import static android.content.Intent.ACTION_CLOSE_SYSTEM_DIALOGS; + +import android.annotation.NonNull; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.hardware.biometrics.BiometricsProtoEnums; +import android.provider.Settings; +import android.util.Slog; + +import com.android.server.biometrics.sensors.BiometricNotificationUtils; + +/** + * Receives broadcast to biometrics dangling notification. + */ +public class BiometricDanglingReceiver extends BroadcastReceiver { + private static final String TAG = "BiometricDanglingReceiver"; + + public static final String ACTION_FINGERPRINT_RE_ENROLL_LAUNCH = + "action_fingerprint_re_enroll_launch"; + public static final String ACTION_FINGERPRINT_RE_ENROLL_DISMISS = + "action_fingerprint_re_enroll_dismiss"; + + public static final String ACTION_FACE_RE_ENROLL_LAUNCH = + "action_face_re_enroll_launch"; + public static final String ACTION_FACE_RE_ENROLL_DISMISS = + "action_face_re_enroll_dismiss"; + + public static final String FACE_SETTINGS_ACTION = "android.settings.FACE_SETTINGS"; + + private static final String SETTINGS_PACKAGE = "com.android.settings"; + + /** + * Constructor for BiometricDanglingReceiver. + * + * @param context context + * @param modality the value from BiometricsProtoEnums.MODALITY_* + */ + public BiometricDanglingReceiver(@NonNull Context context, int modality) { + final IntentFilter intentFilter = new IntentFilter(); + if (modality == BiometricsProtoEnums.MODALITY_FINGERPRINT) { + intentFilter.addAction(ACTION_FINGERPRINT_RE_ENROLL_LAUNCH); + intentFilter.addAction(ACTION_FINGERPRINT_RE_ENROLL_DISMISS); + } else if (modality == BiometricsProtoEnums.MODALITY_FACE) { + intentFilter.addAction(ACTION_FACE_RE_ENROLL_LAUNCH); + intentFilter.addAction(ACTION_FACE_RE_ENROLL_DISMISS); + } + context.registerReceiver(this, intentFilter); + } + + @Override + public void onReceive(Context context, Intent intent) { + Slog.d(TAG, "Received: " + intent.getAction()); + if (ACTION_FINGERPRINT_RE_ENROLL_LAUNCH.equals(intent.getAction())) { + launchBiometricEnrollActivity(context, Settings.ACTION_FINGERPRINT_ENROLL); + BiometricNotificationUtils.cancelFingerprintReEnrollNotification(context); + } else if (ACTION_FINGERPRINT_RE_ENROLL_DISMISS.equals(intent.getAction())) { + BiometricNotificationUtils.cancelFingerprintReEnrollNotification(context); + } else if (ACTION_FACE_RE_ENROLL_LAUNCH.equals(intent.getAction())) { + launchBiometricEnrollActivity(context, FACE_SETTINGS_ACTION); + BiometricNotificationUtils.cancelFaceReEnrollNotification(context); + } else if (ACTION_FACE_RE_ENROLL_DISMISS.equals(intent.getAction())) { + BiometricNotificationUtils.cancelFaceReEnrollNotification(context); + } + context.unregisterReceiver(this); + } + + private void launchBiometricEnrollActivity(Context context, String action) { + context.sendBroadcast(new Intent(ACTION_CLOSE_SYSTEM_DIALOGS)); + final Intent intent = new Intent(action); + intent.setPackage(SETTINGS_PACKAGE); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(intent); + } +} diff --git a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java index 0e22f7511af9..eaa5e2a6befb 100644 --- a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java +++ b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java @@ -24,13 +24,18 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.hardware.biometrics.BiometricManager; +import android.hardware.biometrics.BiometricsProtoEnums; import android.hardware.face.FaceEnrollOptions; import android.hardware.fingerprint.FingerprintEnrollOptions; import android.os.SystemClock; import android.os.UserHandle; +import android.text.BidiFormatter; import android.util.Slog; import com.android.internal.R; +import com.android.server.biometrics.BiometricDanglingReceiver; + +import java.util.List; /** * Biometric notification helper class. @@ -39,6 +44,7 @@ public class BiometricNotificationUtils { private static final String TAG = "BiometricNotificationUtils"; private static final String FACE_RE_ENROLL_NOTIFICATION_TAG = "FaceReEnroll"; + private static final String FINGERPRINT_RE_ENROLL_NOTIFICATION_TAG = "FingerprintReEnroll"; private static final String BAD_CALIBRATION_NOTIFICATION_TAG = "FingerprintBadCalibration"; private static final String KEY_RE_ENROLL_FACE = "re_enroll_face_unlock"; private static final String FACE_SETTINGS_ACTION = "android.settings.FACE_SETTINGS"; @@ -50,6 +56,8 @@ public class BiometricNotificationUtils { private static final String FACE_ENROLL_CHANNEL = "FaceEnrollNotificationChannel"; private static final String FACE_RE_ENROLL_CHANNEL = "FaceReEnrollNotificationChannel"; private static final String FINGERPRINT_ENROLL_CHANNEL = "FingerprintEnrollNotificationChannel"; + private static final String FINGERPRINT_RE_ENROLL_CHANNEL = + "FingerprintReEnrollNotificationChannel"; private static final String FINGERPRINT_BAD_CALIBRATION_CHANNEL = "FingerprintBadCalibrationNotificationChannel"; private static final long NOTIFICATION_INTERVAL_MS = 24 * 60 * 60 * 1000; @@ -177,10 +185,124 @@ public class BiometricNotificationUtils { BAD_CALIBRATION_NOTIFICATION_TAG, Notification.VISIBILITY_SECRET, false); } + /** + * Shows a biometric re-enroll notification. + */ + public static void showBiometricReEnrollNotification(@NonNull Context context, + @NonNull List<String> identifiers, boolean allIdentifiersDeleted, int modality) { + final boolean isFingerprint = modality == BiometricsProtoEnums.MODALITY_FINGERPRINT; + final String reEnrollName = isFingerprint ? FINGERPRINT_RE_ENROLL_NOTIFICATION_TAG + : FACE_RE_ENROLL_NOTIFICATION_TAG; + if (identifiers.isEmpty()) { + Slog.v(TAG, "Skipping " + reEnrollName + " notification : empty list"); + return; + } + Slog.d(TAG, "Showing " + reEnrollName + " notification :[" + identifiers.size() + + " identifier(s) deleted, allIdentifiersDeleted=" + allIdentifiersDeleted + "]"); + + final String name = + context.getString(R.string.device_unlock_notification_name); + final String title = context.getString(isFingerprint + ? R.string.fingerprint_dangling_notification_title + : R.string.face_dangling_notification_title); + final String content = isFingerprint + ? getFingerprintDanglingContentString(context, identifiers, allIdentifiersDeleted) + : context.getString(R.string.face_dangling_notification_msg); + + // Create "Set up" notification action button. + final Intent setupIntent = new Intent( + isFingerprint ? BiometricDanglingReceiver.ACTION_FINGERPRINT_RE_ENROLL_LAUNCH + : BiometricDanglingReceiver.ACTION_FACE_RE_ENROLL_LAUNCH); + final PendingIntent setupPendingIntent = PendingIntent.getBroadcastAsUser(context, 0, + setupIntent, PendingIntent.FLAG_IMMUTABLE, UserHandle.CURRENT); + final String setupText = + context.getString(R.string.biometric_dangling_notification_action_set_up); + final Notification.Action setupAction = new Notification.Action.Builder( + null, setupText, setupPendingIntent).build(); + + // Create "Not now" notification action button. + final Intent notNowIntent = new Intent( + isFingerprint ? BiometricDanglingReceiver.ACTION_FINGERPRINT_RE_ENROLL_DISMISS + : BiometricDanglingReceiver.ACTION_FACE_RE_ENROLL_DISMISS); + final PendingIntent notNowPendingIntent = PendingIntent.getBroadcastAsUser(context, 0, + notNowIntent, PendingIntent.FLAG_IMMUTABLE, UserHandle.CURRENT); + final String notNowText = context.getString( + R.string.biometric_dangling_notification_action_not_now); + final Notification.Action notNowAction = new Notification.Action.Builder( + null, notNowText, notNowPendingIntent).build(); + + final String channel = isFingerprint ? FINGERPRINT_RE_ENROLL_CHANNEL + : FACE_RE_ENROLL_CHANNEL; + final String tag = isFingerprint ? FINGERPRINT_RE_ENROLL_NOTIFICATION_TAG + : FACE_RE_ENROLL_NOTIFICATION_TAG; + + showNotificationHelper(context, name, title, content, setupPendingIntent, setupAction, + notNowAction, Notification.CATEGORY_SYSTEM, channel, tag, + Notification.VISIBILITY_SECRET, false); + } + + private static String getFingerprintDanglingContentString(Context context, + @NonNull List<String> fingerprints, boolean allFingerprintDeleted) { + if (fingerprints.isEmpty()) { + return null; + } + + final int resId; + final int size = fingerprints.size(); + final StringBuilder first = new StringBuilder(); + final BidiFormatter bidiFormatter = BidiFormatter.getInstance(); + if (size > 1) { + // If there are more than 1 fingerprint deleted, the "second" will be the last + // fingerprint and set the others to "first". + // For example, if we have 3 fingerprints deleted(fp1, fp2 and fp3): + // first = "fp1, fp2" + // second = "fp3" + final String separator = ", "; + String second = null; + for (int i = 0; i < size; i++) { + if (i == size - 1) { + second = bidiFormatter.unicodeWrap("\"" + fingerprints.get(i) + "\""); + } else { + first.append(bidiFormatter.unicodeWrap("\"")); + first.append(bidiFormatter.unicodeWrap(fingerprints.get(i))); + first.append(bidiFormatter.unicodeWrap("\"")); + if (i < size - 2) { + first.append(bidiFormatter.unicodeWrap(separator)); + } + } + } + if (allFingerprintDeleted) { + resId = R.string.fingerprint_dangling_notification_msg_all_deleted_2; + } else { + resId = R.string.fingerprint_dangling_notification_msg_2; + } + + return String.format(context.getString(resId), first, second); + } else { + if (allFingerprintDeleted) { + resId = R.string.fingerprint_dangling_notification_msg_all_deleted_1; + } else { + resId = R.string.fingerprint_dangling_notification_msg_1; + } + first.append(bidiFormatter.unicodeWrap("\"")); + first.append(bidiFormatter.unicodeWrap(fingerprints.get(0))); + first.append(bidiFormatter.unicodeWrap("\"")); + return String.format(context.getString(resId), first); + } + } + + private static void showNotificationHelper(Context context, String name, String title, + String content, PendingIntent pendingIntent, String category, String channelName, + String notificationTag, int visibility, boolean listenToDismissEvent) { + showNotificationHelper(context, name, title, content, pendingIntent, + null /* positiveAction */, null /* negativeAction */, category, channelName, + notificationTag, visibility, listenToDismissEvent); + } + private static void showNotificationHelper(Context context, String name, String title, - String content, PendingIntent pendingIntent, String category, - String channelName, String notificationTag, int visibility, - boolean listenToDismissEvent) { + String content, PendingIntent pendingIntent, Notification.Action positiveAction, + Notification.Action negativeAction, String category, String channelName, + String notificationTag, int visibility, boolean listenToDismissEvent) { Slog.v(TAG," listenToDismissEvent = " + listenToDismissEvent); final PendingIntent dismissIntent = PendingIntent.getActivityAsUser(context, 0 /* requestCode */, DISMISS_FRR_INTENT, PendingIntent.FLAG_IMMUTABLE /* flags */, @@ -202,6 +324,12 @@ public class BiometricNotificationUtils { .setContentIntent(pendingIntent) .setVisibility(visibility); + if (positiveAction != null) { + builder.addAction(positiveAction); + } + if (negativeAction != null) { + builder.addAction(negativeAction); + } if (listenToDismissEvent) { builder.setDeleteIntent(dismissIntent); } @@ -253,4 +381,14 @@ public class BiometricNotificationUtils { UserHandle.CURRENT); } + /** + * Cancels a fingerprint enrollment notification + */ + public static void cancelFingerprintReEnrollNotification(@NonNull Context context) { + final NotificationManager notificationManager = + context.getSystemService(NotificationManager.class); + notificationManager.cancelAsUser(FINGERPRINT_RE_ENROLL_NOTIFICATION_TAG, NOTIFICATION_ID, + UserHandle.CURRENT); + } + } diff --git a/services/core/java/com/android/server/biometrics/sensors/InternalEnumerateClient.java b/services/core/java/com/android/server/biometrics/sensors/InternalEnumerateClient.java index 6daaad1baf83..81ab26dd581e 100644 --- a/services/core/java/com/android/server/biometrics/sensors/InternalEnumerateClient.java +++ b/services/core/java/com/android/server/biometrics/sensors/InternalEnumerateClient.java @@ -22,6 +22,7 @@ import android.hardware.biometrics.BiometricAuthenticator; import android.os.IBinder; import android.util.Slog; +import com.android.internal.annotations.VisibleForTesting; import com.android.server.biometrics.BiometricsProto; import com.android.server.biometrics.log.BiometricContext; import com.android.server.biometrics.log.BiometricLogger; @@ -44,6 +45,7 @@ public abstract class InternalEnumerateClient<T> extends HalClientMonitor<T> private List<? extends BiometricAuthenticator.Identifier> mEnrolledList; // List of templates to remove from the HAL private List<BiometricAuthenticator.Identifier> mUnknownHALTemplates = new ArrayList<>(); + private final int mInitialEnrolledSize; protected InternalEnumerateClient(@NonNull Context context, @NonNull Supplier<T> lazyDaemon, @NonNull IBinder token, int userId, @NonNull String owner, @@ -55,6 +57,7 @@ public abstract class InternalEnumerateClient<T> extends HalClientMonitor<T> super(context, lazyDaemon, token, null /* ClientMonitorCallbackConverter */, userId, owner, 0 /* cookie */, sensorId, logger, biometricContext); mEnrolledList = enrolledList; + mInitialEnrolledSize = mEnrolledList.size(); mUtils = utils; } @@ -111,8 +114,10 @@ public abstract class InternalEnumerateClient<T> extends HalClientMonitor<T> // At this point, mEnrolledList only contains templates known to the framework and // not the HAL. + final List<String> names = new ArrayList<>(); for (int i = 0; i < mEnrolledList.size(); i++) { BiometricAuthenticator.Identifier identifier = mEnrolledList.get(i); + names.add(identifier.getName().toString()); Slog.e(TAG, "doTemplateCleanup(): Removing dangling template from framework: " + identifier.getBiometricId() + " " + identifier.getName()); mUtils.removeBiometricForUser(getContext(), @@ -120,6 +125,11 @@ public abstract class InternalEnumerateClient<T> extends HalClientMonitor<T> getLogger().logUnknownEnrollmentInFramework(); } + + // Send dangling notification. + if (!names.isEmpty()) { + sendDanglingNotification(names); + } mEnrolledList.clear(); } @@ -127,8 +137,24 @@ public abstract class InternalEnumerateClient<T> extends HalClientMonitor<T> return mUnknownHALTemplates; } + /** + * Send the dangling notification. + */ + @VisibleForTesting + public void sendDanglingNotification(@NonNull List<String> identifierNames) { + if (!identifierNames.isEmpty()) { + Slog.e(TAG, "sendDanglingNotification(): initial enrolledSize=" + + mInitialEnrolledSize + ", after clean up size=" + mEnrolledList.size()); + final boolean allIdentifiersDeleted = mEnrolledList.size() == mInitialEnrolledSize; + BiometricNotificationUtils.showBiometricReEnrollNotification( + getContext(), identifierNames, allIdentifiersDeleted, getModality()); + } + } + @Override public int getProtoEnum() { return BiometricsProto.CM_ENUMERATE; } + + protected abstract int getModality(); } diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClient.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClient.java index d85455e0e76b..6ce3bc59eb56 100644 --- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClient.java +++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClient.java @@ -18,12 +18,14 @@ package com.android.server.biometrics.sensors.face.aidl; import android.annotation.NonNull; import android.content.Context; +import android.hardware.biometrics.BiometricsProtoEnums; import android.hardware.biometrics.face.IFace; import android.hardware.face.Face; import android.os.IBinder; import android.os.RemoteException; import android.util.Slog; +import com.android.internal.annotations.VisibleForTesting; import com.android.server.biometrics.log.BiometricContext; import com.android.server.biometrics.log.BiometricLogger; import com.android.server.biometrics.sensors.BiometricUtils; @@ -35,7 +37,8 @@ import java.util.function.Supplier; /** * Face-specific internal enumerate client for the {@link IFace} AIDL HAL interface. */ -class FaceInternalEnumerateClient extends InternalEnumerateClient<AidlSession> { +@VisibleForTesting +public class FaceInternalEnumerateClient extends InternalEnumerateClient<AidlSession> { private static final String TAG = "FaceInternalEnumerateClient"; FaceInternalEnumerateClient(@NonNull Context context, @@ -56,4 +59,9 @@ class FaceInternalEnumerateClient extends InternalEnumerateClient<AidlSession> { mCallback.onClientFinished(this, false /* success */); } } + + @Override + protected int getModality() { + return BiometricsProtoEnums.MODALITY_FACE; + } } diff --git a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java index e71cffe0b8c5..f0a418951505 100644 --- a/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java +++ b/services/core/java/com/android/server/biometrics/sensors/face/aidl/FaceProvider.java @@ -52,6 +52,7 @@ import android.view.Surface; import com.android.internal.annotations.VisibleForTesting; import com.android.server.biometrics.AuthenticationStatsBroadcastReceiver; import com.android.server.biometrics.AuthenticationStatsCollector; +import com.android.server.biometrics.BiometricDanglingReceiver; import com.android.server.biometrics.BiometricHandlerProvider; import com.android.server.biometrics.Utils; import com.android.server.biometrics.log.BiometricContext; @@ -201,6 +202,7 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { mBiometricHandlerProvider = biometricHandlerProvider; initAuthenticationBroadcastReceiver(); + initFaceDanglingBroadcastReceiver(); initSensors(resetLockoutRequiresChallenge, props); } @@ -214,6 +216,10 @@ public class FaceProvider implements IBinder.DeathRecipient, ServiceProvider { }); } + private void initFaceDanglingBroadcastReceiver() { + new BiometricDanglingReceiver(mContext, BiometricsProtoEnums.MODALITY_FACE); + } + private void initSensors(boolean resetLockoutRequiresChallenge, SensorProps[] props) { if (resetLockoutRequiresChallenge) { Slog.d(getTag(), "Adding HIDL configs"); diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClient.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClient.java index a5a832aaaf59..2849bd9c92a3 100644 --- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClient.java +++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClient.java @@ -18,11 +18,13 @@ package com.android.server.biometrics.sensors.fingerprint.aidl; import android.annotation.NonNull; import android.content.Context; +import android.hardware.biometrics.BiometricsProtoEnums; import android.hardware.fingerprint.Fingerprint; import android.os.IBinder; import android.os.RemoteException; import android.util.Slog; +import com.android.internal.annotations.VisibleForTesting; import com.android.server.biometrics.log.BiometricContext; import com.android.server.biometrics.log.BiometricLogger; import com.android.server.biometrics.sensors.BiometricUtils; @@ -35,7 +37,8 @@ import java.util.function.Supplier; * Fingerprint-specific internal client supporting the * {@link android.hardware.biometrics.fingerprint.IFingerprint} AIDL interface. */ -class FingerprintInternalEnumerateClient extends InternalEnumerateClient<AidlSession> { +@VisibleForTesting +public class FingerprintInternalEnumerateClient extends InternalEnumerateClient<AidlSession> { private static final String TAG = "FingerprintInternalEnumerateClient"; protected FingerprintInternalEnumerateClient(@NonNull Context context, @@ -56,4 +59,9 @@ class FingerprintInternalEnumerateClient extends InternalEnumerateClient<AidlSes mCallback.onClientFinished(this, false /* success */); } } + + @Override + protected int getModality() { + return BiometricsProtoEnums.MODALITY_FINGERPRINT; + } } diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java index 6874c71267fb..c0dcd4943260 100644 --- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java +++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java @@ -58,6 +58,7 @@ import android.util.proto.ProtoOutputStream; import com.android.internal.annotations.VisibleForTesting; import com.android.server.biometrics.AuthenticationStatsBroadcastReceiver; import com.android.server.biometrics.AuthenticationStatsCollector; +import com.android.server.biometrics.BiometricDanglingReceiver; import com.android.server.biometrics.BiometricHandlerProvider; import com.android.server.biometrics.Flags; import com.android.server.biometrics.Utils; @@ -205,6 +206,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi mBiometricHandlerProvider = biometricHandlerProvider; initAuthenticationBroadcastReceiver(); + initFingerprintDanglingBroadcastReceiver(); initSensors(resetLockoutRequiresHardwareAuthToken, props, gestureAvailabilityDispatcher); } @@ -218,6 +220,10 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi }); } + private void initFingerprintDanglingBroadcastReceiver() { + new BiometricDanglingReceiver(mContext, BiometricsProtoEnums.MODALITY_FINGERPRINT); + } + private void initSensors(boolean resetLockoutRequiresHardwareAuthToken, SensorProps[] props, GestureAvailabilityDispatcher gestureAvailabilityDispatcher) { if (!resetLockoutRequiresHardwareAuthToken) { diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java index 573116105dea..d6d134d892f5 100644 --- a/services/core/java/com/android/server/location/contexthub/ContextHubService.java +++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java @@ -78,10 +78,14 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; +import java.util.PriorityQueue; +import java.util.Random; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ScheduledThreadPoolExecutor; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; /** @@ -152,6 +156,16 @@ public class ContextHubService extends IContextHubService.Stub { private final ScheduledThreadPoolExecutor mDailyMetricTimer = new ScheduledThreadPoolExecutor(1); + // A queue of reliable message records for duplicate detection + private final PriorityQueue<ReliableMessageRecord> mReliableMessageRecordQueue = + new PriorityQueue<ReliableMessageRecord>( + (ReliableMessageRecord left, ReliableMessageRecord right) -> { + return Long.compare(left.getTimestamp(), right.getTimestamp()); + }); + + // The test mode manager that manages behaviors during test mode. + private final TestModeManager mTestModeManager = new TestModeManager(); + // The period of the recurring time private static final int PERIOD_METRIC_QUERY_DAYS = 1; @@ -164,6 +178,9 @@ public class ContextHubService extends IContextHubService.Stub { private boolean mIsBtScanningEnabled = false; private boolean mIsBtMainEnabled = false; + // True if test mode is enabled for the Context Hub + private AtomicBoolean mIsTestModeEnabled = new AtomicBoolean(false); + // A hashmap used to record if a contexthub is waiting for daily query private Set<Integer> mMetricQueryPendingContextHubIds = Collections.newSetFromMap(new ConcurrentHashMap<Integer, Boolean>()); @@ -210,8 +227,17 @@ public class ContextHubService extends IContextHubService.Stub { @Override public void handleNanoappMessage(short hostEndpointId, NanoAppMessage message, List<String> nanoappPermissions, List<String> messagePermissions) { - handleClientMessageCallback(mContextHubId, hostEndpointId, message, nanoappPermissions, - messagePermissions); + if (Flags.reliableMessageImplementation() + && Flags.reliableMessageTestModeBehavior() + && mIsTestModeEnabled.get() + && mTestModeManager.handleNanoappMessage(mContextHubId, hostEndpointId, + message, nanoappPermissions, messagePermissions)) { + // The TestModeManager handled the nanoapp message, so return here. + return; + } + + handleClientMessageCallback(mContextHubId, hostEndpointId, message, + nanoappPermissions, messagePermissions); } @Override @@ -228,6 +254,106 @@ public class ContextHubService extends IContextHubService.Stub { } } + /** + * Records a reliable message from a nanoapp for duplicate detection. + */ + private static class ReliableMessageRecord { + public static final int TIMEOUT_NS = 1000000000; + + public int mContextHubId; + public long mTimestamp; + public int mMessageSequenceNumber; + byte mErrorCode; + + ReliableMessageRecord(int contextHubId, long timestamp, + int messageSequenceNumber, byte errorCode) { + mContextHubId = contextHubId; + mTimestamp = timestamp; + mMessageSequenceNumber = messageSequenceNumber; + mErrorCode = errorCode; + } + + public int getContextHubId() { + return mContextHubId; + } + + public long getTimestamp() { + return mTimestamp; + } + + public int getMessageSequenceNumber() { + return mMessageSequenceNumber; + } + + public byte getErrorCode() { + return mErrorCode; + } + + public void setErrorCode(byte errorCode) { + mErrorCode = errorCode; + } + + public boolean isExpired() { + return mTimestamp + TIMEOUT_NS < SystemClock.elapsedRealtimeNanos(); + } + } + + /** + * A class to manage behaviors during test mode. This is used for testing. + */ + private class TestModeManager { + /** + * Probability (in percent) of duplicating a message. + */ + private static final int MESSAGE_DUPLICATION_PROBABILITY_PERCENT = 50; + + /** + * The number of total messages to send when the duplicate event happens. + */ + private static final int NUM_MESSAGES_TO_DUPLICATE = 3; + + /** + * A probability percent for a certain event. + */ + private static final int MAX_PROBABILITY_PERCENT = 100; + + /** + * Random number generator. + */ + private Random mRandom = new Random(); + + /** + * @see ContextHubServiceCallback.handleNanoappMessage + * @return whether the message was handled + */ + public boolean handleNanoappMessage(int contextHubId, + short hostEndpointId, NanoAppMessage message, + List<String> nanoappPermissions, List<String> messagePermissions) { + if (!message.isReliable()) { + return false; + } + + if (didEventHappen(MESSAGE_DUPLICATION_PROBABILITY_PERCENT)) { + for (int i = 0; i < NUM_MESSAGES_TO_DUPLICATE; ++i) { + handleClientMessageCallback(contextHubId, hostEndpointId, + message, nanoappPermissions, messagePermissions); + } + return true; + } + return false; + } + + /** + * Returns true if the event with percentPercent did happen. + * + * @param probabilityPercent the percent probability of the event. + * @return true if the event happened, false otherwise. + */ + private boolean didEventHappen(int probabilityPercent) { + return mRandom.nextInt(MAX_PROBABILITY_PERCENT) < probabilityPercent; + } + } + public ContextHubService(Context context, IContextHubWrapper contextHubWrapper) { Log.i(TAG, "Starting Context Hub Service init"); mContext = context; @@ -563,6 +689,8 @@ public class ContextHubService extends IContextHubService.Stub { * Resets the settings. Called when a context hub restarts or the AIDL HAL dies */ private void resetSettings() { + mIsTestModeEnabled.set(false); + sendLocationSettingUpdate(); sendWifiSettingUpdate(/* forceUpdate= */ true); sendAirplaneModeSettingUpdate(); @@ -854,14 +982,76 @@ public class ContextHubService extends IContextHubService.Stub { private void handleClientMessageCallback(int contextHubId, short hostEndpointId, NanoAppMessage message, List<String> nanoappPermissions, List<String> messagePermissions) { - byte errorCode = mClientManager.onMessageFromNanoApp(contextHubId, hostEndpointId, message, - nanoappPermissions, messagePermissions); - if (message.isReliable() && errorCode != ErrorCode.OK) { - sendMessageDeliveryStatusToContextHub(contextHubId, message.getMessageSequenceNumber(), - errorCode); + if (!Flags.reliableMessageImplementation() + || !Flags.reliableMessageDuplicateDetectionService()) { + byte errorCode = mClientManager.onMessageFromNanoApp(contextHubId, hostEndpointId, + message, nanoappPermissions, messagePermissions); + if (message.isReliable() && errorCode != ErrorCode.OK) { + sendMessageDeliveryStatusToContextHub(contextHubId, + message.getMessageSequenceNumber(), errorCode); + } + return; + } + + if (message.isReliable()) { + byte errorCode = ErrorCode.OK; + synchronized (mReliableMessageRecordQueue) { + Optional<ReliableMessageRecord> record = Optional.empty(); + for (ReliableMessageRecord r: mReliableMessageRecordQueue) { + if (r.getContextHubId() == contextHubId + && r.getMessageSequenceNumber() == message.getMessageSequenceNumber()) { + record = Optional.of(r); + break; + } + } + + if (record.isPresent()) { + errorCode = record.get().getErrorCode(); + if (errorCode == ErrorCode.TRANSIENT_ERROR) { + Log.w(TAG, "Found duplicate reliable message with message sequence number: " + + record.get().getMessageSequenceNumber() + ": retrying"); + errorCode = mClientManager.onMessageFromNanoApp( + contextHubId, hostEndpointId, message, + nanoappPermissions, messagePermissions); + record.get().setErrorCode(errorCode); + } else { + Log.w(TAG, "Found duplicate reliable message with message sequence number: " + + record.get().getMessageSequenceNumber()); + } + } else { + errorCode = mClientManager.onMessageFromNanoApp( + contextHubId, hostEndpointId, message, + nanoappPermissions, messagePermissions); + mReliableMessageRecordQueue.add( + new ReliableMessageRecord(contextHubId, + SystemClock.elapsedRealtimeNanos(), + message.getMessageSequenceNumber(), + errorCode)); + } + } + sendMessageDeliveryStatusToContextHub(contextHubId, + message.getMessageSequenceNumber(), errorCode); + } else { + mClientManager.onMessageFromNanoApp( + contextHubId, hostEndpointId, message, + nanoappPermissions, messagePermissions); + } + + synchronized (mReliableMessageRecordQueue) { + while (mReliableMessageRecordQueue.peek() != null + && mReliableMessageRecordQueue.peek().isExpired()) { + mReliableMessageRecordQueue.poll(); + } } } + /** + * Sends the message delivery status to the Context Hub. + * + * @param contextHubId the ID of the hub + * @param messageSequenceNumber the message sequence number + * @param errorCode the error code, one of the enum ErrorCode + */ private void sendMessageDeliveryStatusToContextHub(int contextHubId, int messageSequenceNumber, byte errorCode) { if (!Flags.reliableMessageImplementation()) { @@ -1229,6 +1419,9 @@ public class ContextHubService extends IContextHubService.Stub { public boolean setTestMode(boolean enable) { super.setTestMode_enforcePermission(); boolean status = mContextHubWrapper.setTestMode(enable); + if (status) { + mIsTestModeEnabled.set(enable); + } // Query nanoapps to update service state after test mode state change. for (int contextHubId: mDefaultClientMap.keySet()) { diff --git a/services/core/java/com/android/server/pm/DexOptHelper.java b/services/core/java/com/android/server/pm/DexOptHelper.java index c60f0afcc2ff..209cbb7f591e 100644 --- a/services/core/java/com/android/server/pm/DexOptHelper.java +++ b/services/core/java/com/android/server/pm/DexOptHelper.java @@ -46,6 +46,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.ApexStagedEvent; +import android.content.pm.Flags; import android.content.pm.IPackageManagerNative; import android.content.pm.IStagedApexObserver; import android.content.pm.PackageManager; @@ -766,6 +767,10 @@ public final class DexOptHelper { final PackageSetting ps = installRequest.getScannedPackageSetting(); final AndroidPackage pkg = ps.getPkg(); final boolean onIncremental = isIncrementalPath(ps.getPathString()); + final boolean performDexOptForRollback = Flags.recoverabilityDetection() + ? !(installRequest.isRollback() + && installRequest.getInstallSource().mInitiatingPackageName.equals("android")) + : true; return (!instantApp || Global.getInt(context.getContentResolver(), Global.INSTANT_APP_DEXOPT_ENABLED, 0) != 0) @@ -773,7 +778,8 @@ public final class DexOptHelper { && !pkg.isDebuggable() && (!onIncremental) && dexoptOptions.isCompilationEnabled() - && !isApex; + && !isApex + && performDexOptForRollback; } private static class StagedApexObserver extends IStagedApexObserver.Stub { diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java index b1976cd0d13b..f6487ceea43b 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java @@ -1371,7 +1371,7 @@ public class UserManagerService extends IUserManager.Stub { for (int i = 0; i < userSize; i++) { UserInfo ui = mUsers.valueAt(i).info; if ((excludePartial && ui.partial) - || (excludeDying && mRemovingUserIds.get(ui.id)) + || (excludeDying && isDyingLU(ui)) || (excludePreCreated && ui.preCreated)) { continue; } @@ -1381,6 +1381,17 @@ public class UserManagerService extends IUserManager.Stub { } } + @GuardedBy("mUsersLock") + private boolean isDyingLU(UserInfo ui) { + if (mRemovingUserIds.get(ui.id)) { + return true; + } + if (ui.isEphemeral() && ui.isInitialized() && ui.id != getCurrentUserId()) { + return true; + } + return false; + } + @Override public List<UserInfo> getProfiles(@UserIdInt int userId, boolean enabledOnly) { boolean returnFullInfo; diff --git a/services/core/java/com/android/server/pm/VerifyingSession.java b/services/core/java/com/android/server/pm/VerifyingSession.java index 1a9e012a7c53..f7eb29fe3ee9 100644 --- a/services/core/java/com/android/server/pm/VerifyingSession.java +++ b/services/core/java/com/android/server/pm/VerifyingSession.java @@ -141,6 +141,8 @@ final class VerifyingSession { @NonNull private final PackageManagerService mPm; + private final int mInstallReason; + VerifyingSession(UserHandle user, File stagedDir, IPackageInstallObserver2 observer, PackageInstaller.SessionParams sessionParams, InstallSource installSource, int installerUid, SigningDetails signingDetails, int sessionId, PackageLite lite, @@ -168,6 +170,7 @@ final class VerifyingSession { mUserActionRequiredType = sessionParams.requireUserAction; mIsInherit = sessionParams.mode == MODE_INHERIT_EXISTING; mIsStaged = sessionParams.isStaged; + mInstallReason = sessionParams.installReason; } @Override @@ -190,7 +193,9 @@ final class VerifyingSession { // Perform package verification and enable rollback (unless we are simply moving the // package). if (!mOriginInfo.mExisting) { - if (!isApex() && !isArchivedInstallation()) { + final boolean verifyForRollback = Flags.recoverabilityDetection() + ? !isARollback() : true; + if (!isApex() && !isArchivedInstallation() && verifyForRollback) { // TODO(b/182426975): treat APEX as APK when APK verification is concerned sendApkVerificationRequest(pkgLite); } @@ -200,6 +205,11 @@ final class VerifyingSession { } } + private boolean isARollback() { + return mInstallReason == PackageManager.INSTALL_REASON_ROLLBACK + && mInstallSource.mInitiatingPackageName.equals("android"); + } + private void sendApkVerificationRequest(PackageInfoLite pkgLite) { final int verificationId = mPm.mPendingVerificationToken++; diff --git a/services/core/java/com/android/server/wm/BackgroundActivityStartController.java b/services/core/java/com/android/server/wm/BackgroundActivityStartController.java index 0e446b8eaf8c..eb1f3b402364 100644 --- a/services/core/java/com/android/server/wm/BackgroundActivityStartController.java +++ b/services/core/java/com/android/server/wm/BackgroundActivityStartController.java @@ -39,6 +39,7 @@ import static com.android.server.wm.ActivityTaskManagerService.APP_SWITCH_FG_ONL import static com.android.server.wm.ActivityTaskSupervisor.getApplicationLabel; import static com.android.server.wm.PendingRemoteAnimationRegistry.TIMEOUT_MS; import static com.android.window.flags.Flags.balDontBringExistingBackgroundTaskStackToFg; +import static com.android.window.flags.Flags.balImprovedMetrics; import static com.android.window.flags.Flags.balImproveRealCallerVisibilityCheck; import static com.android.window.flags.Flags.balRequireOptInByPendingIntentCreator; import static com.android.window.flags.Flags.balRequireOptInSameUid; @@ -805,14 +806,25 @@ public class BackgroundActivityStartController { * or {@link #BAL_BLOCK} if the launch should be blocked */ BalVerdict checkBackgroundActivityStartAllowedByCaller(BalState state) { - int callingUid = state.mCallingUid; - int callingPid = state.mCallingPid; - final String callingPackage = state.mCallingPackage; - WindowProcessController callerApp = state.mCallerApp; + // This is used to block background activity launch even if the app is still + // visible to user after user clicking home button. + + // Normal apps with visible app window will be allowed to start activity if app switching + // is allowed, or apps like live wallpaper with non app visible window will be allowed. + final boolean appSwitchAllowedOrFg = state.mAppSwitchState == APP_SWITCH_ALLOW + || state.mAppSwitchState == APP_SWITCH_FG_ONLY; + if (appSwitchAllowedOrFg && state.mCallingUidHasAnyVisibleWindow) { + return new BalVerdict(BAL_ALLOW_VISIBLE_WINDOW, + /*background*/ false, "callingUid has visible window"); + } + if (mService.mActiveUids.hasNonAppVisibleWindow(state.mCallingUid)) { + return new BalVerdict(BAL_ALLOW_NON_APP_VISIBLE_WINDOW, + /*background*/ false, "callingUid has non-app visible window"); + } // don't abort for the most important UIDs - final int callingAppId = UserHandle.getAppId(callingUid); - if (callingUid == Process.ROOT_UID + final int callingAppId = UserHandle.getAppId(state.mCallingUid); + if (state.mCallingUid == Process.ROOT_UID || callingAppId == Process.SYSTEM_UID || callingAppId == Process.NFC_UID) { return new BalVerdict( @@ -821,7 +833,7 @@ public class BackgroundActivityStartController { } // Always allow home application to start activities. - if (isHomeApp(callingUid, callingPackage)) { + if (isHomeApp(state.mCallingUid, state.mCallingPackage)) { return new BalVerdict(BAL_ALLOW_ALLOWLISTED_COMPONENT, /*background*/ false, "Home app"); @@ -836,67 +848,46 @@ public class BackgroundActivityStartController { "Active ime"); } - // This is used to block background activity launch even if the app is still - // visible to user after user clicking home button. - final int appSwitchState = mService.getBalAppSwitchesState(); - - // don't abort if the callingUid has a visible window or is a persistent system process - final int callingUidProcState = mService.mActiveUids.getUidState(callingUid); - final boolean callingUidHasAnyVisibleWindow = mService.hasActiveVisibleWindow(callingUid); - final boolean isCallingUidPersistentSystemProcess = - callingUidProcState <= ActivityManager.PROCESS_STATE_PERSISTENT_UI; - - // Normal apps with visible app window will be allowed to start activity if app switching - // is allowed, or apps like live wallpaper with non app visible window will be allowed. - final boolean appSwitchAllowedOrFg = - appSwitchState == APP_SWITCH_ALLOW || appSwitchState == APP_SWITCH_FG_ONLY; - if (appSwitchAllowedOrFg && callingUidHasAnyVisibleWindow) { - return new BalVerdict(BAL_ALLOW_VISIBLE_WINDOW, - /*background*/ false, "callingUid has visible window"); - } - if (mService.mActiveUids.hasNonAppVisibleWindow(callingUid)) { - return new BalVerdict(BAL_ALLOW_NON_APP_VISIBLE_WINDOW, - /*background*/ false, "callingUid has non-app visible window"); - } - - if (isCallingUidPersistentSystemProcess) { + // don't abort if the callingUid is a persistent system process + if (state.mIsCallingUidPersistentSystemProcess) { return new BalVerdict(BAL_ALLOW_ALLOWLISTED_COMPONENT, /*background*/ false, "callingUid is persistent system process"); } // don't abort if the callingUid has START_ACTIVITIES_FROM_BACKGROUND permission - if (hasBalPermission(callingUid, callingPid)) { + if (hasBalPermission(state.mCallingUid, state.mCallingPid)) { return new BalVerdict(BAL_ALLOW_PERMISSION, /*background*/ true, "START_ACTIVITIES_FROM_BACKGROUND permission granted"); } // don't abort if the caller has the same uid as the recents component - if (mSupervisor.mRecentTasks.isCallerRecents(callingUid)) { + if (mSupervisor.mRecentTasks.isCallerRecents(state.mCallingUid)) { return new BalVerdict(BAL_ALLOW_ALLOWLISTED_COMPONENT, /*background*/ true, "Recents Component"); } // don't abort if the callingUid is the device owner - if (mService.isDeviceOwner(callingUid)) { + if (mService.isDeviceOwner(state.mCallingUid)) { return new BalVerdict(BAL_ALLOW_ALLOWLISTED_COMPONENT, /*background*/ true, "Device Owner"); } // don't abort if the callingUid is a affiliated profile owner - if (mService.isAffiliatedProfileOwner(callingUid)) { + if (mService.isAffiliatedProfileOwner(state.mCallingUid)) { return new BalVerdict(BAL_ALLOW_ALLOWLISTED_COMPONENT, /*background*/ true, "Affiliated Profile Owner"); } // don't abort if the callingUid has companion device - final int callingUserId = UserHandle.getUserId(callingUid); - if (mService.isAssociatedCompanionApp(callingUserId, callingUid)) { + final int callingUserId = UserHandle.getUserId(state.mCallingUid); + if (mService.isAssociatedCompanionApp(callingUserId, state.mCallingUid)) { return new BalVerdict(BAL_ALLOW_ALLOWLISTED_COMPONENT, /*background*/ true, "Companion App"); } // don't abort if the callingUid has SYSTEM_ALERT_WINDOW permission - if (mService.hasSystemAlertWindowPermission(callingUid, callingPid, callingPackage)) { + if (mService.hasSystemAlertWindowPermission(state.mCallingUid, state.mCallingPid, + state.mCallingPackage)) { Slog.w( TAG, "Background activity start for " - + callingPackage + + state.mCallingPackage + " allowed because SYSTEM_ALERT_WINDOW permission is granted."); return new BalVerdict(BAL_ALLOW_SAW_PERMISSION, /*background*/ true, "SYSTEM_ALERT_WINDOW permission is granted"); @@ -905,7 +896,7 @@ public class BackgroundActivityStartController { // OP_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION appop if (isSystemExemptFlagEnabled() && mService.getAppOpsManager().checkOpNoThrow( AppOpsManager.OP_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION, - callingUid, callingPackage) == AppOpsManager.MODE_ALLOWED) { + state.mCallingUid, state.mCallingPackage) == AppOpsManager.MODE_ALLOWED) { return new BalVerdict(BAL_ALLOW_PERMISSION, /*background*/ true, "OP_SYSTEM_EXEMPT_FROM_ACTIVITY_BG_START_RESTRICTION appop is granted"); } @@ -914,7 +905,7 @@ public class BackgroundActivityStartController { // That's the case for PendingIntent-based starts, since the creator's process might not be // up and alive. // Don't abort if the callerApp or other processes of that uid are allowed in any way. - BalVerdict callerAppAllowsBal = checkProcessAllowsBal(callerApp, state); + BalVerdict callerAppAllowsBal = checkProcessAllowsBal(state.mCallerApp, state); if (callerAppAllowsBal.allows()) { return callerAppAllowsBal; } @@ -929,13 +920,6 @@ public class BackgroundActivityStartController { */ BalVerdict checkBackgroundActivityStartAllowedBySender(BalState state) { - if (state.isPendingIntentBalAllowedByPermission() - && hasBalPermission(state.mRealCallingUid, state.mRealCallingPid)) { - return new BalVerdict(BAL_ALLOW_PERMISSION, - /*background*/ false, - "realCallingUid has BAL permission."); - } - // Normal apps with visible app window will be allowed to start activity if app switching // is allowed, or apps like live wallpaper with non app visible window will be allowed. // The home app can start apps even if app switches are usually disallowed. @@ -961,6 +945,13 @@ public class BackgroundActivityStartController { } } + if (state.isPendingIntentBalAllowedByPermission() + && hasBalPermission(state.mRealCallingUid, state.mRealCallingPid)) { + return new BalVerdict(BAL_ALLOW_PERMISSION, + /*background*/ false, + "realCallingUid has BAL permission."); + } + // if the realCallingUid is a persistent system process, abort if the IntentSender // wasn't allowed to start an activity if (state.mForcedBalByPiSender.allowsBackgroundActivityStarts() @@ -1660,26 +1651,61 @@ public class BackgroundActivityStartController { (state.mOriginatingPendingIntent != null)); } - @BalCode int code = finalVerdict.getCode(); - int callingUid = state.mCallingUid; - int realCallingUid = state.mRealCallingUid; - Intent intent = state.mIntent; - - if (code == BAL_ALLOW_PENDING_INTENT - && (callingUid < Process.FIRST_APPLICATION_UID - || realCallingUid < Process.FIRST_APPLICATION_UID)) { - String activityName = intent != null - ? requireNonNull(intent.getComponent()).flattenToShortString() : ""; - writeBalAllowedLog(activityName, BAL_ALLOW_PENDING_INTENT, - state); + if (balImprovedMetrics()) { + if (shouldLogStats(finalVerdict, state)) { + String activityName; + if (shouldLogIntentActivity(finalVerdict, state)) { + Intent intent = state.mIntent; + activityName = intent == null ? "noIntent" // should never happen + : requireNonNull(intent.getComponent()).flattenToShortString(); + } else { + activityName = ""; + } + writeBalAllowedLog(activityName, finalVerdict.getCode(), state); + } + } else { + @BalCode int code = finalVerdict.getCode(); + int callingUid = state.mCallingUid; + int realCallingUid = state.mRealCallingUid; + Intent intent = state.mIntent; + + if (code == BAL_ALLOW_PENDING_INTENT + && (callingUid < Process.FIRST_APPLICATION_UID + || realCallingUid < Process.FIRST_APPLICATION_UID)) { + String activityName = intent != null + ? requireNonNull(intent.getComponent()).flattenToShortString() : ""; + writeBalAllowedLog(activityName, BAL_ALLOW_PENDING_INTENT, + state); + } + if (code == BAL_ALLOW_PERMISSION || code == BAL_ALLOW_FOREGROUND + || code == BAL_ALLOW_SAW_PERMISSION) { + // We don't need to know which activity in this case. + writeBalAllowedLog("", code, state); + } } - if (code == BAL_ALLOW_PERMISSION || code == BAL_ALLOW_FOREGROUND - || code == BAL_ALLOW_SAW_PERMISSION) { - // We don't need to know which activity in this case. - writeBalAllowedLog("", code, state); + return finalVerdict; + } + @VisibleForTesting + boolean shouldLogStats(BalVerdict finalVerdict, BalState state) { + if (finalVerdict.blocks()) { + return false; } - return finalVerdict; + if (!state.isPendingIntent() && finalVerdict.getRawCode() == BAL_ALLOW_VISIBLE_WINDOW) { + return false; + } + if (state.mBalAllowedByPiSender.allowsBackgroundActivityStarts() + && state.mResultForRealCaller.getRawCode() == BAL_ALLOW_VISIBLE_WINDOW) { + return false; + } + return true; + } + + @VisibleForTesting + boolean shouldLogIntentActivity(BalVerdict finalVerdict, BalState state) { + return finalVerdict.mBasedOnRealCaller + ? state.mRealCallingUid < Process.FIRST_APPLICATION_UID + : state.mCallingUid < Process.FIRST_APPLICATION_UID; } @VisibleForTesting void writeBalAllowedLog(String activityName, int code, BalState state) { diff --git a/services/core/java/com/android/server/wm/LetterboxConfiguration.java b/services/core/java/com/android/server/wm/LetterboxConfiguration.java index 5aa0ed7ce76c..ce1a72deb523 100644 --- a/services/core/java/com/android/server/wm/LetterboxConfiguration.java +++ b/services/core/java/com/android/server/wm/LetterboxConfiguration.java @@ -25,7 +25,6 @@ import android.annotation.Nullable; import android.content.Context; import android.graphics.Color; import android.provider.DeviceConfig; -import android.util.Slog; import com.android.internal.R; import com.android.internal.annotations.VisibleForTesting; @@ -33,6 +32,7 @@ import com.android.internal.annotations.VisibleForTesting; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.function.Function; +import java.util.function.IntSupplier; /** Reads letterbox configs from resources and controls their overrides at runtime. */ final class LetterboxConfiguration { @@ -265,6 +265,12 @@ final class LetterboxConfiguration { // unresizable apps private boolean mIsDisplayAspectRatioEnabledForFixedOrientationLetterbox; + // Supplier for the value in pixel to consider when detecting vertical thin letterboxing + private final IntSupplier mThinLetterboxWidthFn; + + // Supplier for the value in pixel to consider when detecting horizontal thin letterboxing + private final IntSupplier mThinLetterboxHeightFn; + // Allows to enable letterboxing strategy for translucent activities ignoring flags. private boolean mTranslucentLetterboxingOverrideEnabled; @@ -358,6 +364,10 @@ final class LetterboxConfiguration { R.bool.config_isWindowManagerCameraCompatSplitScreenAspectRatioEnabled); mIsPolicyForIgnoringRequestedOrientationEnabled = mContext.getResources().getBoolean( R.bool.config_letterboxIsPolicyForIgnoringRequestedOrientationEnabled); + mThinLetterboxWidthFn = () -> mContext.getResources().getDimensionPixelSize( + R.dimen.config_letterboxThinLetterboxWidthDp); + mThinLetterboxHeightFn = () -> mContext.getResources().getDimensionPixelSize( + R.dimen.config_letterboxThinLetterboxHeightDp); mLetterboxConfigurationPersister = letterboxConfigurationPersister; mLetterboxConfigurationPersister.start(); @@ -1129,6 +1139,24 @@ final class LetterboxConfiguration { } /** + * @return Width in pixel about the padding to use to understand if the letterbox for an + * activity is thin. If the available space has width W and the app has width w, this + * is the maximum value for (W - w) / 2 to be considered for a thin letterboxed app. + */ + int getThinLetterboxWidthPx() { + return mThinLetterboxWidthFn.getAsInt(); + } + + /** + * @return Height in pixel about the padding to use to understand if a letterbox is thin. + * If the available space has height H and the app has height h, this is the maximum + * value for (H - h) / 2 to be considered for a thin letterboxed app. + */ + int getThinLetterboxHeightPx() { + return mThinLetterboxHeightFn.getAsInt(); + } + + /** * Overrides whether using split screen aspect ratio as a default aspect ratio for unresizable * apps. */ diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java index b38e666ea691..9e16b8abe0de 100644 --- a/services/core/java/com/android/server/wm/LetterboxUiController.java +++ b/services/core/java/com/android/server/wm/LetterboxUiController.java @@ -1024,6 +1024,67 @@ final class LetterboxUiController { return getSplitScreenAspectRatio(); } + /** + * @return {@value true} if the resulting app is letterboxed in a way defined as thin. + */ + boolean isVerticalThinLetterboxed() { + final int thinHeight = mLetterboxConfiguration.getThinLetterboxHeightPx(); + if (thinHeight < 0) { + return false; + } + final Task task = mActivityRecord.getTask(); + if (task == null) { + return false; + } + final int padding = Math.abs( + task.getBounds().height() - mActivityRecord.getBounds().height()) / 2; + return padding <= thinHeight; + } + + /** + * @return {@value true} if the resulting app is pillarboxed in a way defined as thin. + */ + boolean isHorizontalThinLetterboxed() { + final int thinWidth = mLetterboxConfiguration.getThinLetterboxWidthPx(); + if (thinWidth < 0) { + return false; + } + final Task task = mActivityRecord.getTask(); + if (task == null) { + return false; + } + final int padding = Math.abs( + task.getBounds().width() - mActivityRecord.getBounds().width()) / 2; + return padding <= thinWidth; + } + + + /** + * @return {@value true} if the vertical reachability should be allowed in case of + * thin letteboxing + */ + boolean allowVerticalReachabilityForThinLetterbox() { + if (!Flags.disableThinLetterboxingReachability()) { + return true; + } + // When the flag is enabled we allow vertical reachability only if the + // app is not thin letterboxed vertically. + return !isVerticalThinLetterboxed(); + } + + /** + * @return {@value true} if the vertical reachability should be enabled in case of + * thin letteboxing + */ + boolean allowHorizontalReachabilityForThinLetterbox() { + if (!Flags.disableThinLetterboxingReachability()) { + return true; + } + // When the flag is enabled we allow horizontal reachability only if the + // app is not thin pillarboxed. + return !isHorizontalThinLetterboxed(); + } + float getSplitScreenAspectRatio() { // Getting the same aspect ratio that apps get in split screen. final DisplayArea displayArea = mActivityRecord.getDisplayArea(); @@ -1263,6 +1324,9 @@ final class LetterboxUiController { * </ul> */ private boolean isHorizontalReachabilityEnabled(Configuration parentConfiguration) { + if (!allowHorizontalReachabilityForThinLetterbox()) { + return false; + } // Use screen resolved bounds which uses resolved bounds or size compat bounds // as activity bounds can sometimes be empty final Rect opaqueActivityBounds = hasInheritedLetterboxBehavior() @@ -1298,6 +1362,9 @@ final class LetterboxUiController { * </ul> */ private boolean isVerticalReachabilityEnabled(Configuration parentConfiguration) { + if (!allowVerticalReachabilityForThinLetterbox()) { + return false; + } // Use screen resolved bounds which uses resolved bounds or size compat bounds // as activity bounds can sometimes be empty final Rect opaqueActivityBounds = hasInheritedLetterboxBehavior() @@ -1566,6 +1633,8 @@ final class LetterboxUiController { if (!shouldShowLetterboxUi) { return; } + pw.println(prefix + " isVerticalThinLetterboxed=" + isVerticalThinLetterboxed()); + pw.println(prefix + " isHorizontalThinLetterboxed=" + isHorizontalThinLetterboxed()); pw.println(prefix + " letterboxBackgroundColor=" + Integer.toHexString( getLetterboxBackgroundColor().toArgb())); pw.println(prefix + " letterboxBackgroundType=" diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 4949d7d3d5ec..8bd7b5f78cf4 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -3462,8 +3462,6 @@ class Task extends TaskFragment { info.isVisibleRequested = isVisibleRequested(); info.isSleeping = shouldSleepActivities(); info.isTopActivityTransparent = top != null && !top.fillsParent(); - appCompatTaskInfo.isLetterboxDoubleTapEnabled = top != null - && top.mLetterboxUiController.isLetterboxDoubleTapEducationEnabled(); appCompatTaskInfo.topActivityLetterboxVerticalPosition = TaskInfo.PROPERTY_VALUE_UNSET; appCompatTaskInfo.topActivityLetterboxHorizontalPosition = TaskInfo.PROPERTY_VALUE_UNSET; appCompatTaskInfo.topActivityLetterboxWidth = TaskInfo.PROPERTY_VALUE_UNSET; @@ -3478,15 +3476,29 @@ class Task extends TaskFragment { appCompatTaskInfo.topActivityLetterboxWidth = top.getBounds().width(); appCompatTaskInfo.topActivityLetterboxHeight = top.getBounds().height(); } + // We need to consider if letterboxed or pillarboxed + // TODO(b/336807329) Encapsulate reachability logic + appCompatTaskInfo.isLetterboxDoubleTapEnabled = top != null + && top.mLetterboxUiController.isLetterboxDoubleTapEducationEnabled(); if (appCompatTaskInfo.isLetterboxDoubleTapEnabled) { if (appCompatTaskInfo.isTopActivityPillarboxed()) { - // Pillarboxed - appCompatTaskInfo.topActivityLetterboxHorizontalPosition = - top.mLetterboxUiController.getLetterboxPositionForHorizontalReachability(); + if (top.mLetterboxUiController.allowHorizontalReachabilityForThinLetterbox()) { + // Pillarboxed + appCompatTaskInfo.topActivityLetterboxHorizontalPosition = + top.mLetterboxUiController + .getLetterboxPositionForHorizontalReachability(); + } else { + appCompatTaskInfo.isLetterboxDoubleTapEnabled = false; + } } else { - // Letterboxed - appCompatTaskInfo.topActivityLetterboxVerticalPosition = - top.mLetterboxUiController.getLetterboxPositionForVerticalReachability(); + if (top.mLetterboxUiController.allowVerticalReachabilityForThinLetterbox()) { + // Letterboxed + appCompatTaskInfo.topActivityLetterboxVerticalPosition = + top.mLetterboxUiController + .getLetterboxPositionForVerticalReachability(); + } else { + appCompatTaskInfo.isLetterboxDoubleTapEnabled = false; + } } } appCompatTaskInfo.topActivityEligibleForUserAspectRatioButton = top != null diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 8755a8077ddb..cfe4e17eb1be 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -47,6 +47,7 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManagerInternal; import android.content.res.Configuration; import android.content.res.Resources.Theme; +import android.crashrecovery.flags.Flags; import android.credentials.CredentialManager; import android.database.sqlite.SQLiteCompatibilityWalFlags; import android.database.sqlite.SQLiteGlobal; @@ -1195,11 +1196,13 @@ public final class SystemServer implements Dumpable { mSystemServiceManager.startService(RecoverySystemService.Lifecycle.class); t.traceEnd(); - // Now that we have the bare essentials of the OS up and running, take - // note that we just booted, which might send out a rescue party if - // we're stuck in a runtime restart loop. - RescueParty.registerHealthObserver(mSystemContext); - PackageWatchdog.getInstance(mSystemContext).noteBoot(); + if (!Flags.recoverabilityDetection()) { + // Now that we have the bare essentials of the OS up and running, take + // note that we just booted, which might send out a rescue party if + // we're stuck in a runtime restart loop. + RescueParty.registerHealthObserver(mSystemContext); + PackageWatchdog.getInstance(mSystemContext).noteBoot(); + } // Manages LEDs and display backlight so we need it to bring up the display. t.traceBegin("StartLightsService"); @@ -1469,9 +1472,12 @@ public final class SystemServer implements Dumpable { boolean enableVrService = context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_VR_MODE_HIGH_PERFORMANCE); - // For debugging RescueParty - if (Build.IS_DEBUGGABLE && SystemProperties.getBoolean("debug.crash_system", false)) { - throw new RuntimeException(); + if (!Flags.recoverabilityDetection()) { + // For debugging RescueParty + if (Build.IS_DEBUGGABLE + && SystemProperties.getBoolean("debug.crash_system", false)) { + throw new RuntimeException(); + } } try { @@ -2910,6 +2916,14 @@ public final class SystemServer implements Dumpable { mPackageManagerService.systemReady(); t.traceEnd(); + if (Flags.recoverabilityDetection()) { + // Now that we have the essential services needed for rescue party, initialize + // RescuParty. note that we just booted, which might send out a rescue party if + // we're stuck in a runtime restart loop. + RescueParty.registerHealthObserver(mSystemContext); + PackageWatchdog.getInstance(mSystemContext).noteBoot(); + } + t.traceBegin("MakeDisplayManagerServiceReady"); try { // TODO: use boot phase and communicate this flag some other way @@ -3313,6 +3327,14 @@ public final class SystemServer implements Dumpable { * are updated outside of OTA; and to avoid breaking dependencies from system into apexes. */ private void startApexServices(@NonNull TimingsTraceAndSlog t) { + if (Flags.recoverabilityDetection()) { + // For debugging RescueParty + if (Build.IS_DEBUGGABLE + && SystemProperties.getBoolean("debug.crash_system", false)) { + throw new RuntimeException(); + } + } + t.traceBegin("startApexServices"); // TODO(b/192880996): get the list from "android" package, once the manifest entries // are migrated to system manifest. diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/UserManagerServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/pm/UserManagerServiceTest.java index 79f1574105ba..7d58a2e53693 100644 --- a/services/tests/mockingservicestests/src/com/android/server/pm/UserManagerServiceTest.java +++ b/services/tests/mockingservicestests/src/com/android/server/pm/UserManagerServiceTest.java @@ -778,6 +778,49 @@ public final class UserManagerServiceTest { } @Test + public void testGetAliveUsers_shouldExcludeInitialisedEphemeralNonCurrentUsers() { + assertWithMessage("Ephemeral user should not exist at all initially") + .that(mUmi.getUsers(false).stream().anyMatch(u -> u.id == USER_ID)) + .isFalse(); + + // add an ephemeral full user + TestUserData userData = new TestUserData(USER_ID); + userData.info.flags = UserInfo.FLAG_FULL | UserInfo.FLAG_EPHEMERAL; + addUserData(userData); + + assertWithMessage("Ephemeral user should exist as alive after being created") + .that(mUmi.getUsers(true).stream().anyMatch(u -> u.id == USER_ID)) + .isTrue(); + + // mock switch to the user (mark it as initialized & make it the current user) + userData.info.flags |= UserInfo.FLAG_INITIALIZED; + mockCurrentUser(USER_ID); + + assertWithMessage("Ephemeral user should still exist as alive after being switched to") + .that(mUmi.getUsers(true).stream().anyMatch(u -> u.id == USER_ID)) + .isTrue(); + + // switch away from the user + mockCurrentUser(OTHER_USER_ID); + + assertWithMessage("Ephemeral user should not exist as alive after getting switched away") + .that(mUmi.getUsers(true).stream().anyMatch(u -> u.id == USER_ID)) + .isFalse(); + + assertWithMessage("Ephemeral user should still exist as dying after getting switched away") + .that(mUmi.getUsers(false).stream().anyMatch(u -> u.id == USER_ID)) + .isTrue(); + + // finally remove the user + mUms.removeUserInfo(USER_ID); + + assertWithMessage("Ephemeral user should not exist at all after cleanup") + .that(mUmi.getUsers(false).stream().anyMatch(u -> u.id == USER_ID)) + .isFalse(); + } + + + @Test @RequiresFlagsEnabled({android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE, Flags.FLAG_BLOCK_PRIVATE_SPACE_CREATION, Flags.FLAG_ENABLE_PRIVATE_SPACE_FEATURES}) public void testCreatePrivateProfileOnHeadlessSystemUser_shouldAllowCreation() { diff --git a/services/tests/servicestests/src/com/android/server/biometrics/BiometricDanglingReceiverTest.java b/services/tests/servicestests/src/com/android/server/biometrics/BiometricDanglingReceiverTest.java new file mode 100644 index 000000000000..0716a5c5561d --- /dev/null +++ b/services/tests/servicestests/src/com/android/server/biometrics/BiometricDanglingReceiverTest.java @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2024 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.server.biometrics; + +import static com.android.server.biometrics.sensors.BiometricNotificationUtils.NOTIFICATION_ID; + +import static com.google.common.truth.Truth.assertThat; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.app.NotificationManager; +import android.content.Intent; +import android.hardware.biometrics.BiometricsProtoEnums; +import android.os.UserHandle; +import android.provider.Settings; +import android.testing.TestableContext; + +import androidx.test.filters.SmallTest; +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.runner.AndroidJUnit4; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; + +@SmallTest +@RunWith(AndroidJUnit4.class) +public class BiometricDanglingReceiverTest { + @Rule + public MockitoRule mockitoRule = MockitoJUnit.rule(); + + private BiometricDanglingReceiver mBiometricDanglingReceiver; + + @Rule + public final TestableContext mContext = spy(new TestableContext( + InstrumentationRegistry.getInstrumentation().getTargetContext(), null)); + + @Mock + NotificationManager mNotificationManager; + + @Mock + Intent mIntent; + + @Captor + private ArgumentCaptor<Intent> mArgumentCaptor; + + @Before + public void setUp() { + mContext.addMockSystemService(NotificationManager.class, mNotificationManager); + } + + @Test + public void testFingerprintRegisterReceiver() { + initBroadcastReceiver(BiometricsProtoEnums.MODALITY_FINGERPRINT); + verify(mContext).registerReceiver(eq(mBiometricDanglingReceiver), any()); + } + + @Test + public void testFaceRegisterReceiver() { + initBroadcastReceiver(BiometricsProtoEnums.MODALITY_FACE); + verify(mContext).registerReceiver(eq(mBiometricDanglingReceiver), any()); + } + + @Test + public void testOnReceive_fingerprintReEnrollLaunch() { + initBroadcastReceiver(BiometricsProtoEnums.MODALITY_FINGERPRINT); + when(mIntent.getAction()).thenReturn( + BiometricDanglingReceiver.ACTION_FINGERPRINT_RE_ENROLL_LAUNCH); + + mBiometricDanglingReceiver.onReceive(mContext, mIntent); + + // Verify fingerprint enroll process is launched. + verify(mContext).startActivity(mArgumentCaptor.capture()); + assertThat(mArgumentCaptor.getValue().getAction()) + .isEqualTo(Settings.ACTION_FINGERPRINT_ENROLL); + + // Verify notification is canceled + verify(mNotificationManager).cancelAsUser("FingerprintReEnroll", NOTIFICATION_ID, + UserHandle.CURRENT); + + // Verify receiver is unregistered after receiving the broadcast + verify(mContext).unregisterReceiver(mBiometricDanglingReceiver); + } + + @Test + public void testOnReceive_faceReEnrollLaunch() { + initBroadcastReceiver(BiometricsProtoEnums.MODALITY_FACE); + when(mIntent.getAction()).thenReturn( + BiometricDanglingReceiver.ACTION_FACE_RE_ENROLL_LAUNCH); + + mBiometricDanglingReceiver.onReceive(mContext, mIntent); + + // Verify face enroll process is launched. + verify(mContext).startActivity(mArgumentCaptor.capture()); + assertThat(mArgumentCaptor.getValue().getAction()) + .isEqualTo(BiometricDanglingReceiver.FACE_SETTINGS_ACTION); + + // Verify notification is canceled + verify(mNotificationManager).cancelAsUser("FaceReEnroll", NOTIFICATION_ID, + UserHandle.CURRENT); + + // Verify receiver is unregistered after receiving the broadcast. + verify(mContext).unregisterReceiver(mBiometricDanglingReceiver); + } + + private void initBroadcastReceiver(int modality) { + mBiometricDanglingReceiver = new BiometricDanglingReceiver(mContext, modality); + } +} diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java index fc573d243129..37895315557a 100644 --- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java +++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/BiometricSchedulerTest.java @@ -1228,6 +1228,11 @@ public class BiometricSchedulerTest { Slog.d(TAG, "TestInternalEnumerateClient#startHalOperation"); onEnumerationResult(TEST_FINGERPRINT, 0 /* remaining */); } + + @Override + protected int getModality() { + return BiometricsProtoEnums.MODALITY_FINGERPRINT; + } } private static class TestRemovalClient extends RemovalClient<Fingerprint, Object> { diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClientTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClientTest.java index 9845b58f79bf..d8bdd50d8c08 100644 --- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClientTest.java +++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/face/aidl/FaceInternalEnumerateClientTest.java @@ -20,8 +20,10 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -79,15 +81,21 @@ public class FaceInternalEnumerateClientTest { private final int mBiometricId = 1; private final Face mFace = new Face("face", mBiometricId, 1 /* deviceId */); private FaceInternalEnumerateClient mClient; + private boolean mNotificationSent; @Before public void setUp() { when(mAidlSession.getSession()).thenReturn(mSession); - final List<Face> enrolled = new ArrayList<>(); enrolled.add(mFace); - mClient = new FaceInternalEnumerateClient(mContext, () -> mAidlSession, mToken, USER_ID, - TAG, enrolled, mBiometricUtils, SENSOR_ID, mBiometricLogger, mBiometricContext); + mClient = spy(new FaceInternalEnumerateClient(mContext, () -> mAidlSession, mToken, USER_ID, + TAG, enrolled, mBiometricUtils, SENSOR_ID, mBiometricLogger, mBiometricContext)); + + mNotificationSent = false; + doAnswer(invocation -> { + mNotificationSent = true; + return null; + }).when(mClient).sendDanglingNotification(anyList()); } @Test @@ -101,6 +109,7 @@ public class FaceInternalEnumerateClientTest { verify(mSession).enumerateEnrollments(); assertThat(mClient.getUnknownHALTemplates().size()).isEqualTo(0); + assertThat(mNotificationSent).isFalse(); verify(mBiometricUtils, never()).removeBiometricForUser(any(), anyInt(), anyInt()); verify(mCallback).onClientFinished(mClient, true); } @@ -116,6 +125,7 @@ public class FaceInternalEnumerateClientTest { verify(mSession).enumerateEnrollments(); assertThat(mClient.getUnknownHALTemplates().size()).isEqualTo(0); + assertThat(mNotificationSent).isFalse(); verify(mBiometricUtils, never()).removeBiometricForUser(any(), anyInt(), anyInt()); verify(mCallback, never()).onClientFinished(mClient, true); } @@ -131,6 +141,7 @@ public class FaceInternalEnumerateClientTest { verify(mSession).enumerateEnrollments(); assertThat(mClient.getUnknownHALTemplates().size()).isEqualTo(0); + assertThat(mNotificationSent).isTrue(); verify(mBiometricUtils).removeBiometricForUser(mContext, USER_ID, mBiometricId); verify(mCallback).onClientFinished(mClient, true); } @@ -147,6 +158,7 @@ public class FaceInternalEnumerateClientTest { verify(mSession).enumerateEnrollments(); assertThat(mClient.getUnknownHALTemplates().size()).isEqualTo(1); + assertThat(mNotificationSent).isFalse(); verify(mBiometricUtils, never()).removeBiometricForUser(any(), anyInt(), anyInt()); verify(mCallback, never()).onClientFinished(mClient, true); } @@ -164,6 +176,7 @@ public class FaceInternalEnumerateClientTest { verify(mSession).enumerateEnrollments(); assertThat(mClient.getUnknownHALTemplates().size()).isEqualTo(1); + assertThat(mNotificationSent).isTrue(); verify(mBiometricUtils).removeBiometricForUser(mContext, USER_ID, mBiometricId); verify(mCallback).onClientFinished(mClient, true); } diff --git a/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClientTest.java b/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClientTest.java index b5df8362b09f..fab120016434 100644 --- a/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClientTest.java +++ b/services/tests/servicestests/src/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintInternalEnumerateClientTest.java @@ -20,8 +20,10 @@ import static com.google.common.truth.Truth.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -80,15 +82,23 @@ public class FingerprintInternalEnumerateClientTest { private FingerprintInternalEnumerateClient mClient; + private boolean mNotificationSent; + @Before public void setUp() { when(mAidlSession.getSession()).thenReturn(mSession); List<Fingerprint> enrolled = new ArrayList<>(); enrolled.add(new Fingerprint("one", 1, 1)); - mClient = new FingerprintInternalEnumerateClient(mContext, () -> mAidlSession, mToken, + mClient = spy(new FingerprintInternalEnumerateClient(mContext, () -> mAidlSession, mToken, USER_ID, TAG, enrolled, mBiometricUtils, SENSOR_ID, mBiometricLogger, - mBiometricContext); + mBiometricContext)); + + mNotificationSent = false; + doAnswer(invocation -> { + mNotificationSent = true; + return null; + }).when(mClient).sendDanglingNotification(anyList()); } @Test @@ -104,6 +114,7 @@ public class FingerprintInternalEnumerateClientTest { assertThat(mClient.getUnknownHALTemplates().stream() .flatMap(x -> Stream.of(x.getBiometricId())) .collect(Collectors.toList())).containsExactly(2, 3); + assertThat(mNotificationSent).isTrue(); verify(mBiometricUtils).removeBiometricForUser(mContext, USER_ID, 1); verify(mCallback).onClientFinished(mClient, true); } @@ -118,6 +129,7 @@ public class FingerprintInternalEnumerateClientTest { verify(mSession).enumerateEnrollments(); assertThat(mClient.getUnknownHALTemplates().size()).isEqualTo(0); + assertThat(mNotificationSent).isFalse(); verify(mBiometricUtils, never()).removeBiometricForUser(any(), anyInt(), anyInt()); verify(mCallback).onClientFinished(mClient, true); } diff --git a/services/tests/wmtests/src/com/android/server/wm/BackgroundActivityStartControllerTests.java b/services/tests/wmtests/src/com/android/server/wm/BackgroundActivityStartControllerTests.java index 695faa525dd6..39a2259cf77f 100644 --- a/services/tests/wmtests/src/com/android/server/wm/BackgroundActivityStartControllerTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/BackgroundActivityStartControllerTests.java @@ -19,6 +19,8 @@ package com.android.server.wm; import static com.android.server.wm.BackgroundActivityStartController.BAL_ALLOW_PENDING_INTENT; import static com.android.server.wm.BackgroundActivityStartController.BAL_ALLOW_PERMISSION; import static com.android.server.wm.BackgroundActivityStartController.BAL_ALLOW_VISIBLE_WINDOW; +import static com.android.server.wm.BackgroundActivityStartController.BAL_BLOCK; +import static com.android.window.flags.Flags.balImprovedMetrics; import static com.google.common.truth.Truth.assertThat; @@ -145,6 +147,16 @@ public class BackgroundActivityStartControllerTests { } @Override + boolean shouldLogStats(BalVerdict finalVerdict, BalState state) { + return true; + } + + @Override + boolean shouldLogIntentActivity(BalVerdict finalVerdict, BalState state) { + return true; + } + + @Override BalVerdict checkBackgroundActivityStartAllowedByCaller(BalState state) { return mCallerVerdict.orElseGet( () -> super.checkBackgroundActivityStartAllowedByCaller(state)); @@ -238,7 +250,12 @@ public class BackgroundActivityStartControllerTests { // assertions assertThat(verdict.getCode()).isEqualTo(BackgroundActivityStartController.BAL_BLOCK); - assertThat(mBalAllowedLogs).isEmpty(); // not allowed + if (balImprovedMetrics()) { + assertThat(mBalAllowedLogs).containsExactly( + new BalAllowedLog("package.app3/someClass", BAL_BLOCK)); + } else { + assertThat(mBalAllowedLogs).isEmpty(); // not allowed + } } // Tests for BackgroundActivityStartController.checkBackgroundActivityStart @@ -268,7 +285,12 @@ public class BackgroundActivityStartControllerTests { // assertions assertThat(verdict).isEqualTo(BalVerdict.BLOCK); - assertThat(mBalAllowedLogs).isEmpty(); // not allowed + if (balImprovedMetrics()) { + assertThat(mBalAllowedLogs).containsExactly( + new BalAllowedLog("package.app3/someClass", BAL_BLOCK)); + } else { + assertThat(mBalAllowedLogs).isEmpty(); // not allowed + } } @Test @@ -298,7 +320,12 @@ public class BackgroundActivityStartControllerTests { // assertions assertThat(verdict).isEqualTo(callerVerdict); - assertThat(mBalAllowedLogs).isEmpty(); // non-critical exception + if (balImprovedMetrics()) { + assertThat(mBalAllowedLogs).containsExactly( + new BalAllowedLog("package.app3/someClass", callerVerdict.getCode())); + } else { + assertThat(mBalAllowedLogs).isEmpty(); // non-critical exception + } } @Test @@ -362,7 +389,13 @@ public class BackgroundActivityStartControllerTests { // assertions assertThat(verdict).isEqualTo(callerVerdict); - assertThat(mBalAllowedLogs).containsExactly(new BalAllowedLog("", callerVerdict.getCode())); + if (balImprovedMetrics()) { + assertThat(mBalAllowedLogs).containsExactly( + new BalAllowedLog("package.app3/someClass", callerVerdict.getCode())); + } else { + assertThat(mBalAllowedLogs).containsExactly( + new BalAllowedLog("", callerVerdict.getCode())); + } } @Test @@ -398,7 +431,12 @@ public class BackgroundActivityStartControllerTests { // assertions assertThat(verdict).isEqualTo(BalVerdict.BLOCK); - assertThat(mBalAllowedLogs).isEmpty(); + if (balImprovedMetrics()) { + assertThat(mBalAllowedLogs).containsExactly( + new BalAllowedLog("package.app3/someClass", BAL_BLOCK)); + } else { + assertThat(mBalAllowedLogs).isEmpty(); + } } @Test @@ -430,7 +468,12 @@ public class BackgroundActivityStartControllerTests { // assertions assertThat(verdict).isEqualTo(callerVerdict); - assertThat(mBalAllowedLogs).isEmpty(); + if (balImprovedMetrics()) { + assertThat(mBalAllowedLogs).containsExactly( + new BalAllowedLog("package.app3/someClass", callerVerdict.getCode())); + } else { + assertThat(mBalAllowedLogs).isEmpty(); + } } @Test diff --git a/services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java index b74da1a888cd..a60d243c9dad 100644 --- a/services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java @@ -85,6 +85,8 @@ import android.content.pm.PackageManager; import android.content.pm.PackageManager.Property; import android.content.res.Resources; import android.graphics.Rect; +import android.platform.test.annotations.DisableFlags; +import android.platform.test.annotations.EnableFlags; import android.platform.test.annotations.Presubmit; import android.view.InsetsSource; import android.view.InsetsState; @@ -96,6 +98,7 @@ import android.view.WindowManager; import androidx.test.filters.SmallTest; import com.android.internal.R; +import com.android.window.flags.Flags; import libcore.junit.util.compat.CoreCompatChangeRule.DisableCompatChanges; import libcore.junit.util.compat.CoreCompatChangeRule.EnableCompatChanges; @@ -1528,6 +1531,98 @@ public class LetterboxUiControllerTest extends WindowTestsBase { mActivity.getParent().getConfiguration()), /* delta */ 0.01); } + @Test + public void testIsVerticalThinLetterboxed() { + // Vertical thin letterbox disabled + doReturn(-1).when(mActivity.mWmService.mLetterboxConfiguration) + .getThinLetterboxHeightPx(); + assertFalse(mController.isVerticalThinLetterboxed()); + // Define a Task 100x100 + final Task task = mock(Task.class); + doReturn(new Rect(0, 0, 100, 100)).when(task).getBounds(); + doReturn(10).when(mActivity.mWmService.mLetterboxConfiguration) + .getThinLetterboxHeightPx(); + + // Vertical thin letterbox disabled without Task + doReturn(null).when(mActivity).getTask(); + assertFalse(mController.isVerticalThinLetterboxed()); + // Assign a Task for the Activity + doReturn(task).when(mActivity).getTask(); + + // (task.width() - act.width()) / 2 = 5 < 10 + doReturn(new Rect(5, 5, 95, 95)).when(mActivity).getBounds(); + assertTrue(mController.isVerticalThinLetterboxed()); + + // (task.width() - act.width()) / 2 = 10 = 10 + doReturn(new Rect(10, 10, 90, 90)).when(mActivity).getBounds(); + assertTrue(mController.isVerticalThinLetterboxed()); + + // (task.width() - act.width()) / 2 = 11 > 10 + doReturn(new Rect(11, 11, 89, 89)).when(mActivity).getBounds(); + assertFalse(mController.isVerticalThinLetterboxed()); + } + + @Test + public void testIsHorizontalThinLetterboxed() { + // Horizontal thin letterbox disabled + doReturn(-1).when(mActivity.mWmService.mLetterboxConfiguration) + .getThinLetterboxWidthPx(); + assertFalse(mController.isHorizontalThinLetterboxed()); + // Define a Task 100x100 + final Task task = mock(Task.class); + doReturn(new Rect(0, 0, 100, 100)).when(task).getBounds(); + doReturn(10).when(mActivity.mWmService.mLetterboxConfiguration) + .getThinLetterboxWidthPx(); + + // Vertical thin letterbox disabled without Task + doReturn(null).when(mActivity).getTask(); + assertFalse(mController.isHorizontalThinLetterboxed()); + // Assign a Task for the Activity + doReturn(task).when(mActivity).getTask(); + + // (task.height() - act.height()) / 2 = 5 < 10 + doReturn(new Rect(5, 5, 95, 95)).when(mActivity).getBounds(); + assertTrue(mController.isHorizontalThinLetterboxed()); + + // (task.height() - act.height()) / 2 = 10 = 10 + doReturn(new Rect(10, 10, 90, 90)).when(mActivity).getBounds(); + assertTrue(mController.isHorizontalThinLetterboxed()); + + // (task.height() - act.height()) / 2 = 11 > 10 + doReturn(new Rect(11, 11, 89, 89)).when(mActivity).getBounds(); + assertFalse(mController.isHorizontalThinLetterboxed()); + } + + @Test + @EnableFlags(Flags.FLAG_DISABLE_THIN_LETTERBOXING_REACHABILITY) + public void testAllowReachabilityForThinLetterboxWithFlagEnabled() { + spyOn(mController); + doReturn(true).when(mController).isVerticalThinLetterboxed(); + assertFalse(mController.allowVerticalReachabilityForThinLetterbox()); + doReturn(true).when(mController).isHorizontalThinLetterboxed(); + assertFalse(mController.allowHorizontalReachabilityForThinLetterbox()); + + doReturn(false).when(mController).isVerticalThinLetterboxed(); + assertTrue(mController.allowVerticalReachabilityForThinLetterbox()); + doReturn(false).when(mController).isHorizontalThinLetterboxed(); + assertTrue(mController.allowHorizontalReachabilityForThinLetterbox()); + } + + @Test + @DisableFlags(Flags.FLAG_DISABLE_THIN_LETTERBOXING_REACHABILITY) + public void testAllowReachabilityForThinLetterboxWithFlagDisabled() { + spyOn(mController); + doReturn(true).when(mController).isVerticalThinLetterboxed(); + assertTrue(mController.allowVerticalReachabilityForThinLetterbox()); + doReturn(true).when(mController).isHorizontalThinLetterboxed(); + assertTrue(mController.allowHorizontalReachabilityForThinLetterbox()); + + doReturn(false).when(mController).isVerticalThinLetterboxed(); + assertTrue(mController.allowVerticalReachabilityForThinLetterbox()); + doReturn(false).when(mController).isHorizontalThinLetterboxed(); + assertTrue(mController.allowHorizontalReachabilityForThinLetterbox()); + } + private void mockThatProperty(String propertyName, boolean value) throws Exception { Property property = new Property(propertyName, /* value */ value, /* packageName */ "", /* className */ ""); diff --git a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java index 8677738f3edc..6b605ec6d0c0 100644 --- a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java @@ -3646,11 +3646,27 @@ public class SizeCompatTests extends WindowTestsBase { } @Test + public void testIsReachabilityEnabled_thisLetterbox_false() { + // Case when the reachability would be enabled otherwise + setUpDisplaySizeWithApp(/* dw */ 1000, /* dh */ 2800); + mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); + mWm.mLetterboxConfiguration.setIsVerticalReachabilityEnabled(true); + prepareUnresizable(mActivity, SCREEN_ORIENTATION_LANDSCAPE); + mActivity.getWindowConfiguration().setBounds(null); + + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ false); + + assertFalse(mActivity.mLetterboxUiController.isVerticalReachabilityEnabled()); + assertFalse(mActivity.mLetterboxUiController.isHorizontalReachabilityEnabled()); + } + + @Test public void testIsHorizontalReachabilityEnabled_splitScreen_false() { mAtm.mDevEnableNonResizableMultiWindow = true; setUpDisplaySizeWithApp(2800, 1000); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); mWm.mLetterboxConfiguration.setIsHorizontalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); final TestSplitOrganizer organizer = new TestSplitOrganizer(mAtm, mActivity.getDisplayContent()); @@ -3673,6 +3689,7 @@ public class SizeCompatTests extends WindowTestsBase { setUpDisplaySizeWithApp(1000, 2800); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); mWm.mLetterboxConfiguration.setIsVerticalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); final TestSplitOrganizer organizer = new TestSplitOrganizer(mAtm, mActivity.getDisplayContent()); @@ -3694,6 +3711,7 @@ public class SizeCompatTests extends WindowTestsBase { setUpDisplaySizeWithApp(1000, 2800); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); mWm.mLetterboxConfiguration.setIsVerticalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); // Unresizable landscape-only activity. prepareUnresizable(mActivity, 1.1f, SCREEN_ORIENTATION_LANDSCAPE); @@ -3715,6 +3733,7 @@ public class SizeCompatTests extends WindowTestsBase { setUpDisplaySizeWithApp(/* dw */ 1000, /* dh */ 2800); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); mWm.mLetterboxConfiguration.setIsVerticalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); prepareUnresizable(mActivity, SCREEN_ORIENTATION_LANDSCAPE); @@ -3731,6 +3750,7 @@ public class SizeCompatTests extends WindowTestsBase { setUpDisplaySizeWithApp(/* dw */ 2800, /* dh */ 1000); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); mWm.mLetterboxConfiguration.setIsHorizontalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); prepareUnresizable(mActivity, SCREEN_ORIENTATION_PORTRAIT); @@ -3747,6 +3767,7 @@ public class SizeCompatTests extends WindowTestsBase { // Portrait display setUpDisplaySizeWithApp(1400, 1600); mActivity.mWmService.mLetterboxConfiguration.setIsHorizontalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); // 16:9f unresizable portrait app prepareMinAspectRatio(mActivity, OVERRIDE_MIN_ASPECT_RATIO_LARGE_VALUE, @@ -3760,6 +3781,7 @@ public class SizeCompatTests extends WindowTestsBase { // Landscape display setUpDisplaySizeWithApp(1600, 1500); mActivity.mWmService.mLetterboxConfiguration.setIsVerticalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); // 16:9f unresizable landscape app prepareMinAspectRatio(mActivity, OVERRIDE_MIN_ASPECT_RATIO_LARGE_VALUE, @@ -3773,6 +3795,7 @@ public class SizeCompatTests extends WindowTestsBase { setUpDisplaySizeWithApp(2800, 1000); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); mWm.mLetterboxConfiguration.setIsHorizontalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); // Unresizable portrait-only activity. prepareUnresizable(mActivity, 1.1f, SCREEN_ORIENTATION_PORTRAIT); @@ -3794,6 +3817,7 @@ public class SizeCompatTests extends WindowTestsBase { setUpDisplaySizeWithApp(1800, 2200); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); mWm.mLetterboxConfiguration.setIsHorizontalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); // Unresizable portrait-only activity. prepareUnresizable(mActivity, SCREEN_ORIENTATION_PORTRAIT); @@ -3815,6 +3839,7 @@ public class SizeCompatTests extends WindowTestsBase { setUpDisplaySizeWithApp(2200, 1800); mActivity.mDisplayContent.setIgnoreOrientationRequest(true /* ignoreOrientationRequest */); mWm.mLetterboxConfiguration.setIsVerticalReachabilityEnabled(true); + setUpAllowThinLetterboxed(/* thinLetterboxAllowed */ true); // Unresizable landscape-only activity. prepareUnresizable(mActivity, SCREEN_ORIENTATION_LANDSCAPE); @@ -5011,6 +5036,14 @@ public class SizeCompatTests extends WindowTestsBase { assertFalse(activity.shouldSendCompatFakeFocus()); } + private void setUpAllowThinLetterboxed(boolean thinLetterboxAllowed) { + spyOn(mActivity.mLetterboxUiController); + doReturn(thinLetterboxAllowed).when(mActivity.mLetterboxUiController) + .allowVerticalReachabilityForThinLetterbox(); + doReturn(thinLetterboxAllowed).when(mActivity.mLetterboxUiController) + .allowHorizontalReachabilityForThinLetterbox(); + } + private int getExpectedSplitSize(int dimensionToSplit) { int dividerWindowWidth = mActivity.mWmService.mContext.getResources().getDimensionPixelSize( diff --git a/services/usage/java/com/android/server/usage/UsageStatsService.java b/services/usage/java/com/android/server/usage/UsageStatsService.java index 9d14290bdd8a..2e93cba80386 100644 --- a/services/usage/java/com/android/server/usage/UsageStatsService.java +++ b/services/usage/java/com/android/server/usage/UsageStatsService.java @@ -654,7 +654,10 @@ public class UsageStatsService extends SystemService implements } } else if (Intent.ACTION_USER_STARTED.equals(action)) { if (userId >= 0) { - mHandler.obtainMessage(MSG_USER_STARTED, userId, 0).sendToTarget(); + if (!Flags.disableIdleCheck() || userId > 0) { + // Don't check idle state for USER_SYSTEM during the boot up. + mHandler.obtainMessage(MSG_USER_STARTED, userId, 0).sendToTarget(); + } } } } @@ -2013,6 +2016,8 @@ public class UsageStatsService extends SystemService implements + ": " + Flags.useParceledList()); pw.println(" " + Flags.FLAG_FILTER_BASED_EVENT_QUERY_API + ": " + Flags.filterBasedEventQueryApi()); + pw.println(" " + Flags.FLAG_DISABLE_IDLE_CHECK + + ": " + Flags.disableIdleCheck()); final int[] userIds; synchronized (mLock) { diff --git a/wifi/wifi.aconfig b/wifi/wifi.aconfig index 3c734bc7e1e3..c5bc0396de34 100644 --- a/wifi/wifi.aconfig +++ b/wifi/wifi.aconfig @@ -9,3 +9,11 @@ flag { bug: "313038031" is_fixed_read_only: true } + +flag { + name: "network_provider_battery_charging_status" + is_exported: true + namespace: "wifi" + description: "Control the API that allows setting / reading the NetworkProviderInfo's battery charging status" + bug: "305067231" +} |