OSDN Git Service

Occlude syncs without provider info.
authorCarlos Valdivia <carlosvaldivia@google.com>
Tue, 8 May 2012 23:39:15 +0000 (16:39 -0700)
committerCarlos Valdivia <carlosvaldivia@google.com>
Tue, 8 May 2012 23:39:15 +0000 (16:39 -0700)
Bug: 934147
Change-Id: Ib3413efda07432cfc52cb5b1a20350ed5c7655a8

src/com/android/settings/accounts/AccountSyncSettings.java

index 82f9844..4d9f80e 100644 (file)
@@ -208,11 +208,13 @@ public class AccountSyncSettings extends AccountPreferenceBase {
                 new SyncStateCheckBoxPreference(getActivity(), account, authority);
         item.setPersistent(false);
         final ProviderInfo providerInfo = getPackageManager().resolveContentProvider(authority, 0);
-        CharSequence providerLabel = providerInfo != null
-                ? providerInfo.loadLabel(getPackageManager()) : null;
+        if (providerInfo == null) {
+            return;
+        }
+        CharSequence providerLabel = providerInfo.loadLabel(getPackageManager());
         if (TextUtils.isEmpty(providerLabel)) {
             Log.e(TAG, "Provider needs a label for authority '" + authority + "'");
-            providerLabel = authority;
+            return;
         }
         String title = getString(R.string.sync_item_title, providerLabel);
         item.setTitle(title);