/** * Should guard by {@link VActivityManagerService#mPidsSelfLocked} * * @param pid pid */ public ProcessRecord findProcessLocked(int pid) { return mPidsSelfLocked.get(pid); }
@Override public String getAppProcessName(int pid) { synchronized (mPidsSelfLocked) { ProcessRecord r = mPidsSelfLocked.get(pid); if (r != null) { return r.processName; } } return null; }
@Override public String getInitialPackage(int pid) { synchronized (mPidsSelfLocked) { ProcessRecord r = mPidsSelfLocked.get(pid); if (r != null) { return r.info.packageName; } return null; } }
/** * Gets the Object mapped from the specified key, or <code>null</code> * if no such mapping has been made. */ public E get(int key) { return get(key, null); }
@Override public List<String> getProcessPkgList(int pid) { synchronized (mPidsSelfLocked) { ProcessRecord r = mPidsSelfLocked.get(pid); if (r != null) { return new ArrayList<>(r.pkgList); } } return Collections.emptyList(); }
public E get(String name, int uid) { SparseArray<E> uids = mMap.get(name); if (uids == null) return null; return uids.get(uid); }
private VLocConfig getOrCreateConfig(int userId, String pkg) { Map<String, VLocConfig> pkgs = mLocConfigs.get(userId); if (pkgs == null) { pkgs = new HashMap<>(); mLocConfigs.put(userId, pkgs); } VLocConfig config = pkgs.get(pkg); if (config == null) { config = new VLocConfig(); config.mode = MODE_CLOSE; pkgs.put(pkg, config); } return config; }
@Override public void stopJob(JobParameters jobParams) throws RemoteException { int jobId = jobParams.getJobId(); synchronized (mJobSessions) { JobSession session = mJobSessions.get(jobId); if (session != null) { session.stopSession(); } } } };
@Override public void appDoneExecuting() { synchronized (mPidsSelfLocked) { ProcessRecord r = mPidsSelfLocked.get(VBinder.getCallingPid()); if (r != null) { r.doneExecuting = true; r.lock.open(); } } }
@Override public VDeviceInfo getDeviceInfo(int userId) throws RemoteException { VDeviceInfo info; synchronized (mDeviceInfos) { info = mDeviceInfos.get(userId); if (info == null) { info = generateDeviceInfo(); mDeviceInfos.put(userId, info); mPersistenceLayer.save(); } } return info; }
JobConfig config = entry.getValue(); synchronized (mJobSessions) { JobSession session = mJobSessions.get(jobId); if (session != null) {
@Override public String getInitialPackage(int pid) { synchronized (mPidsSelfLocked) { ProcessRecord r = mPidsSelfLocked.get(pid); if (r != null) { return r.info.packageName; } return null; } }
@Override public String getAppProcessName(int pid) { synchronized (mPidsSelfLocked) { ProcessRecord r = mPidsSelfLocked.get(pid); if (r != null) { return r.processName; } } return null; }
/** * Gets the Object mapped from the specified key, or <code>null</code> * if no such mapping has been made. */ public E get(int key) { return get(key, null); }
@Override public String getAppProcessName(int pid) { synchronized (mPidsSelfLocked) { ProcessRecord r = mPidsSelfLocked.get(pid); if (r != null) { return r.processName; } } return null; }
public E get(String name, int uid) { SparseArray<E> uids = mMap.get(name); if (uids == null) return null; return uids.get(uid); }
public E get(String name, int uid) { SparseArray<E> uids = mMap.get(name); if (uids == null) return null; return uids.get(uid); }
@Override public void appDoneExecuting() { synchronized (mPidsSelfLocked) { ProcessRecord r = mPidsSelfLocked.get(VBinder.getCallingPid()); if (r != null) { r.doneExecuting = true; r.lock.open(); } } }
@Override public void stopJob(JobParameters jobParams) throws RemoteException { int jobId = jobParams.getJobId(); synchronized (mJobSessions) { JobSession session = mJobSessions.get(jobId); if (session != null) { session.stopSession(); } } } };
@Override public void stopJob(JobParameters jobParams) throws RemoteException { int jobId = jobParams.getJobId(); synchronized (mJobSessions) { JobSession session = mJobSessions.get(jobId); if (session != null) { session.stopSession(); } } } };