@Override public int initProcess(String packageName, String processName, int userId) { synchronized (this) { ProcessRecord r = startProcessIfNeedLocked(processName, userId, packageName); return r != null ? r.vpid : -1; } }
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; }
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); } } }
@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; }
return null; ProcessRecord targetApp = startProcessIfNeedLocked(ComponentUtils.getProcessName(serviceInfo), userId, serviceInfo.packageName);
@Override public int initProcess(String packageName, String processName, int userId) { synchronized (this) { ProcessRecord r = startProcessIfNeedLocked(processName, userId, packageName); return r != null ? r.vpid : -1; } }
@Override public int initProcess(String packageName, String processName, int userId) { synchronized (this) { ProcessRecord r = startProcessIfNeedLocked(processName, userId, packageName); return r != null ? r.vpid : -1; } }
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; }
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; }
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); } } }
@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; }
@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; }
return null; ProcessRecord targetApp = startProcessIfNeedLocked(ComponentUtils.getProcessName(serviceInfo), userId, serviceInfo.packageName);
return null; ProcessRecord targetApp = startProcessIfNeedLocked(ComponentUtils.getProcessName(serviceInfo), userId, serviceInfo.packageName);