From 226f36d2a5f7969a3c6063d3454355f762fd229a Mon Sep 17 00:00:00 2001 From: Jordan Demeulenaere Date: Tue, 6 Sep 2022 17:28:52 +0200 Subject: [PATCH] Enable the new footer actions for everyone This CL enables the new implementation of the footer actions for everyone. Before this CL, this flag was enabled in teamfood on QPR1 builds starting from TQ1A.220827.001 [1]. Code of the old implementation will be removed in a few weeks, once the new implementation has soaked in a bit. [1] https://android-build.googleplex.com/builds/where-is-my-cl/search/I838318277693d4c7b0c0c6e53df9e16ff1572091 Test: Manual Bug: 242040009 Change-Id: If0305c70dcce3a8004c29e42f4d3188ce74dfa6a --- packages/SystemUI/res-keyguard/layout/footer_actions.xml | 4 ++-- packages/SystemUI/res/values/ids.xml | 5 +++++ packages/SystemUI/src/com/android/systemui/flags/Flags.java | 2 +- .../systemui/qs/footer/ui/binder/FooterActionsViewBinder.kt | 1 + .../qs/footer/ui/viewmodel/FooterActionsButtonViewModel.kt | 1 + .../qs/footer/ui/viewmodel/FooterActionsViewModel.kt | 3 +++ 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/res-keyguard/layout/footer_actions.xml b/packages/SystemUI/res-keyguard/layout/footer_actions.xml index 1ce106ed2156d..716c4fe1eb651 100644 --- a/packages/SystemUI/res-keyguard/layout/footer_actions.xml +++ b/packages/SystemUI/res-keyguard/layout/footer_actions.xml @@ -61,7 +61,7 @@ + + + + + diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.java b/packages/SystemUI/src/com/android/systemui/flags/Flags.java index 07d3b6dd688b9..33fd7f48d40d0 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.java +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.java @@ -155,7 +155,7 @@ public class Flags { public static final ResourceBooleanFlag FULL_SCREEN_USER_SWITCHER = new ResourceBooleanFlag(506, R.bool.config_enableFullscreenUserSwitcher); - public static final UnreleasedFlag NEW_FOOTER_ACTIONS = new UnreleasedFlag(507, true); + public static final ReleasedFlag NEW_FOOTER_ACTIONS = new ReleasedFlag(507); /***************************************/ // 600- status bar diff --git a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/binder/FooterActionsViewBinder.kt b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/binder/FooterActionsViewBinder.kt index 28ddead0bdd9b..dd1ffcc9fa127 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/binder/FooterActionsViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/binder/FooterActionsViewBinder.kt @@ -222,6 +222,7 @@ object FooterActionsViewBinder { private fun bindButton(button: IconButtonViewHolder, model: FooterActionsButtonViewModel?) { val buttonView = button.view + buttonView.id = model?.id ?: View.NO_ID buttonView.isVisible = model != null if (model == null) { return diff --git a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsButtonViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsButtonViewModel.kt index 2ad0513c2acef..5a8f6849212a2 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsButtonViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsButtonViewModel.kt @@ -25,6 +25,7 @@ import com.android.systemui.common.shared.model.Icon * power buttons. */ data class FooterActionsButtonViewModel( + val id: Int?, val icon: Icon, val iconTint: Int?, @DrawableRes val background: Int, diff --git a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt index a935338c25657..8b3f4b4ee350a 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt +++ b/packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt @@ -138,6 +138,7 @@ class FooterActionsViewModel( /** The model for the settings button. */ val settings: FooterActionsButtonViewModel = FooterActionsButtonViewModel( + id = R.id.settings_button_container, Icon.Resource( R.drawable.ic_settings, ContentDescription.Resource(R.string.accessibility_quick_settings_settings) @@ -151,6 +152,7 @@ class FooterActionsViewModel( val power: FooterActionsButtonViewModel? = if (showPowerButton) { FooterActionsButtonViewModel( + id = R.id.pm_lite, Icon.Resource( android.R.drawable.ic_lock_power_off, ContentDescription.Resource(R.string.accessibility_quick_settings_power_menu) @@ -256,6 +258,7 @@ class FooterActionsViewModel( } return FooterActionsButtonViewModel( + id = null, Icon.Loaded( icon, ContentDescription.Loaded(userSwitcherContentDescription(status.currentUserName)),