diff options
author | Brian Carlstrom <bdc@google.com> | 2011-02-14 10:16:39 -0800 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2011-04-07 11:58:39 -0700 |
commit | d26321eecb481528c5e54a608f2f3c4cc26d8a77 (patch) | |
tree | 73d3c79772244cb91f6cef0f3747b073afb260e8 | |
parent | 74562a13a373e0bd82c641479acacb932894e3cd (diff) | |
download | packages_apps_settings-d26321eecb481528c5e54a608f2f3c4cc26d8a77.zip packages_apps_settings-d26321eecb481528c5e54a608f2f3c4cc26d8a77.tar.gz packages_apps_settings-d26321eecb481528c5e54a608f2f3c4cc26d8a77.tar.bz2 |
Tolerate missing AccountManager resource, not just missing resource name
Change-Id: I29ceed33a9cc8e697bfd3226f6ec58291c36daae
-rw-r--r-- | src/com/android/settings/accounts/AccountPreferenceBase.java | 14 | ||||
-rw-r--r-- | src/com/android/settings/accounts/ChooseAccountActivity.java | 10 |
2 files changed, 19 insertions, 5 deletions
diff --git a/src/com/android/settings/accounts/AccountPreferenceBase.java b/src/com/android/settings/accounts/AccountPreferenceBase.java index a84bece..a0d6a7f 100644 --- a/src/com/android/settings/accounts/AccountPreferenceBase.java +++ b/src/com/android/settings/accounts/AccountPreferenceBase.java @@ -32,6 +32,7 @@ import android.content.Context; import android.content.SyncAdapterType; import android.content.SyncStatusObserver; import android.content.pm.PackageManager; +import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.os.Handler; @@ -113,7 +114,7 @@ class AccountPreferenceBase extends SettingsPreferenceFragment mAccountTypeToAuthorities.put(sa.accountType, authorities); } if (Log.isLoggable(TAG, Log.VERBOSE)) { - Log.d(TAG, "added authority " + sa.authority + " to accountType " + Log.d(TAG, "added authority " + sa.authority + " to accountType " + sa.accountType); } authorities.add(sa.authority); @@ -136,7 +137,10 @@ class AccountPreferenceBase extends SettingsPreferenceFragment icon = authContext.getResources().getDrawable(desc.iconId); } catch (PackageManager.NameNotFoundException e) { // TODO: place holder icon for missing account icons? - Log.w(TAG, "No icon for account type " + accountType); + Log.w(TAG, "No icon name for account type " + accountType); + } catch (Resources.NotFoundException e) { + // TODO: place holder icon for missing account icons? + Log.w(TAG, "No icon resource for account type " + accountType); } } return icon; @@ -155,7 +159,9 @@ class AccountPreferenceBase extends SettingsPreferenceFragment Context authContext = getActivity().createPackageContext(desc.packageName, 0); label = authContext.getResources().getText(desc.labelId); } catch (PackageManager.NameNotFoundException e) { - Log.w(TAG, "No label for account type " + ", type " + accountType); + Log.w(TAG, "No label name for account type " + accountType); + } catch (Resources.NotFoundException e) { + Log.w(TAG, "No label icon for account type " + accountType); } } return label; @@ -179,6 +185,8 @@ class AccountPreferenceBase extends SettingsPreferenceFragment } } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "Couldn't load preferences.xml file from " + desc.packageName); + } catch (Resources.NotFoundException e) { + Log.w(TAG, "Couldn't load preferences.xml file from " + desc.packageName); } } return prefs; diff --git a/src/com/android/settings/accounts/ChooseAccountActivity.java b/src/com/android/settings/accounts/ChooseAccountActivity.java index 9576dee..631fe47 100644 --- a/src/com/android/settings/accounts/ChooseAccountActivity.java +++ b/src/com/android/settings/accounts/ChooseAccountActivity.java @@ -23,6 +23,7 @@ import android.content.Context; import android.content.Intent; import android.content.SyncAdapterType; import android.content.pm.PackageManager; +import android.content.res.Resources; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.preference.Preference; @@ -199,7 +200,10 @@ public class ChooseAccountActivity extends PreferenceActivity { icon = authContext.getResources().getDrawable(desc.iconId); } catch (PackageManager.NameNotFoundException e) { // TODO: place holder icon for missing account icons? - Log.w(TAG, "No icon for account type " + accountType); + Log.w(TAG, "No icon name for account type " + accountType); + } catch (Resources.NotFoundException e) { + // TODO: place holder icon for missing account icons? + Log.w(TAG, "No icon resource for account type " + accountType); } } return icon; @@ -218,7 +222,9 @@ public class ChooseAccountActivity extends PreferenceActivity { Context authContext = createPackageContext(desc.packageName, 0); label = authContext.getResources().getText(desc.labelId); } catch (PackageManager.NameNotFoundException e) { - Log.w(TAG, "No label for account type " + ", type " + accountType); + Log.w(TAG, "No label name for account type " + accountType); + } catch (Resources.NotFoundException e) { + Log.w(TAG, "No label resource for account type " + accountType); } } return label; |