congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
RegisteredServicesParser
Code IndexAdd Tabnine to your IDE (free)

How to use
RegisteredServicesParser
in
com.lody.virtual.server.accounts

Best Java code snippets using com.lody.virtual.server.accounts.RegisteredServicesParser (Showing top 15 results out of 315)

origin: android-hacker/VirtualXposed

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());
}
origin: android-hacker/VirtualXposed

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();
      }
    }
  }
}
origin: android-hacker/VirtualXposed

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;
}
origin: darkskygit/VirtualApp

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;
}
origin: android-hacker/VirtualXposed

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();
      }
    }
  }
}
origin: android-hacker/VirtualXposed

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()
  );
}
origin: bzsome/VirtualApp-x326

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;
}
origin: bzsome/VirtualApp-x326

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();
      }
    }
  }
}
origin: bzsome/VirtualApp-x326

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());
}
origin: darkskygit/VirtualApp

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();
      }
    }
  }
}
origin: darkskygit/VirtualApp

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());
}
origin: darkskygit/VirtualApp

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();
      }
    }
  }
}
origin: bzsome/VirtualApp-x326

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()
  );
}
origin: bzsome/VirtualApp-x326

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();
      }
    }
  }
}
origin: darkskygit/VirtualApp

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()
  );
}
com.lody.virtual.server.accountsRegisteredServicesParser

Most used methods

  • <init>
  • getParser
  • getResources

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • compareTo (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Path (java.nio.file)
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • JLabel (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now