diff options
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/AccountPreference.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/settings/AccountPreference.java b/src/com/android/settings/AccountPreference.java index f3d7d51..f76d5cb 100644 --- a/src/com/android/settings/AccountPreference.java +++ b/src/com/android/settings/AccountPreference.java @@ -71,6 +71,7 @@ public class AccountPreference extends Preference { setSummary(getSyncStatusMessage(mStatus)); mSyncStatusIcon = (ImageView) view.findViewById(R.id.syncStatusIcon); mSyncStatusIcon.setImageResource(getSyncStatusIcon(mStatus)); + mSyncStatusIcon.setContentDescription(getSyncContentDescription(mStatus)); } public void setProviderIcon(Drawable icon) { @@ -126,6 +127,20 @@ public class AccountPreference extends Preference { return res; } + private String getSyncContentDescription(int status) { + switch (status) { + case SYNC_ENABLED: + return getContext().getString(R.string.accessibility_sync_enabled); + case SYNC_DISABLED: + return getContext().getString(R.string.accessibility_sync_disabled); + case SYNC_ERROR: + return getContext().getString(R.string.accessibility_sync_error); + default: + Log.e(TAG, "Unknown sync status: " + status); + return getContext().getString(R.string.accessibility_sync_error); + } + } + @Override public int compareTo(Preference other) { if (!(other instanceof AccountPreference)) { |