diff options
author | Brian Muramatsu <btmura@google.com> | 2012-06-28 14:25:14 -0700 |
---|---|---|
committer | Brian Muramatsu <btmura@google.com> | 2012-06-28 14:25:14 -0700 |
commit | c28af52e596230e53e910078a8474e19fea6ed57 (patch) | |
tree | 8c8d1fb149460acda7bc827204aef799b37536dd /src | |
parent | c812fe4c0e989fcea906a6dda7c88a55076cd50d (diff) | |
download | packages_apps_settings-c28af52e596230e53e910078a8474e19fea6ed57.zip packages_apps_settings-c28af52e596230e53e910078a8474e19fea6ed57.tar.gz packages_apps_settings-c28af52e596230e53e910078a8474e19fea6ed57.tar.bz2 |
Fix Settings NPE
Labels for account types can be null which causes a NPE to occur in
Settings. If the label is null, don't bother adding an account
header. If we don't do this, then it would blow up when trying to
sort the headers anyway, so this change will fix the crash.
Bug 6727947
Change-Id: I284d7204b6d21c8d1b0a36e18ecae2c2361eeb84
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/Settings.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java index e8a8f46..ebbec5d 100644 --- a/src/com/android/settings/Settings.java +++ b/src/com/android/settings/Settings.java @@ -439,6 +439,10 @@ public class Settings extends PreferenceActivity List<Header> accountHeaders = new ArrayList<Header>(accountTypes.length); for (String accountType : accountTypes) { CharSequence label = mAuthenticatorHelper.getLabelForType(this, accountType); + if (label == null) { + continue; + } + Account[] accounts = AccountManager.get(this).getAccountsByType(accountType); boolean skipToAccount = accounts.length == 1 && !mAuthenticatorHelper.hasAccountPreferences(accountType); @@ -689,7 +693,7 @@ public class Settings extends PreferenceActivity mWifiEnabler.resume(); mBluetoothEnabler.resume(); } - + public void pause() { mWifiEnabler.pause(); mBluetoothEnabler.pause(); |