From baad236610c963c36f0608410c831c04224d0369 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Fri, 23 Aug 2019 12:35:34 -0400 Subject: [PATCH] Makes current user not clickable When clicking on the current user, SystemUI will try to switch to the current user and fail silently. There's no reason to go to that path, as we could prevent the current user from being clickable. The only times the current user should be clickable is if it's a Guest (and we want to remove it). By making the current user not clickable, TB will not announce it as such and will not create confusion. Fixes: 139920678 Test: manual, switching accounts and into Guest Change-Id: I413f62c9e23249c92b192ed4fb4974d75c1543c5 --- .../src/com/android/systemui/qs/tiles/UserDetailView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java index 91d38bd075bf8..d6dad687e5d47 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java @@ -76,8 +76,11 @@ public class UserDetailView extends PseudoGridView { UserSwitcherController.UserRecord item) { UserDetailItemView v = UserDetailItemView.convertOrInflate( mContext, convertView, parent); - if (v != convertView) { + if ((v != convertView && !item.isCurrent) || item.isGuest) { v.setOnClickListener(this); + } else { + v.setOnClickListener(null); + v.setClickable(false); } String name = getName(mContext, item); if (item.picture == null) {