diff options
author | Roman Birg <roman@cyngn.com> | 2015-03-11 13:00:23 -0700 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-10-27 13:36:34 -0700 |
commit | 5a031e85d29cfea87af2b567a079629f1af882d5 (patch) | |
tree | 6aced4ea4b811c4e2f19d3e27e1f17a3f74aaf4a /src/com/android/settings/profiles | |
parent | c06cbc762f622acacad248105c02585220be9207 (diff) | |
download | packages_apps_Settings-5a031e85d29cfea87af2b567a079629f1af882d5.zip packages_apps_Settings-5a031e85d29cfea87af2b567a079629f1af882d5.tar.gz packages_apps_Settings-5a031e85d29cfea87af2b567a079629f1af882d5.tar.bz2 |
Settings: fix potential NPE when resetting profiles
When the user hits the positive button in the confirmation dialog to
reset profiles, we force a refresh of the profiles list. This can lead
to a NPE exception being thrown if it happens before the dialog actually
gets dismissed (and the ProfilesList fragment is actually attached)
since the reload list calls getPreferenceScreen(), which can be null,
since it is not attached.
After the dialog disappears, onResume() gets called in ProfilesList
anyways, so there's no need for a forced refresh.
Change-Id: I93de7115a69cc7545bf6a33de3a4abf5443658b9
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'src/com/android/settings/profiles')
-rw-r--r-- | src/com/android/settings/profiles/ProfilesSettings.java | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/com/android/settings/profiles/ProfilesSettings.java b/src/com/android/settings/profiles/ProfilesSettings.java index e03cc53..ed12663 100644 --- a/src/com/android/settings/profiles/ProfilesSettings.java +++ b/src/com/android/settings/profiles/ProfilesSettings.java @@ -210,7 +210,6 @@ public class ProfilesSettings extends SettingsPreferenceFragment { @Override public void onClick(DialogInterface dialog, int id) { mProfileManager.resetAll(); - mAdapter.refreshProfiles(); mProfileManager.setActiveProfile( mProfileManager.getActiveProfile().getUuid()); } |