public void refreshAuthenticatorCache(String packageName) { cache.authenticators.clear(); Intent intent = new Intent(AccountManager.ACTION_AUTHENTICATOR_INTENT); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices(intent, null, PackageManager.GET_META_DATA, 0), cache.authenticators, new RegisteredServicesParser()); }
private void generateServicesMap(List<ResolveInfo> services, Map<String, SyncAdapterInfo> map, RegisteredServicesParser accountParser) { for (ResolveInfo info : services) { XmlResourceParser parser = accountParser.getParser(mContext, info.serviceInfo, "android.content.SyncAdapter"); if (parser != null) { try { AttributeSet attributeSet = Xml.asAttributeSet(parser); int type; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.START_TAG) { // Nothing to do } if ("sync-adapter".equals(parser.getName())) { SyncAdapterType adapterType = parseSyncAdapterType( accountParser.getResources(mContext, info.serviceInfo.applicationInfo), attributeSet); if (adapterType != null) { String key = adapterType.accountType + "/" + adapterType.authority; map.put(key, new SyncAdapterInfo(adapterType, info.serviceInfo)); } } } catch (Exception e) { e.printStackTrace(); } } } }
public XmlResourceParser getParser(Context context, ServiceInfo serviceInfo, String name) { Bundle meta = serviceInfo.metaData; if (meta != null) { int xmlId = meta.getInt(name); if (xmlId != 0) { try { return getResources(context, serviceInfo.applicationInfo).getXml(xmlId); } catch (Exception e) { e.printStackTrace(); } } } return null; }
public XmlResourceParser getParser(Context context, ServiceInfo serviceInfo, String name) { Bundle meta = serviceInfo.metaData; if (meta != null) { int xmlId = meta.getInt(name); if (xmlId != 0) { try { return getResources(context, serviceInfo.applicationInfo).getXml(xmlId); } catch (Exception e) { e.printStackTrace(); } } } return null; }
private void generateServicesMap(List<ResolveInfo> services, Map<String, AuthenticatorInfo> map, RegisteredServicesParser accountParser) { for (ResolveInfo info : services) { XmlResourceParser parser = accountParser.getParser(mContext, info.serviceInfo, AccountManager.AUTHENTICATOR_META_DATA_NAME); if (parser != null) { try { AttributeSet attributeSet = Xml.asAttributeSet(parser); int type; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.START_TAG) { // Nothing to do } if (AccountManager.AUTHENTICATOR_ATTRIBUTES_NAME.equals(parser.getName())) { AuthenticatorDescription desc = parseAuthenticatorDescription( accountParser.getResources(mContext, info.serviceInfo.applicationInfo), info.serviceInfo.packageName, attributeSet); if (desc != null) { map.put(desc.type, new AuthenticatorInfo(desc, info.serviceInfo)); } } } catch (Exception e) { e.printStackTrace(); } } } }
public void refreshServiceCache(String packageName) { Intent intent = new Intent("android.content.SyncAdapter"); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices( intent, null, PackageManager.GET_META_DATA, 0 ), mAppSyncAdapterInfos, new RegisteredServicesParser() ); }
public XmlResourceParser getParser(Context context, ServiceInfo serviceInfo, String name) { Bundle meta = serviceInfo.metaData; if (meta != null) { int xmlId = meta.getInt(name); if (xmlId != 0) { try { return getResources(context, serviceInfo.applicationInfo).getXml(xmlId); } catch (Exception e) { e.printStackTrace(); } } } return null; }
private void generateServicesMap(List<ResolveInfo> services, Map<String, SyncAdapterInfo> map, RegisteredServicesParser accountParser) { for (ResolveInfo info : services) { XmlResourceParser parser = accountParser.getParser(mContext, info.serviceInfo, "android.content.SyncAdapter"); if (parser != null) { try { AttributeSet attributeSet = Xml.asAttributeSet(parser); int type; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.START_TAG) { // Nothing to do } if ("sync-adapter".equals(parser.getName())) { SyncAdapterType adapterType = parseSyncAdapterType( accountParser.getResources(mContext, info.serviceInfo.applicationInfo), attributeSet); if (adapterType != null) { String key = adapterType.accountType + "/" + adapterType.authority; map.put(key, new SyncAdapterInfo(adapterType, info.serviceInfo)); } } } catch (Exception e) { e.printStackTrace(); } } } }
public void refreshAuthenticatorCache(String packageName) { cache.authenticators.clear(); Intent intent = new Intent(AccountManager.ACTION_AUTHENTICATOR_INTENT); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices(intent, null, PackageManager.GET_META_DATA, 0), cache.authenticators, new RegisteredServicesParser()); }
private void generateServicesMap(List<ResolveInfo> services, Map<String, SyncAdapterInfo> map, RegisteredServicesParser accountParser) { for (ResolveInfo info : services) { XmlResourceParser parser = accountParser.getParser(mContext, info.serviceInfo, "android.content.SyncAdapter"); if (parser != null) { try { AttributeSet attributeSet = Xml.asAttributeSet(parser); int type; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.START_TAG) { // Nothing to do } if ("sync-adapter".equals(parser.getName())) { SyncAdapterType adapterType = parseSyncAdapterType( accountParser.getResources(mContext, info.serviceInfo.applicationInfo), attributeSet); if (adapterType != null) { String key = adapterType.accountType + "/" + adapterType.authority; map.put(key, new SyncAdapterInfo(adapterType, info.serviceInfo)); } } } catch (Exception e) { e.printStackTrace(); } } } }
public void refreshAuthenticatorCache(String packageName) { cache.authenticators.clear(); Intent intent = new Intent(AccountManager.ACTION_AUTHENTICATOR_INTENT); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices(intent, null, PackageManager.GET_META_DATA, 0), cache.authenticators, new RegisteredServicesParser()); }
private void generateServicesMap(List<ResolveInfo> services, Map<String, AuthenticatorInfo> map, RegisteredServicesParser accountParser) { for (ResolveInfo info : services) { XmlResourceParser parser = accountParser.getParser(mContext, info.serviceInfo, AccountManager.AUTHENTICATOR_META_DATA_NAME); if (parser != null) { try { AttributeSet attributeSet = Xml.asAttributeSet(parser); int type; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.START_TAG) { // Nothing to do } if (AccountManager.AUTHENTICATOR_ATTRIBUTES_NAME.equals(parser.getName())) { AuthenticatorDescription desc = parseAuthenticatorDescription( accountParser.getResources(mContext, info.serviceInfo.applicationInfo), info.serviceInfo.packageName, attributeSet); if (desc != null) { map.put(desc.type, new AuthenticatorInfo(desc, info.serviceInfo)); } } } catch (Exception e) { e.printStackTrace(); } } } }
public void refreshServiceCache(String packageName) { Intent intent = new Intent("android.content.SyncAdapter"); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices( intent, null, PackageManager.GET_META_DATA, 0 ), mAppSyncAdapterInfos, new RegisteredServicesParser() ); }
private void generateServicesMap(List<ResolveInfo> services, Map<String, AuthenticatorInfo> map, RegisteredServicesParser accountParser) { for (ResolveInfo info : services) { XmlResourceParser parser = accountParser.getParser(mContext, info.serviceInfo, AccountManager.AUTHENTICATOR_META_DATA_NAME); if (parser != null) { try { AttributeSet attributeSet = Xml.asAttributeSet(parser); int type; while ((type = parser.next()) != XmlPullParser.END_DOCUMENT && type != XmlPullParser.START_TAG) { // Nothing to do } if (AccountManager.AUTHENTICATOR_ATTRIBUTES_NAME.equals(parser.getName())) { AuthenticatorDescription desc = parseAuthenticatorDescription( accountParser.getResources(mContext, info.serviceInfo.applicationInfo), info.serviceInfo.packageName, attributeSet); if (desc != null) { map.put(desc.type, new AuthenticatorInfo(desc, info.serviceInfo)); } } } catch (Exception e) { e.printStackTrace(); } } } }
public void refreshServiceCache(String packageName) { Intent intent = new Intent("android.content.SyncAdapter"); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices( intent, null, PackageManager.GET_META_DATA, 0 ), mAppSyncAdapterInfos, new RegisteredServicesParser() ); }