Tabnine Logo
ActivityStack
Code IndexAdd Tabnine to your IDE (free)

How to use
ActivityStack
in
com.lody.virtual.server.am

Best Java code snippets using com.lody.virtual.server.am.ActivityStack (Showing top 20 results out of 315)

origin: android-hacker/VirtualXposed

int startActivityLocked(int userId, Intent intent, ActivityInfo info, IBinder resultTo, Bundle options,
            String resultWho, int requestCode) {
  optimizeTasksLocked();
  ActivityRecord sourceRecord = findActivityByToken(userId, resultTo);
  TaskRecord sourceTask = sourceRecord != null ? sourceRecord.task : null;
  boolean clearTop = containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TOP);
  boolean clearTask = containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
    removeFlags(intent, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    clearTarget = ClearTarget.TOP;
    if (containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
      clearTarget = ClearTarget.TASK;
    } else {
      removeFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
    case LAUNCH_SINGLE_TOP: {
      singleTop = true;
      if (containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
        reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
            ? ReuseTarget.MULTIPLE
            : ReuseTarget.AFFINITY;
      clearTop = false;
      clearTarget = ClearTarget.TOP;
      reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
          ? ReuseTarget.MULTIPLE
          : ReuseTarget.AFFINITY;
origin: android-hacker/VirtualXposed

@Override
public ComponentName getActivityClassForToken(int userId, IBinder token) {
  return mMainStack.getActivityClassForToken(userId, token);
}
origin: android-hacker/VirtualXposed

@Override
public ComponentName getCallingActivity(int userId, IBinder token) {
  return mMainStack.getCallingActivity(userId, token);
}
origin: android-hacker/VirtualXposed

void onActivityResumed(int userId, IBinder token) {
  synchronized (mHistory) {
    optimizeTasksLocked();
    ActivityRecord r = findActivityByToken(userId, token);
    if (r != null) {
      synchronized (r.task.activities) {
        r.task.activities.remove(r);
        r.task.activities.add(r);
      }
    }
  }
}
origin: android-hacker/VirtualXposed

int startActivitiesLocked(int userId, Intent[] intents, ActivityInfo[] infos, String[] resolvedTypes, IBinder token, Bundle options) {
  optimizeTasksLocked();
  ReuseTarget reuseTarget = ReuseTarget.CURRENT;
  Intent intent = intents[0];
  ActivityInfo info = infos[0];
  ActivityRecord resultTo = findActivityByToken(userId, token);
  if (resultTo != null && resultTo.launchMode == LAUNCH_SINGLE_INSTANCE) {
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TOP)) {
    removeFlags(intent, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK) && !containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
    removeFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
    reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK) ? ReuseTarget.MULTIPLE : ReuseTarget.AFFINITY;
  } else if (info.launchMode == LAUNCH_SINGLE_TASK) {
    reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK) ? ReuseTarget.MULTIPLE : ReuseTarget.AFFINITY;
  TaskRecord reuseTask = null;
  if (reuseTarget == ReuseTarget.AFFINITY) {
    reuseTask = findTaskByAffinityLocked(userId, affinity);
  } else if (reuseTarget == ReuseTarget.CURRENT) {
    reuseTask = resultTo.task;
  } else if (reuseTarget == ReuseTarget.DOCUMENT) {
    reuseTask = findTaskByIntentLocked(userId, intent);
  Intent[] destIntents = startActivitiesProcess(userId, intents, infos, resultTo);
  if (reuseTask == null) {
origin: android-hacker/VirtualXposed

ComponentName getCallingActivity(int userId, IBinder token) {
  synchronized (mHistory) {
    ActivityRecord r = findActivityByToken(userId, token);
    if (r != null) {
      return r.caller != null ? r.caller : r.component;
    }
    return null;
  }
}
origin: android-hacker/VirtualXposed

@Override
public String getPackageForToken(int userId, IBinder token) {
  return mMainStack.getPackageForToken(userId, token);
}
origin: android-hacker/VirtualXposed

@Override
public String getCallingPackage(int userId, IBinder token) {
  return mMainStack.getCallingPackage(userId, token);
}
origin: android-hacker/VirtualXposed

private Intent startActivityProcess(int userId, ActivityRecord sourceRecord, Intent intent, ActivityInfo info) {
  intent = new Intent(intent);
  ProcessRecord targetApp = mService.startProcessIfNeedLocked(info.processName, userId, info.packageName);
  if (targetApp == null) {
    return null;
  }
  Intent targetIntent = new Intent();
  targetIntent.setClassName(VirtualCore.get().getHostPkg(), fetchStubActivity(targetApp.vpid, info));
  ComponentName component = intent.getComponent();
  if (component == null) {
    component = ComponentUtils.toComponentName(info);
  }
  targetIntent.setType(component.flattenToString());
  StubActivityRecord saveInstance = new StubActivityRecord(intent, info,
      sourceRecord != null ? sourceRecord.component : null, userId);
  saveInstance.saveToIntent(targetIntent);
  return targetIntent;
}
origin: darkskygit/VirtualApp

int startActivitiesLocked(int userId, Intent[] intents, ActivityInfo[] infos, String[] resolvedTypes, IBinder token, Bundle options) {
  optimizeTasksLocked();
  ReuseTarget reuseTarget = ReuseTarget.CURRENT;
  Intent intent = intents[0];
  ActivityInfo info = infos[0];
  ActivityRecord resultTo = findActivityByToken(userId, token);
  if (resultTo != null && resultTo.launchMode == LAUNCH_SINGLE_INSTANCE) {
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TOP)) {
    removeFlags(intent, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK) && !containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
    removeFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
    reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK) ? ReuseTarget.MULTIPLE : ReuseTarget.AFFINITY;
  } else if (info.launchMode == LAUNCH_SINGLE_TASK) {
    reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK) ? ReuseTarget.MULTIPLE : ReuseTarget.AFFINITY;
  TaskRecord reuseTask = null;
  if (reuseTarget == ReuseTarget.AFFINITY) {
    reuseTask = findTaskByAffinityLocked(userId, affinity);
  } else if (reuseTarget == ReuseTarget.CURRENT) {
    reuseTask = resultTo.task;
  } else if (reuseTarget == ReuseTarget.DOCUMENT) {
    reuseTask = findTaskByIntentLocked(userId, intent);
  Intent[] destIntents = startActivitiesProcess(userId, intents, infos, resultTo);
  if (reuseTask == null) {
origin: android-hacker/VirtualXposed

ActivityRecord onActivityDestroyed(int userId, IBinder token) {
  synchronized (mHistory) {
    optimizeTasksLocked();
    ActivityRecord r = findActivityByToken(userId, token);
    if (r != null) {
      synchronized (r.task.activities) {
        r.task.activities.remove(r);
        // We shouldn't remove task at this point,
        // it will be removed by optimizeTasksLocked().
      }
    }
    return r;
  }
}
origin: android-hacker/VirtualXposed

ComponentName getActivityClassForToken(int userId, IBinder token) {
  synchronized (mHistory) {
    ActivityRecord r = findActivityByToken(userId, token);
    if (r != null) {
      return r.component;
    }
    return null;
  }
}
origin: bzsome/VirtualApp-x326

@Override
public String getPackageForToken(int userId, IBinder token) {
  return mMainStack.getPackageForToken(userId, token);
}
origin: darkskygit/VirtualApp

@Override
public String getCallingPackage(int userId, IBinder token) {
  return mMainStack.getCallingPackage(userId, token);
}
origin: darkskygit/VirtualApp

private Intent startActivityProcess(int userId, ActivityRecord sourceRecord, Intent intent, ActivityInfo info) {
  intent = new Intent(intent);
  ProcessRecord targetApp = mService.startProcessIfNeedLocked(info.processName, userId, info.packageName);
  if (targetApp == null) {
    return null;
  }
  Intent targetIntent = new Intent();
  targetIntent.setClassName(VirtualCore.get().getHostPkg(), fetchStubActivity(targetApp.vpid, info));
  ComponentName component = intent.getComponent();
  if (component == null) {
    component = ComponentUtils.toComponentName(info);
  }
  targetIntent.setType(component.flattenToString());
  StubActivityRecord saveInstance = new StubActivityRecord(intent, info,
      sourceRecord != null ? sourceRecord.component : null, userId);
  saveInstance.saveToIntent(targetIntent);
  return targetIntent;
}
origin: darkskygit/VirtualApp

int startActivityLocked(int userId, Intent intent, ActivityInfo info, IBinder resultTo, Bundle options,
            String resultWho, int requestCode) {
  optimizeTasksLocked();
  ActivityRecord sourceRecord = findActivityByToken(userId, resultTo);
  TaskRecord sourceTask = sourceRecord != null ? sourceRecord.task : null;
  boolean clearTop = containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TOP);
  boolean clearTask = containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
    removeFlags(intent, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    clearTarget = ClearTarget.TOP;
    if (containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
      clearTarget = ClearTarget.TASK;
    } else {
      removeFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
    case LAUNCH_SINGLE_TOP: {
      singleTop = true;
      if (containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
        reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
            ? ReuseTarget.MULTIPLE
            : ReuseTarget.AFFINITY;
      clearTop = false;
      clearTarget = ClearTarget.TOP;
      reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK)
          ? ReuseTarget.MULTIPLE
          : ReuseTarget.AFFINITY;
origin: bzsome/VirtualApp-x326

int startActivitiesLocked(int userId, Intent[] intents, ActivityInfo[] infos, String[] resolvedTypes, IBinder token, Bundle options) {
  optimizeTasksLocked();
  ReuseTarget reuseTarget = ReuseTarget.CURRENT;
  Intent intent = intents[0];
  ActivityInfo info = infos[0];
  ActivityRecord resultTo = findActivityByToken(userId, token);
  if (resultTo != null && resultTo.launchMode == LAUNCH_SINGLE_INSTANCE) {
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TOP)) {
    removeFlags(intent, Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK) && !containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
    removeFlags(intent, Intent.FLAG_ACTIVITY_CLEAR_TASK);
  if (containFlags(intent, Intent.FLAG_ACTIVITY_NEW_TASK)) {
    reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK) ? ReuseTarget.MULTIPLE : ReuseTarget.AFFINITY;
  } else if (info.launchMode == LAUNCH_SINGLE_TASK) {
    reuseTarget = containFlags(intent, Intent.FLAG_ACTIVITY_MULTIPLE_TASK) ? ReuseTarget.MULTIPLE : ReuseTarget.AFFINITY;
  TaskRecord reuseTask = null;
  if (reuseTarget == ReuseTarget.AFFINITY) {
    reuseTask = findTaskByAffinityLocked(userId, affinity);
  } else if (reuseTarget == ReuseTarget.CURRENT) {
    reuseTask = resultTo.task;
  } else if (reuseTarget == ReuseTarget.DOCUMENT) {
    reuseTask = findTaskByIntentLocked(userId, intent);
  Intent[] destIntents = startActivitiesProcess(userId, intents, infos, resultTo);
  if (reuseTask == null) {
origin: bzsome/VirtualApp-x326

ActivityRecord onActivityDestroyed(int userId, IBinder token) {
  synchronized (mHistory) {
    optimizeTasksLocked();
    ActivityRecord r = findActivityByToken(userId, token);
    if (r != null) {
      synchronized (r.task.activities) {
        r.task.activities.remove(r);
        // We shouldn't remove task at this point,
        // it will be removed by optimizeTasksLocked().
      }
    }
    return r;
  }
}
origin: android-hacker/VirtualXposed

public String getCallingPackage(int userId, IBinder token) {
  synchronized (mHistory) {
    ActivityRecord r = findActivityByToken(userId, token);
    if (r != null) {
      return r.caller != null ? r.caller.getPackageName() : "android";
    }
    return "android";
  }
}
origin: darkskygit/VirtualApp

@Override
public String getPackageForToken(int userId, IBinder token) {
  return mMainStack.getPackageForToken(userId, token);
}
com.lody.virtual.server.amActivityStack

Most used methods

  • containFlags
  • deliverNewIntentLocked
  • fetchStubActivity
  • findActivityByToken
  • findTaskByAffinityLocked
  • findTaskByIntentLocked
  • getActivityClassForToken
  • getCallingActivity
  • getCallingPackage
  • getPackageForToken
  • getTaskInfo
  • markTaskByClearTarget
  • getTaskInfo,
  • markTaskByClearTarget,
  • onActivityCreated,
  • onActivityDestroyed,
  • onActivityResumed,
  • optimizeTasksLocked,
  • processDied,
  • realStartActivitiesLocked,
  • realStartActivityLocked,
  • removeFlags

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JFrame (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top Sublime Text plugins
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