congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CondomProcess.getFullProcessName
Code IndexAdd Tabnine to your IDE (free)

How to use
getFullProcessName
method
in
com.oasisfeng.condom.CondomProcess

Best Java code snippets using com.oasisfeng.condom.CondomProcess.getFullProcessName (Showing top 4 results out of 315)

origin: oasisfeng/condom

private static void doValidateProcessNames(final Application app, final String[] process_names) {
  try {
    final PackageInfo info = app.getPackageManager().getPackageInfo(app.getPackageName(),
        GET_ACTIVITIES | GET_SERVICES | GET_RECEIVERS | GET_PROVIDERS);
    final Set<String> defined_process_names = new HashSet<>();
    if (info.activities != null) for (final ActivityInfo activity : info.activities) defined_process_names.add(activity.processName);
    if (info.services != null) for (final ServiceInfo service : info.services) defined_process_names.add(service.processName);
    if (info.receivers != null) for (final ActivityInfo receiver : info.receivers) defined_process_names.add(receiver.processName);
    if (info.providers != null) for (final ProviderInfo provider : info.providers) defined_process_names.add(provider.processName);
    for (final String process_name : process_names)
      if (! defined_process_names.contains(getFullProcessName(app, process_name)))
        throw new IllegalArgumentException("Process name \"" + process_name + "\" is not used by any component in AndroidManifest.xml");
  } catch (final PackageManager.NameNotFoundException ignored) {}		// Should never happen
}
origin: oasisfeng/condom

/**
 * Install the condom protection for current process if its process name matches. This method should be called in {@link Application#onCreate()}.
 *
 * @param process_names list of processes where Condom process should NOT be installed, in the form exactly as defined
 *                      by <code>"android:process"</code> attribute of components in <code>AndroidManifest.xml</code>.
 *                      <b>BEWARE: Default process must be explicitly listed here if it is expected to be excluded.</b>
 */
public static void installExcept(final Application app, final CondomOptions options, final String... process_names) {
  if (process_names.length == 0) throw new IllegalArgumentException("At lease one process name must be specified");
  validateCondomOptions(options);
  final String current_process_name = getProcessName(app);
  if (current_process_name == null) return;
  for (final String process_name : process_names)
    if (! current_process_name.equals(getFullProcessName(app, process_name))) {
      install(app, current_process_name, options);
      return;
    }
  if ((app.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) validateProcessNames(app, process_names);
}
origin: Trumeet/MiPushFramework

private static void doValidateProcessNames(final Application app, final String[] process_names) {
  try {
    final PackageInfo info = app.getPackageManager().getPackageInfo(app.getPackageName(),
        GET_ACTIVITIES | GET_SERVICES | GET_RECEIVERS | GET_PROVIDERS);
    final Set<String> defined_process_names = new HashSet<>();
    if (info.activities != null) for (final ActivityInfo activity : info.activities) defined_process_names.add(activity.processName);
    if (info.services != null) for (final ServiceInfo service : info.services) defined_process_names.add(service.processName);
    if (info.receivers != null) for (final ActivityInfo receiver : info.receivers) defined_process_names.add(receiver.processName);
    if (info.providers != null) for (final ProviderInfo provider : info.providers) defined_process_names.add(provider.processName);
    for (final String process_name : process_names)
      if (! defined_process_names.contains(getFullProcessName(app, process_name)))
        throw new IllegalArgumentException("Process name \"" + process_name + "\" is not used by any component in AndroidManifest.xml");
  } catch (final PackageManager.NameNotFoundException ignored) {}		// Should never happen
}
origin: Trumeet/MiPushFramework

/**
 * Install the condom protection for current process if its process name matches. This method should be called in {@link Application#onCreate()}.
 *
 * @param process_names list of processes where Condom process should NOT be installed, in the form exactly as defined
 *                      by <code>"android:process"</code> attribute of components in <code>AndroidManifest.xml</code>.
 *                      <b>BEWARE: Default process must be explicitly listed here if it is expected to be excluded.</b>
 */
public static void installExcept(final Application app, final CondomOptions options, final String... process_names) {
  if (process_names.length == 0) throw new IllegalArgumentException("At lease one process name must be specified");
  validateCondomOptions(options);
  final String current_process_name = getProcessName(app);
  if (current_process_name == null) return;
  for (final String process_name : process_names)
    if (! current_process_name.equals(getFullProcessName(app, process_name))) {
      install(app, current_process_name, options);
      return;
    }
  if ((app.getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) validateProcessNames(app, process_names);
}
com.oasisfeng.condomCondomProcessgetFullProcessName

Popular methods of CondomProcess

  • installExceptDefaultProcess
    Install the condom protection for current process if it is not the default process.This method must
  • getProcessName
  • install
  • installCondomProcessActivityManager
  • installCondomProcessPackageManager
  • validateCondomOptions
  • validateProcessNames
  • installExcept
    Install the condom protection for current process if its process name matches. This method should be

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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