return null; ProcessRecord targetApp = startProcessIfNeedLocked(ComponentUtils.getProcessName(serviceInfo), userId, serviceInfo.packageName); VLog.e(TAG, "Unable to start new Process for : " + ComponentUtils.toComponentName(serviceInfo)); return null; return ComponentUtils.toComponentName(serviceInfo);
private ServiceRecord findRecordLocked(int userId, ServiceInfo serviceInfo) { synchronized (mHistory) { for (ServiceRecord r : mHistory) { // If service is not created, and bindService with the flag that is // not BIND_AUTO_CREATE, r.process is null if ((r.process == null || r.process.userId == userId) && ComponentUtils.isSameComponent(serviceInfo, r.serviceInfo)) { return r; } } return null; } }
int userId = VUserHandle.myUserId(); if (ComponentUtils.isStubComponent(intent)) { return method.invoke(who, args);
private boolean handleUserBroadcast(int vuid, ActivityInfo info, ComponentName component, Intent realIntent, PendingResultData result) { if (component != null && !ComponentUtils.toComponentName(info).equals(component)) { // Verify the component. return false; } String originAction = SpecialComponentList.unprotectAction(realIntent.getAction()); if (originAction != null) { // restore to origin action. realIntent.setAction(originAction); } handleStaticBroadcastAsUser(vuid, info, realIntent, result); return true; }
VActivityManager.get().onActivityCreate(ComponentUtils.toComponentName(info), caller, token, info, intent, ComponentUtils.getTaskAffinity(info), taskId, info.launchMode, info.flags); ClassLoader appClassLoader = VClientImpl.get().getClassLoader(info.applicationInfo); intent.setExtrasClassLoader(appClassLoader);
String affinity = ComponentUtils.getTaskAffinity(info); TaskRecord reuseTask = null; switch (reuseTarget) { boolean delivered = false; mAM.moveTaskToFront(reuseTask.taskId, 0); boolean startTaskToFront = !clearTask && !clearTop && ComponentUtils.isSameIntent(intent, reuseTask.taskRoot);
@Override public void onReceive(Context context, Intent intent) { Intent realIntent = intent.getParcelableExtra("_VA_|_intent_"); int userId = intent.getIntExtra("_VA_|_user_id_", VUserHandle.USER_ALL); if (realIntent != null) { Intent newIntent = ComponentUtils.redirectBroadcastIntent(realIntent, userId); if (newIntent != null) { context.sendBroadcast(newIntent); } } } }
public static boolean isVisiblePackage(ApplicationInfo info) { return getHostPkg().equals(info.packageName) || ComponentUtils.isSystemApp(info) || VirtualCore.get().isOutsidePackageVisible(info.packageName); }
reuseTarget = ReuseTarget.AFFINITY; String affinity = ComponentUtils.getTaskAffinity(info); TaskRecord reuseTask = null; if (reuseTarget == ReuseTarget.AFFINITY) {
private Object redirect(Object item, String pkg) { if (item == null) { return null; } Intent redirectIntentSender = ComponentUtils.redirectIntentSender(4, pkg, (Intent) JobWorkItem.getIntent.call(item, new Object[0]), null); Object newInstance = JobWorkItem.ctor.newInstance(redirectIntentSender); JobWorkItem.mWorkId.set(newInstance, JobWorkItem.mWorkId.get(item)); JobWorkItem.mGrants.set(newInstance, JobWorkItem.mGrants.get(item)); JobWorkItem.mDeliveryCount.set(newInstance, JobWorkItem.mDeliveryCount.get(item)); return newInstance; }
@Override public void publishService(IBinder token, Intent intent, IBinder service, int userId) { synchronized (this) { ServiceRecord r = (ServiceRecord) token; if (r != null) { ServiceRecord.IntentBindRecord boundRecord = r.peekBinding(intent); if (boundRecord != null) { boundRecord.binder = service; for (IServiceConnection conn : boundRecord.connections) { ComponentName component = ComponentUtils.toComponentName(r.serviceInfo); connectService(conn, component, boundRecord, false); } } } } }
false ); VActivityManager.get().onActivityCreate(ComponentUtils.toComponentName(info), caller, token, info, intent, ComponentUtils.getTaskAffinity(info), taskId, info.launchMode, info.flags); ClassLoader appClassLoader = VClientImpl.get().getClassLoader(info.applicationInfo); intent.setExtrasClassLoader(appClassLoader);
String affinity = ComponentUtils.getTaskAffinity(info); TaskRecord reuseTask = null; switch (reuseTarget) { boolean delivered = false; mAM.moveTaskToFront(reuseTask.taskId, 0); boolean startTaskToFront = !clearTask && !clearTop && ComponentUtils.isSameIntent(intent, reuseTask.taskRoot);
public void sendBroadcast(Intent intent, int userId) { Intent newIntent = ComponentUtils.redirectBroadcastIntent(intent, userId); if (newIntent != null) { VirtualCore.get().getContext().sendBroadcast(newIntent); } }
public static boolean isVisiblePackage(ApplicationInfo info) { return getHostPkg().equals(info.packageName) || ComponentUtils.isSystemApp(info) || VirtualCore.get().isOutsidePackageVisible(info.packageName); }
reuseTarget = ReuseTarget.AFFINITY; String affinity = ComponentUtils.getTaskAffinity(info); TaskRecord reuseTask = null; if (reuseTarget == ReuseTarget.AFFINITY) {
@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); } }
false ); VActivityManager.get().onActivityCreate(ComponentUtils.toComponentName(info), caller, token, info, intent, ComponentUtils.getTaskAffinity(info), taskId, info.launchMode, info.flags); ClassLoader appClassLoader = VClientImpl.get().getClassLoader(info.applicationInfo); intent.setExtrasClassLoader(appClassLoader);
return null; ProcessRecord targetApp = startProcessIfNeedLocked(ComponentUtils.getProcessName(serviceInfo), userId, serviceInfo.packageName); VLog.e(TAG, "Unable to start new Process for : " + ComponentUtils.toComponentName(serviceInfo)); return null; return ComponentUtils.toComponentName(serviceInfo);
String affinity = ComponentUtils.getTaskAffinity(info); TaskRecord reuseTask = null; switch (reuseTarget) { boolean delivered = false; mAM.moveTaskToFront(reuseTask.taskId, 0); boolean startTaskToFront = !clearTask && !clearTop && ComponentUtils.isSameIntent(intent, reuseTask.taskRoot);