Modify account settings for better locale resolution

Bug: 16282173
Change-Id: I2ab861464cdbbb1c1b0a5a7231f960d8ed9e90c6
This commit is contained in:
Alexandra Gherghina
2014-08-11 12:40:13 +01:00
parent 2d93f36f00
commit 62464b819e
4 changed files with 135 additions and 17 deletions

View File

@@ -147,6 +147,33 @@ final public class AuthenticatorHelper extends BroadcastReceiver {
return label;
}
/**
* Gets the package associated with a particular account type. If none found, return null.
* @param accountType the type of account
* @return the package name or null if one cannot be found.
*/
public String getPackageForType(final String accountType) {
if (mTypeToAuthDescription.containsKey(accountType)) {
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
return desc.packageName;
}
return null;
}
/**
* Gets the resource id of the label associated with a particular account type. If none found,
* return -1.
* @param accountType the type of account
* @return a resource id for the label or -1 if none found;
*/
public int getLabelIdForType(final String accountType) {
if (mTypeToAuthDescription.containsKey(accountType)) {
AuthenticatorDescription desc = mTypeToAuthDescription.get(accountType);
return desc.labelId;
}
return -1;
}
/**
* Updates provider icons. Subclasses should call this in onCreate()
* and update any UI that depends on AuthenticatorDescriptions in onAuthDescriptionsUpdated().