get the main <activity> because Branch Intent Filters must be in the main Launch Activity
542097
function getMainLaunchActivityIndex(activities) {
    let launchActivityIndex = -1;

    for (let i = 0; i < activities.length; i++) {
      const activity = activities[i];
      if (isLaunchActivity(activity)) {
        launchActivityIndex = i;
        break;
      }
    }

    return launchActivityIndex;
  }
828582
private static List<String> loadInstantRunDexFile(ApplicationInfo appInfo) {
        List<String> instantRunDexPaths = new ArrayList<>();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && appInfo.splitSourceDirs != null) {
            instantRunDexPaths.addAll(Arrays.asList(appInfo.splitSourceDirs));
            Log.i(AndServer.TAG, "InstantRun support was found.");
        } else {
            try {
                // Reflect instant run sdk to find where is the dex file.
                Class pathsByInstantRun = Class.forName("com.android.tools.fd.runtime.Paths");
                Method getDexFileDirectory = pathsByInstantRun.getMethod("getDexFileDirectory", String.class);
                String dexDirectory = (String)getDexFileDirectory.invoke(null, appInfo.packageName);

                File dexFolder = new File(dexDirectory);
                if (dexFolder.exists() && dexFolder.isDirectory()) {
                    File[] dexFiles = dexFolder.listFiles();
                    for (File file : dexFiles) {
                        if (file.exists() && file.isFile() && file.getName().endsWith(".dex")) {
                            instantRunDexPaths.add(file.getAbsolutePath());
                        }
                    }
                    Log.i(AndServer.TAG, "InstantRun support was found.");
                }

            } catch (ClassNotFoundException e) {
                Log.i(AndServer.TAG, "InstantRun support was not found.");
            } catch (Exception e) {
                Log.w(AndServer.TAG, "Finding InstantRun failed.", e);
            }
        }

        return instantRunDexPaths;
    }
407664
public static List<Path> getSubFilePathList(Path startDirectoryPath,
			Predicate<Path> filter) {
		return getSubPathList(startDirectoryPath,
				RegularFileFilter.and(filter));
	}
635775
public static boolean isMainProcess(@NonNull final Context context) {
        final int currentPid = android.os.Process.myPid();
        final ActivityManager activityManager = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);
        final List<RunningAppProcessInfo> runningProcesses = activityManager.getRunningAppProcesses();

        String currentProcessName = null;
        for (RunningAppProcessInfo process : runningProcesses) {
            if (process.pid == currentPid) {
                currentProcessName = process.processName;
                break;
            }
        }

        return context.getPackageName().equals(currentProcessName);
    }
403390
public static void startActivity(@Nullable Activity activity, Class<? extends Activity> targetActivityClass) {
		if (activity != null) {
			if (activity.getClass() != targetActivityClass) {
				Intent intent = new Intent(activity, targetActivityClass);
				activity.startActivity(intent);
			}
		} else {
			LOGGER.warn("Null activity. Ignoring launch of " + targetActivityClass.getSimpleName());
		}
	}
141684
private String getActivityInstanceId(PvmExecutionImpl targetScope) {
    if (targetScope.isConcurrent()) {
      return targetScope.getActivityInstanceId();
    } else {
      ActivityImpl targetActivity = targetScope.getActivity();
      if ((targetActivity != null && targetActivity.getActivities().isEmpty())) {
        return targetScope.getActivityInstanceId();
      } else {
        return targetScope.getParentActivityInstanceId();
      }
    }
  }
396439
private static List<String> tryLoadInstantRunDexFile(ApplicationInfo applicationInfo) {
        List<String> instantRunSourcePaths = new ArrayList<>();

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && null != applicationInfo.splitSourceDirs) {
            // add the split apk, normally for InstantRun, and newest version.
            instantRunSourcePaths.addAll(Arrays.asList(applicationInfo.splitSourceDirs));
            Log.d(Consts.TAG, "Found InstantRun support");
        } else {
            try {
                // This man is reflection from Google instant run sdk, he will tell me where the dex files go.
                Class pathsByInstantRun = Class.forName("com.android.tools.fd.runtime.Paths");
                Method getDexFileDirectory = pathsByInstantRun.getMethod("getDexFileDirectory", String.class);
                String instantRunDexPath = (String) getDexFileDirectory.invoke(null, applicationInfo.packageName);

                File instantRunFilePath = new File(instantRunDexPath);
                if (instantRunFilePath.exists() && instantRunFilePath.isDirectory()) {
                    File[] dexFile = instantRunFilePath.listFiles();
                    for (File file : dexFile) {
                        if (null != file && file.exists() && file.isFile() && file.getName().endsWith(".dex")) {
                            instantRunSourcePaths.add(file.getAbsolutePath());
                        }
                    }
                    Log.d(Consts.TAG, "Found InstantRun support");
                }

            } catch (Exception e) {
                Log.e(Consts.TAG, "InstantRun support error, " + e.getMessage());
            }
        }

        return instantRunSourcePaths;
    }
913235
public static filteraction[] get(nitro_service service) throws Exception{
		filteraction obj = new filteraction();
		filteraction[] response = (filteraction[])obj.get_resources(service);
		return response;
	}
613673
public Object getActivity(ActivityHandle ah) {
	    if (tracer.isFineEnabled()) {
	    	tracer.fine("get Activity with ActivityHandle "+ah.toString());
	    }
	    // if handle exists then recreate activity
	    return activities.get(ah);
	}
838633
function isIntentFilterForUniversalLinks(intentFilter) {
  var actions = intentFilter['action'];
  var categories = intentFilter['category'];
  var data = intentFilter['data'];

  return isActionForUniversalLinks(actions) &&
    isCategoriesForUniversalLinks(categories) &&
    isDataTagForUniversalLinks(data);
}
492529
private void setupActivityMonitor() {
		if(config.trackActivities){
			try {
				IntentFilter filter = null;
				activityMonitor = inst.addMonitor(filter, null, false);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
591063
@RequestMapping(value = "branches/{branchId}/filters/{name}", method = RequestMethod.GET)
    public Resource<BuildFilterForm> getEditionForm(@PathVariable ID branchId, @PathVariable String name) {
        BuildFilterForm editionForm = buildFilterService.getEditionForm(branchId, name);
        return Resource.of(
                editionForm,
                uri(on(getClass()).getEditionForm(branchId, name))
        ).with(Link.UPDATE, uri(on(getClass()).saveFilter(
                branchId,
                name,
                null
        )));
    }
943655
public function getMainBranch()
    {
        $filtered = array_filter(
            $this->getBranches(),
            function (Branch $branch) {
                return $branch->getCurrent();
            }
        );
        sort($filtered);

        return $filtered[0];
    }
888011
void get_possible_actions(State source,
                              List<Action> actions)
    {
        if (0 == L || -1 == R)
        {
            System.err.println("decoder: not initialized, please check if the root dependency relation is correct set by --root.");
            return;
        }
        actions.clear();

        if (!source.buffer_empty())
        {
            actions.add(ActionFactory.make_shift());
        }

        if (source.stack_size() == 2)
        {
            if (source.buffer_empty())
            {
                actions.add(ActionFactory.make_right_arc(R));
            }
        }
        else if (source.stack_size() > 2)
        {
            for (int l = 0; l < L; ++l)
            {
                if (l == R)
                {
                    continue;
                }
                actions.add(ActionFactory.make_left_arc(l));
                actions.add(ActionFactory.make_right_arc(l));
            }
        }
    }
747561
def start(self, activity, action):
        '''
        
        '''
        try:
            self._start_action(activity, action)
        except ValueError:
            retox_log.debug("Could not find action %s in env %s" % (activity, self.name))
        self.refresh()
1230080
@NonNull
    private Activity getActivity() {
        Activity result = null;
        if (activity != null) {
            result = activity;
        } else if (fragment != null) {
            result = fragment.getActivity();
        } else if (fragmentSupport != null) {
            result = fragmentSupport.getActivity();
        }
        if (result == null) {
            throw new NullPointerException("No activity or fragment instance");
        }
        return result;
    }
764332
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
    public static PendingIntent getActivities(Context context, int requestCode, Intent[] intents, int flags) {
        PendingIntent.getActivities(context, requestCode, intents, flags).cancel();
        return PendingIntent.getActivities(context, requestCode, intents, flags);
    }