@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 void run() { try { r.process.client.finishActivity(r.token); } catch (RemoteException e) { e.printStackTrace(); } } });
thread = ApplicationThreadCompat.asInterface(client.getAppThread()); } catch (RemoteException e) { IBinder token = client.getToken(); if (token instanceof ProcessRecord) { app = (ProcessRecord) token;
private void performScheduleReceiver(IVClient client, int vuid, ActivityInfo info, Intent intent, PendingResultData result) { ComponentName componentName = ComponentUtils.toComponentName(info); BroadcastSystem.get().broadcastSent(vuid, info, result); try { client.scheduleReceiver(info.processName, componentName, intent, result); } catch (Throwable e) { if (result != null) { result.finish(); } } }
private void deliverNewIntentLocked(ActivityRecord sourceRecord, ActivityRecord targetRecord, Intent intent) { if (targetRecord == null) { return; } String creator = sourceRecord != null ? sourceRecord.component.getPackageName() : "android"; try { targetRecord.process.client.scheduleNewIntent(creator, targetRecord.token, intent); } catch (RemoteException e) { e.printStackTrace(); } catch (NullPointerException npe) { npe.printStackTrace(); } }
ProcessRecord startProcessIfNeedLocked(String processName, int userId, String packageName) { if (VActivityManagerService.get().getFreeStubCount() < 3) { // run GC killAllApps(); } PackageSetting ps = PackageCacheManager.getSetting(packageName); ApplicationInfo info = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId); if (ps == null || info == null) { return null; } if (!ps.isLaunched(userId)) { sendFirstLaunchBroadcast(ps, userId); ps.setLaunched(userId, true); VAppManagerService.get().savePersistenceData(); } int uid = VUserHandle.getUid(userId, ps.appId); ProcessRecord app = mProcessNames.get(processName, uid); if (app != null && app.client.asBinder().pingBinder()) { return app; } int vpid = queryFreeStubProcessLocked(); if (vpid == -1) { return null; } app = performStartProcessLocked(uid, vpid, info, processName); if (app != null) { app.pkgList.add(info.packageName); } return app; }
private void performScheduleReceiver(IVClient client, int vuid, ActivityInfo info, Intent intent, PendingResultData result) { ComponentName componentName = ComponentUtils.toComponentName(info); BroadcastSystem.get().broadcastSent(vuid, info, result); try { client.scheduleReceiver(info.processName, componentName, intent, result); } catch (Throwable e) { if (result != null) { result.finish(); } } }
private void deliverNewIntentLocked(ActivityRecord sourceRecord, ActivityRecord targetRecord, Intent intent) { if (targetRecord == null) { return; } String creator = sourceRecord != null ? sourceRecord.component.getPackageName() : "android"; try { targetRecord.process.client.scheduleNewIntent(creator, targetRecord.token, intent); } catch (RemoteException e) { e.printStackTrace(); } catch (NullPointerException npe) { npe.printStackTrace(); } }
ProcessRecord startProcessIfNeedLocked(String processName, int userId, String packageName) { if (VActivityManagerService.get().getFreeStubCount() < 3) { // run GC killAllApps(); } PackageSetting ps = PackageCacheManager.getSetting(packageName); ApplicationInfo info = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId); if (ps == null || info == null) { return null; } if (!ps.isLaunched(userId)) { sendFirstLaunchBroadcast(ps, userId); ps.setLaunched(userId, true); VAppManagerService.get().savePersistenceData(); } int uid = VUserHandle.getUid(userId, ps.appId); ProcessRecord app = mProcessNames.get(processName, uid); if (app != null && app.client.asBinder().pingBinder()) { return app; } int vpid = queryFreeStubProcessLocked(); if (vpid == -1) { return null; } app = performStartProcessLocked(uid, vpid, info, processName); if (app != null) { app.pkgList.add(info.packageName); } return app; }
@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; }
thread = ApplicationThreadCompat.asInterface(client.getAppThread()); } catch (RemoteException e) { IBinder token = client.getToken(); if (token instanceof ProcessRecord) { app = (ProcessRecord) token;
@Override public void run() { try { r.process.client.finishActivity(r.token); } catch (RemoteException e) { e.printStackTrace(); } } });
private void performScheduleReceiver(IVClient client, int vuid, ActivityInfo info, Intent intent, PendingResultData result) { ComponentName componentName = ComponentUtils.toComponentName(info); BroadcastSystem.get().broadcastSent(vuid, info, result); try { client.scheduleReceiver(info.processName, componentName, intent, result); } catch (Throwable e) { if (result != null) { result.finish(); } } }
private void deliverNewIntentLocked(ActivityRecord sourceRecord, ActivityRecord targetRecord, Intent intent) { if (targetRecord == null) { return; } String creator = sourceRecord != null ? sourceRecord.component.getPackageName() : "android"; try { targetRecord.process.client.scheduleNewIntent(creator, targetRecord.token, intent); } catch (RemoteException e) { e.printStackTrace(); } catch (NullPointerException npe) { npe.printStackTrace(); } }
ProcessRecord startProcessIfNeedLocked(String processName, int userId, String packageName) { if (VActivityManagerService.get().getFreeStubCount() < 3) { // run GC killAllApps(); } PackageSetting ps = PackageCacheManager.getSetting(packageName); ApplicationInfo info = VPackageManagerService.get().getApplicationInfo(packageName, 0, userId); if (ps == null || info == null) { return null; } if (!ps.isLaunched(userId)) { sendFirstLaunchBroadcast(ps, userId); ps.setLaunched(userId, true); VAppManagerService.get().savePersistenceData(); } int uid = VUserHandle.getUid(userId, ps.appId); ProcessRecord app = mProcessNames.get(processName, uid); if (app != null && app.client.asBinder().isBinderAlive()) { return app; } int vpid = queryFreeStubProcessLocked(); if (vpid == -1) { return null; } app = performStartProcessLocked(uid, vpid, info, processName); if (app != null) { app.pkgList.add(info.packageName); } return app; }
@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; }
thread = ApplicationThreadCompat.asInterface(client.getAppThread()); } catch (RemoteException e) { IBinder token = client.getToken(); if (token instanceof ProcessRecord) { app = (ProcessRecord) token;
@Override public void run() { try { r.process.client.finishActivity(r.token); } catch (RemoteException e) { e.printStackTrace(); } } });