Loading packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt +10 −14 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleOwner import com.android.settingslib.Utils import com.android.settingslib.drawable.UserIconDrawable import com.android.systemui.R import com.android.systemui.animation.Expandable import com.android.systemui.common.shared.model.ContentDescription Loading Loading @@ -250,22 +249,19 @@ class FooterActionsViewModel( status: UserSwitcherStatusModel.Enabled ): FooterActionsButtonViewModel { val icon = status.currentUserImage!! val iconTint = if (status.isGuestUser && icon !is UserIconDrawable) { Utils.getColorAttrDefaultColor(context, android.R.attr.colorForeground) } else { null } return FooterActionsButtonViewModel( id = R.id.multi_user_switch, icon = Icon.Loaded( icon, ContentDescription.Loaded(userSwitcherContentDescription(status.currentUserName)), ContentDescription.Loaded( userSwitcherContentDescription(status.currentUserName) ), iconTint, R.drawable.qs_footer_action_circle, this::onUserSwitcherClicked, ), iconTint = null, background = R.drawable.qs_footer_action_circle, onClick = this::onUserSwitcherClicked, ) } Loading packages/SystemUI/tests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt +0 −10 Original line number Diff line number Diff line Loading @@ -192,16 +192,6 @@ class FooterActionsViewModelTest : SysuiTestCase() { // UserManager change. assertThat(iconTint()).isNull() // Trigger a user info change: there should now be a tint. userInfoController.updateInfo { userAccount = "doe" } assertThat(iconTint()) .isEqualTo( Utils.getColorAttrDefaultColor( context, android.R.attr.colorForeground, ) ) // Make sure we don't tint the icon if it is a user image (and not the default image), even // in guest mode. userInfoController.updateInfo { this.picture = mock<UserIconDrawable>() } Loading Loading
packages/SystemUI/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModel.kt +10 −14 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleOwner import com.android.settingslib.Utils import com.android.settingslib.drawable.UserIconDrawable import com.android.systemui.R import com.android.systemui.animation.Expandable import com.android.systemui.common.shared.model.ContentDescription Loading Loading @@ -250,22 +249,19 @@ class FooterActionsViewModel( status: UserSwitcherStatusModel.Enabled ): FooterActionsButtonViewModel { val icon = status.currentUserImage!! val iconTint = if (status.isGuestUser && icon !is UserIconDrawable) { Utils.getColorAttrDefaultColor(context, android.R.attr.colorForeground) } else { null } return FooterActionsButtonViewModel( id = R.id.multi_user_switch, icon = Icon.Loaded( icon, ContentDescription.Loaded(userSwitcherContentDescription(status.currentUserName)), ContentDescription.Loaded( userSwitcherContentDescription(status.currentUserName) ), iconTint, R.drawable.qs_footer_action_circle, this::onUserSwitcherClicked, ), iconTint = null, background = R.drawable.qs_footer_action_circle, onClick = this::onUserSwitcherClicked, ) } Loading
packages/SystemUI/tests/src/com/android/systemui/qs/footer/ui/viewmodel/FooterActionsViewModelTest.kt +0 −10 Original line number Diff line number Diff line Loading @@ -192,16 +192,6 @@ class FooterActionsViewModelTest : SysuiTestCase() { // UserManager change. assertThat(iconTint()).isNull() // Trigger a user info change: there should now be a tint. userInfoController.updateInfo { userAccount = "doe" } assertThat(iconTint()) .isEqualTo( Utils.getColorAttrDefaultColor( context, android.R.attr.colorForeground, ) ) // Make sure we don't tint the icon if it is a user image (and not the default image), even // in guest mode. userInfoController.updateInfo { this.picture = mock<UserIconDrawable>() } Loading