Codota Logo
VActivityManagerService.findProcessLocked
Code IndexAdd Codota to your IDE (free)

How to use
findProcessLocked
method
in
com.lody.virtual.server.am.VActivityManagerService

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

  • Common ways to obtain VActivityManagerService
private void myMethod () {
VActivityManagerService v =
  • Codota IconAtomicReference atomicReference;atomicReference.get()
  • Smart code suggestions by Codota
}
origin: android-hacker/VirtualXposed

@Override
public boolean isAppPid(int pid) {
  synchronized (mPidsSelfLocked) {
    return findProcessLocked(pid) != null;
  }
}
origin: android-hacker/VirtualXposed

@Override
public int getUidByPid(int pid) {
  synchronized (mPidsSelfLocked) {
    ProcessRecord r = findProcessLocked(pid);
    if (r != null) {
      return r.vuid;
    }
  }
  return Process.myUid();
}
origin: android-hacker/VirtualXposed

@Override
public void onActivityCreated(ComponentName component, ComponentName caller, IBinder token, Intent intent, String affinity, int taskId, int launchMode, int flags) {
  int pid = Binder.getCallingPid();
  ProcessRecord targetApp = findProcessLocked(pid);
  if (targetApp != null) {
    mMainStack.onActivityCreated(targetApp, component, caller, token, intent, affinity, taskId, launchMode, flags);
  }
}
origin: android-hacker/VirtualXposed

@Override
public VParceledListSlice<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags, int userId) {
  synchronized (mHistory) {
    List<ActivityManager.RunningServiceInfo> services = new ArrayList<>(mHistory.size());
    for (ServiceRecord r : mHistory) {
      if (r.process.userId != userId) {
        continue;
      }
      ActivityManager.RunningServiceInfo info = new ActivityManager.RunningServiceInfo();
      info.uid = r.process.vuid;
      info.pid = r.process.pid;
      ProcessRecord processRecord = findProcessLocked(r.process.pid);
      if (processRecord != null) {
        info.process = processRecord.processName;
        info.clientPackage = processRecord.info.packageName;
      }
      info.activeSince = r.activeSince;
      info.lastActivityTime = r.lastActivityTime;
      info.clientCount = r.getClientCount();
      info.service = ComponentUtils.toComponentName(r.serviceInfo);
      info.started = r.startId > 0;
      services.add(info);
    }
    return new VParceledListSlice<>(services);
  }
}
origin: android-hacker/VirtualXposed

private void handleStaticBroadcastAsUser(int vuid, ActivityInfo info, Intent intent,
                     PendingResultData result) {
  synchronized (this) {
    ProcessRecord r = findProcessLocked(info.processName, vuid);
    if ((BROADCAST_NOT_STARTED_PKG || isStartProcessForBroadcast(info.processName, info.packageName))
        && r == null) {
      r = startProcessIfNeedLocked(info.processName, getUserId(vuid), info.packageName);
    }
    if (r != null && r.appThread != null) {
      performScheduleReceiver(r.client, vuid, info, intent,
          result);
    }
  }
}
origin: android-hacker/VirtualXposed

@Override
public IBinder acquireProviderClient(int userId, ProviderInfo info) {
  ProcessRecord callerApp;
  synchronized (mPidsSelfLocked) {
    callerApp = findProcessLocked(VBinder.getCallingPid());
  }
  if (callerApp == null) {
    throw new SecurityException("Who are you?");
  }
  String processName = info.processName;
  ProcessRecord r;
  synchronized (this) {
    r = startProcessIfNeedLocked(processName, userId, info.packageName);
  }
  if (r != null && r.client.asBinder().pingBinder()) {
    try {
      return r.client.acquireProviderClient(info);
    } catch (RemoteException e) {
      e.printStackTrace();
    }
  }
  return null;
}
origin: android-hacker/VirtualXposed

@Override
public void processRestarted(String packageName, String processName, int userId) {
  int callingPid = getCallingPid();
  int appId = VAppManagerService.get().getAppId(packageName);
  int uid = VUserHandle.getUid(userId, appId);
  synchronized (this) {
    ProcessRecord app = findProcessLocked(callingPid);
    if (app == null) {
      ApplicationInfo appInfo = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
      appInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
      String stubProcessName = getProcessName(callingPid);
      int vpid = parseVPid(stubProcessName);
      if (vpid != -1) {
        performStartProcessLocked(uid, vpid, appInfo, processName);
      }
    }
  }
}
origin: darkskygit/VirtualApp

@Override
public boolean isAppPid(int pid) {
  synchronized (mPidsSelfLocked) {
    return findProcessLocked(pid) != null;
  }
}
origin: bzsome/VirtualApp-x326

@Override
public boolean isAppPid(int pid) {
  synchronized (mPidsSelfLocked) {
    return findProcessLocked(pid) != null;
  }
}
origin: bzsome/VirtualApp-x326

@Override
public int getUidByPid(int pid) {
  synchronized (mPidsSelfLocked) {
    ProcessRecord r = findProcessLocked(pid);
    if (r != null) {
      return r.vuid;
    }
  }
  return Process.myUid();
}
origin: darkskygit/VirtualApp

@Override
public int getUidByPid(int pid) {
  synchronized (mPidsSelfLocked) {
    ProcessRecord r = findProcessLocked(pid);
    if (r != null) {
      return r.vuid;
    }
  }
  return Process.myUid();
}
origin: bzsome/VirtualApp-x326

private void handleStaticBroadcastAsUser(int vuid, ActivityInfo info, Intent intent,
                     PendingResultData result) {
  synchronized (this) {
    ProcessRecord r = findProcessLocked(info.processName, vuid);
    if (BROADCAST_NOT_STARTED_PKG && r == null) {
      r = startProcessIfNeedLocked(info.processName, getUserId(vuid), info.packageName);
    }
    if (r != null && r.appThread != null) {
      performScheduleReceiver(r.client, vuid, info, intent,
          result);
    }
  }
}
origin: darkskygit/VirtualApp

@Override
public void onActivityCreated(ComponentName component, ComponentName caller, IBinder token, Intent intent, String affinity, int taskId, int launchMode, int flags) {
  int pid = Binder.getCallingPid();
  ProcessRecord targetApp = findProcessLocked(pid);
  if (targetApp != null) {
    mMainStack.onActivityCreated(targetApp, component, caller, token, intent, affinity, taskId, launchMode, flags);
  }
}
origin: bzsome/VirtualApp-x326

@Override
public void onActivityCreated(ComponentName component, ComponentName caller, IBinder token, Intent intent, String affinity, int taskId, int launchMode, int flags) {
  int pid = Binder.getCallingPid();
  ProcessRecord targetApp = findProcessLocked(pid);
  if (targetApp != null) {
    mMainStack.onActivityCreated(targetApp, component, caller, token, intent, affinity, taskId, launchMode, flags);
  }
}
origin: darkskygit/VirtualApp

@Override
public VParceledListSlice<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags, int userId) {
  synchronized (mHistory) {
    List<ActivityManager.RunningServiceInfo> services = new ArrayList<>(mHistory.size());
    for (ServiceRecord r : mHistory) {
      if (r.process.userId != userId) {
        continue;
      }
      ActivityManager.RunningServiceInfo info = new ActivityManager.RunningServiceInfo();
      info.uid = r.process.vuid;
      info.pid = r.process.pid;
      ProcessRecord processRecord = findProcessLocked(r.process.pid);
      if (processRecord != null) {
        info.process = processRecord.processName;
        info.clientPackage = processRecord.info.packageName;
      }
      info.activeSince = r.activeSince;
      info.lastActivityTime = r.lastActivityTime;
      info.clientCount = r.getClientCount();
      info.service = ComponentUtils.toComponentName(r.serviceInfo);
      info.started = r.startId > 0;
      services.add(info);
    }
    return new VParceledListSlice<>(services);
  }
}
origin: darkskygit/VirtualApp

private void handleStaticBroadcastAsUser(int vuid, ActivityInfo info, Intent intent,
                     PendingResultData result) {
  synchronized (this) {
    ProcessRecord r = findProcessLocked(info.processName, vuid);
    if ((BROADCAST_NOT_STARTED_PKG || isStartProcessForBroadcast(info.processName, info.packageName))
        && r == null) {
      r = startProcessIfNeedLocked(info.processName, getUserId(vuid), info.packageName);
    }
    if (r != null && r.appThread != null) {
      performScheduleReceiver(r.client, vuid, info, intent,
          result);
    }
  }
}
origin: bzsome/VirtualApp-x326

@Override
public IBinder acquireProviderClient(int userId, ProviderInfo info) {
  ProcessRecord callerApp;
  synchronized (mPidsSelfLocked) {
    callerApp = findProcessLocked(getCallingPid());
  }
  if (callerApp == null) {
    throw new SecurityException("Who are you?");
  }
  String processName = info.processName;
  ProcessRecord r;
  synchronized (this) {
    r = startProcessIfNeedLocked(processName, userId, info.packageName);
  }
  if (r != null && r.client.asBinder().isBinderAlive()) {
    try {
      return r.client.acquireProviderClient(info);
    } catch (RemoteException e) {
      e.printStackTrace();
    }
  }
  return null;
}
origin: darkskygit/VirtualApp

@Override
public IBinder acquireProviderClient(int userId, ProviderInfo info) {
  ProcessRecord callerApp;
  synchronized (mPidsSelfLocked) {
    callerApp = findProcessLocked(VBinder.getCallingPid());
  }
  if (callerApp == null) {
    throw new SecurityException("Who are you?");
  }
  String processName = info.processName;
  ProcessRecord r;
  synchronized (this) {
    r = startProcessIfNeedLocked(processName, userId, info.packageName);
  }
  if (r != null && r.client.asBinder().pingBinder()) {
    try {
      return r.client.acquireProviderClient(info);
    } catch (RemoteException e) {
      e.printStackTrace();
    }
  }
  return null;
}
origin: darkskygit/VirtualApp

@Override
public void processRestarted(String packageName, String processName, int userId) {
  int callingPid = getCallingPid();
  int appId = VAppManagerService.get().getAppId(packageName);
  int uid = VUserHandle.getUid(userId, appId);
  synchronized (this) {
    ProcessRecord app = findProcessLocked(callingPid);
    if (app == null) {
      ApplicationInfo appInfo = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
      appInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
      String stubProcessName = getProcessName(callingPid);
      int vpid = parseVPid(stubProcessName);
      if (vpid != -1) {
        performStartProcessLocked(uid, vpid, appInfo, processName);
      }
    }
  }
}
origin: bzsome/VirtualApp-x326

@Override
public void processRestarted(String packageName, String processName, int userId) {
  int callingPid = getCallingPid();
  int appId = VAppManagerService.get().getAppId(packageName);
  int uid = VUserHandle.getUid(userId, appId);
  synchronized (this) {
    ProcessRecord app = findProcessLocked(callingPid);
    if (app == null) {
      ApplicationInfo appInfo = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId);
      appInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
      String stubProcessName = getProcessName(callingPid);
      int vpid = parseVPid(stubProcessName);
      if (vpid != -1) {
        performStartProcessLocked(uid, vpid, appInfo, processName);
      }
    }
  }
}
com.lody.virtual.server.amVActivityManagerServicefindProcessLocked

Javadoc

Should guard by VActivityManagerService#mPidsSelfLocked

Popular methods of VActivityManagerService

  • <init>
  • addRecord
  • attachClient
  • cancelNotification
  • connectService
  • findRecordLocked
  • get
  • getFreeStubCount
  • getProcessName
  • handleStaticBroadcast
  • handleStaticBroadcastAsUser
  • handleUserBroadcast
  • handleStaticBroadcastAsUser,
  • handleUserBroadcast,
  • killAllApps,
  • killAppByPkg,
  • onCreate,
  • parseVPid,
  • performScheduleReceiver,
  • performStartProcessLocked,
  • postNotification

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • addToBackStack (FragmentTransaction)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JButton (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now