Merge "Removes user icon tinting." into tm-qpr-dev am: 6b07231084
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20197765 Change-Id: I799edc2299a0e8956ee1a0c7b49d165a8c91e307 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -23,7 +23,6 @@ import androidx.lifecycle.DefaultLifecycleObserver
|
|||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.LifecycleOwner
|
import androidx.lifecycle.LifecycleOwner
|
||||||
import com.android.settingslib.Utils
|
import com.android.settingslib.Utils
|
||||||
import com.android.settingslib.drawable.UserIconDrawable
|
|
||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
import com.android.systemui.animation.Expandable
|
import com.android.systemui.animation.Expandable
|
||||||
import com.android.systemui.common.shared.model.ContentDescription
|
import com.android.systemui.common.shared.model.ContentDescription
|
||||||
@@ -250,22 +249,19 @@ class FooterActionsViewModel(
|
|||||||
status: UserSwitcherStatusModel.Enabled
|
status: UserSwitcherStatusModel.Enabled
|
||||||
): FooterActionsButtonViewModel {
|
): FooterActionsButtonViewModel {
|
||||||
val icon = status.currentUserImage!!
|
val icon = status.currentUserImage!!
|
||||||
val iconTint =
|
|
||||||
if (status.isGuestUser && icon !is UserIconDrawable) {
|
|
||||||
Utils.getColorAttrDefaultColor(context, android.R.attr.colorForeground)
|
|
||||||
} else {
|
|
||||||
null
|
|
||||||
}
|
|
||||||
|
|
||||||
return FooterActionsButtonViewModel(
|
return FooterActionsButtonViewModel(
|
||||||
id = R.id.multi_user_switch,
|
id = R.id.multi_user_switch,
|
||||||
Icon.Loaded(
|
icon =
|
||||||
icon,
|
Icon.Loaded(
|
||||||
ContentDescription.Loaded(userSwitcherContentDescription(status.currentUserName)),
|
icon,
|
||||||
),
|
ContentDescription.Loaded(
|
||||||
iconTint,
|
userSwitcherContentDescription(status.currentUserName)
|
||||||
R.drawable.qs_footer_action_circle,
|
),
|
||||||
this::onUserSwitcherClicked,
|
),
|
||||||
|
iconTint = null,
|
||||||
|
background = R.drawable.qs_footer_action_circle,
|
||||||
|
onClick = this::onUserSwitcherClicked,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,16 +192,6 @@ class FooterActionsViewModelTest : SysuiTestCase() {
|
|||||||
// UserManager change.
|
// UserManager change.
|
||||||
assertThat(iconTint()).isNull()
|
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
|
// Make sure we don't tint the icon if it is a user image (and not the default image), even
|
||||||
// in guest mode.
|
// in guest mode.
|
||||||
userInfoController.updateInfo { this.picture = mock<UserIconDrawable>() }
|
userInfoController.updateInfo { this.picture = mock<UserIconDrawable>() }
|
||||||
|
|||||||
Reference in New Issue
Block a user