Fix user icon visibility bugs
Remove call that made user icon VISIBLE whenever view was attached. This
fixes issue where lock screen user icon was shown in QS after phone was
unlocked.
Also, remove call that made user icon GONE whenever the current user is
null. This could cause the user switcher icon to erroneously disappear.
Instead, handle the null case by drawing a default user icon.
Additionally,
- Remove unused dependency on UserManager
- Add fallback TalkBack announcement if current user is null so it does
not announce "unlabeled, double-tap to choose user." Instead it will
now announce "Switch user, double-tap to choose user."
- Remove redundant/unnecessary calls in getCurrentUserIcon
- mCurrentUser.isCurrentUser is redundant
- mCurrentUser.isSwitchToEnabled should not affect how icon is drawn
- Call to mAdapter.getIconDrawable is unnecessary because all it
does is check for whether it should drawn an "Add user" icon, but
the lock screen user icon should never be an "Add user" icon
Test: With config_keyguard_user_switch_opens_qs_details=true,
disable lock screen for owner, then run adb shell am restart.
Open QS, ensure that user icon isn't shown in the upper right.
Fixes: 190062147
Change-Id: Ieb9a9274af452b69c0a916afb3ef0e177cab8d0d
1 file changed