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
diff --git a/src/com/android/settings/Settings.java b/src/com/android/settings/Settings.java
index e8a8f46..ebbec5dd 100644
--- a/src/com/android/settings/Settings.java
+++ b/src/com/android/settings/Settings.java
@@ -439,6 +439,10 @@
         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 @@
             mWifiEnabler.resume();
             mBluetoothEnabler.resume();
         }
-        
+
         public void pause() {
             mWifiEnabler.pause();
             mBluetoothEnabler.pause();