@Override public Object call(Object who, Method method, Object... args) throws Throwable { return Mgr.getAuthenticatorTypes(); } }
/** * Return a set of account types specified by the intent as well as supported by the * AccountManager. */ private Set<String> getReleventAccountTypes(final Intent intent) { // An account type is relevant iff it is allowed by the caller and supported by the account // manager. Set<String> setOfRelevantAccountTypes; final String[] allowedAccountTypes = intent.getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY); AuthenticatorDescription[] descs = VAccountManager.get().getAuthenticatorTypes(); Set<String> supportedAccountTypes = new HashSet<String>(descs.length); for (AuthenticatorDescription desc : descs) { supportedAccountTypes.add(desc.type); } if (allowedAccountTypes != null) { setOfRelevantAccountTypes = new HashSet<>(); Collections.addAll(setOfRelevantAccountTypes, allowedAccountTypes); setOfRelevantAccountTypes.retainAll(supportedAccountTypes); } else { setOfRelevantAccountTypes = supportedAccountTypes; } return setOfRelevantAccountTypes; }
private void buildTypeToAuthDescriptionMap() { for(AuthenticatorDescription desc : VAccountManager.get().getAuthenticatorTypes()) { String name = null; Drawable icon = null; try { Resources res = VirtualCore.get().getResources(desc.packageName); icon = res.getDrawable(desc.iconId); final CharSequence sequence = res.getText(desc.labelId); name = sequence.toString(); name = sequence.toString(); } catch (Resources.NotFoundException e) { // Nothing we can do much here, just log VLog.w(TAG, "No icon resource for account type " + desc.type); } AuthInfo authInfo = new AuthInfo(desc, name, icon); mTypeToAuthenticatorInfo.put(desc.type, authInfo); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { return Mgr.getAuthenticatorTypes(); } }
@Override public Object call(Object who, Method method, Object... args) throws Throwable { return Mgr.getAuthenticatorTypes(); } }
/** * Return a set of account types specified by the intent as well as supported by the * AccountManager. */ private Set<String> getReleventAccountTypes(final Intent intent) { // An account type is relevant iff it is allowed by the caller and supported by the account // manager. Set<String> setOfRelevantAccountTypes; final String[] allowedAccountTypes = intent.getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY); AuthenticatorDescription[] descs = VAccountManager.get().getAuthenticatorTypes(); Set<String> supportedAccountTypes = new HashSet<String>(descs.length); for (AuthenticatorDescription desc : descs) { supportedAccountTypes.add(desc.type); } if (allowedAccountTypes != null) { setOfRelevantAccountTypes = new HashSet<>(); Collections.addAll(setOfRelevantAccountTypes, allowedAccountTypes); setOfRelevantAccountTypes.retainAll(supportedAccountTypes); } else { setOfRelevantAccountTypes = supportedAccountTypes; } return setOfRelevantAccountTypes; }
/** * Return a set of account types specified by the intent as well as supported by the * AccountManager. */ private Set<String> getReleventAccountTypes(final Intent intent) { // An account type is relevant iff it is allowed by the caller and supported by the account // manager. Set<String> setOfRelevantAccountTypes; final String[] allowedAccountTypes = intent.getStringArrayExtra(EXTRA_ALLOWABLE_ACCOUNT_TYPES_STRING_ARRAY); AuthenticatorDescription[] descs = VAccountManager.get().getAuthenticatorTypes(); Set<String> supportedAccountTypes = new HashSet<String>(descs.length); for (AuthenticatorDescription desc : descs) { supportedAccountTypes.add(desc.type); } if (allowedAccountTypes != null) { setOfRelevantAccountTypes = new HashSet<>(); Collections.addAll(setOfRelevantAccountTypes, allowedAccountTypes); setOfRelevantAccountTypes.retainAll(supportedAccountTypes); } else { setOfRelevantAccountTypes = supportedAccountTypes; } return setOfRelevantAccountTypes; }
private void buildTypeToAuthDescriptionMap() { for(AuthenticatorDescription desc : VAccountManager.get().getAuthenticatorTypes()) { String name = null; Drawable icon = null; try { Resources res = VirtualCore.get().getResources(desc.packageName); icon = res.getDrawable(desc.iconId); final CharSequence sequence = res.getText(desc.labelId); name = sequence.toString(); name = sequence.toString(); } catch (Resources.NotFoundException e) { // Nothing we can do much here, just log VLog.w(TAG, "No icon resource for account type " + desc.type); } AuthInfo authInfo = new AuthInfo(desc, name, icon); mTypeToAuthenticatorInfo.put(desc.type, authInfo); } }
private void buildTypeToAuthDescriptionMap() { for(AuthenticatorDescription desc : VAccountManager.get().getAuthenticatorTypes()) { String name = null; Drawable icon = null; try { Resources res = VirtualCore.get().getResources(desc.packageName); icon = res.getDrawable(desc.iconId); final CharSequence sequence = res.getText(desc.labelId); name = sequence.toString(); name = sequence.toString(); } catch (Resources.NotFoundException e) { // Nothing we can do much here, just log VLog.w(TAG, "No icon resource for account type " + desc.type); } AuthInfo authInfo = new AuthInfo(desc, name, icon); mTypeToAuthenticatorInfo.put(desc.type, authInfo); } }