diff options
author | Andras Kloczl <andraskloczl@google.com> | 2020-07-08 14:24:07 +0100 |
---|---|---|
committer | Andras Kloczl <andraskloczl@google.com> | 2020-07-14 14:34:57 +0100 |
commit | 57154fbac328c16e5fa254693791dc65979a0b44 (patch) | |
tree | 17f056be5a78672f871d330b9778f03c94212d7c | |
parent | 9b01b8510ab611772866c5aebfdf79466bccf7fe (diff) | |
download | packages_apps_Settings-57154fbac328c16e5fa254693791dc65979a0b44.tar.gz packages_apps_Settings-57154fbac328c16e5fa254693791dc65979a0b44.tar.bz2 packages_apps_Settings-57154fbac328c16e5fa254693791dc65979a0b44.zip |
Fix multi user crash when Add guest was tapped multiple times
When "Add guest" got tapped multiple times then the first click starts
the guest creation process which blocks the UI thread for around 2-3
seconds, then triggers the open guest details intent, and the second
tap event starts another guest creation, but it fails (since there
can't be more than 1 guest on the device) and returns null, and in the
openUserDetails we get NullPointerException.
Test: manual test
Video: http://shortn/_i4Dce33yhl
Bug: 160267016
Change-Id: I9a4f0a91295e336d246abe5f5470682a14cb510f
-rw-r--r-- | src/com/android/settings/users/UserSettings.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java index 910917a3ad..9669190ec9 100644 --- a/src/com/android/settings/users/UserSettings.java +++ b/src/com/android/settings/users/UserSettings.java @@ -1064,6 +1064,7 @@ public class UserSettings extends SettingsPreferenceFragment } return true; } else if (pref == mAddGuest) { + mAddGuest.setEnabled(false); // prevent multiple tap issue UserInfo guest = mUserManager.createGuest( getContext(), getString(com.android.settingslib.R.string.user_guest)); openUserDetails(guest, true); |