public void refreshAuthenticatorCache(String packageName) { cache.authenticators.clear(); Intent intent = new Intent(AccountManager.ACTION_AUTHENTICATOR_INTENT); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices(intent, null, PackageManager.GET_META_DATA, 0), cache.authenticators, new RegisteredServicesParser()); }
@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); } } } }
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; }
public void refreshServiceCache(String packageName) { Intent intent = new Intent("android.content.SyncAdapter"); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices( intent, null, PackageManager.GET_META_DATA, 0 ), mAppSyncAdapterInfos, new RegisteredServicesParser() ); }
@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); } } } }
public static VPackage remove(String packageName) { synchronized (PackageCacheManager.class) { VPackageManagerService.get().deletePackageLocked(packageName); return PACKAGE_CACHE.remove(packageName); } } }
@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); } } } }
public static void put(VPackage pkg, PackageSetting ps) { synchronized (PackageCacheManager.class) { PackageParserEx.initApplicationInfoBase(ps, pkg); PACKAGE_CACHE.put(pkg.packageName, pkg); pkg.mExtras = ps; VPackageManagerService.get().analyzePackageLocked(pkg); } }
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 boolean onCreate() { Context context = getContext(); DaemonService.startup(context); if (!VirtualCore.get().isStartup()) { return true; } VPackageManagerService.systemReady(); addService(ServiceManagerNative.PACKAGE, VPackageManagerService.get()); VActivityManagerService.systemReady(context); addService(ServiceManagerNative.ACTIVITY, VActivityManagerService.get()); addService(ServiceManagerNative.USER, VUserManagerService.get()); VAppManagerService.systemReady(); addService(ServiceManagerNative.APP, VAppManagerService.get()); BroadcastSystem.attach(VActivityManagerService.get(), VAppManagerService.get()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { addService(ServiceManagerNative.JOB, VJobSchedulerService.get()); } VNotificationManagerService.systemReady(context); addService(ServiceManagerNative.NOTIFICATION, VNotificationManagerService.get()); VAppManagerService.get().scanApps(); VAccountManagerService.systemReady(); addService(ServiceManagerNative.ACCOUNT, VAccountManagerService.get()); addService(ServiceManagerNative.VS, VirtualStorageService.get()); addService(ServiceManagerNative.DEVICE, VDeviceManagerService.get()); addService(ServiceManagerNative.VIRTUAL_LOC, VirtualLocationService.get()); return true; }
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; }
public void refreshAuthenticatorCache(String packageName) { cache.authenticators.clear(); Intent intent = new Intent(AccountManager.ACTION_AUTHENTICATOR_INTENT); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices(intent, null, PackageManager.GET_META_DATA, 0), cache.authenticators, new RegisteredServicesParser()); }
public void refreshAuthenticatorCache(String packageName) { cache.authenticators.clear(); Intent intent = new Intent(AccountManager.ACTION_AUTHENTICATOR_INTENT); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices(intent, null, PackageManager.GET_META_DATA, 0), cache.authenticators, new RegisteredServicesParser()); }
public void refreshServiceCache(String packageName) { Intent intent = new Intent("android.content.SyncAdapter"); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices( intent, null, PackageManager.GET_META_DATA, 0 ), mAppSyncAdapterInfos, new RegisteredServicesParser() ); }
public static VPackage remove(String packageName) { synchronized (PackageCacheManager.class) { VPackageManagerService.get().deletePackageLocked(packageName); return PACKAGE_CACHE.remove(packageName); } } }
public static VPackage remove(String packageName) { synchronized (PackageCacheManager.class) { VPackageManagerService.get().deletePackageLocked(packageName); return PACKAGE_CACHE.remove(packageName); } } }
public void refreshServiceCache(String packageName) { Intent intent = new Intent("android.content.SyncAdapter"); if (packageName != null) { intent.setPackage(packageName); } generateServicesMap( VPackageManagerService.get().queryIntentServices( intent, null, PackageManager.GET_META_DATA, 0 ), mAppSyncAdapterInfos, new RegisteredServicesParser() ); }
public static void put(VPackage pkg, PackageSetting ps) { synchronized (PackageCacheManager.class) { PackageParserEx.initApplicationInfoBase(ps, pkg); PACKAGE_CACHE.put(pkg.packageName, pkg); pkg.mExtras = ps; VPackageManagerService.get().analyzePackageLocked(pkg); } }
public static void put(VPackage pkg, PackageSetting ps) { synchronized (PackageCacheManager.class) { PackageParserEx.initApplicationInfoBase(ps, pkg); PACKAGE_CACHE.put(pkg.packageName, pkg); pkg.mExtras = ps; VPackageManagerService.get().analyzePackageLocked(pkg); } }
@Override public boolean onCreate() { Context context = getContext(); DaemonService.startup(context); if (!VirtualCore.get().isStartup()) { return true; } VPackageManagerService.systemReady(); addService(ServiceManagerNative.PACKAGE, VPackageManagerService.get()); VActivityManagerService.systemReady(context); addService(ServiceManagerNative.ACTIVITY, VActivityManagerService.get()); addService(ServiceManagerNative.USER, VUserManagerService.get()); VAppManagerService.systemReady(); addService(ServiceManagerNative.APP, VAppManagerService.get()); BroadcastSystem.attach(VActivityManagerService.get(), VAppManagerService.get()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { addService(ServiceManagerNative.JOB, VJobSchedulerService.get()); } VNotificationManagerService.systemReady(context); addService(ServiceManagerNative.NOTIFICATION, VNotificationManagerService.get()); VAppManagerService.get().scanApps(); VAccountManagerService.systemReady(); addService(ServiceManagerNative.ACCOUNT, VAccountManagerService.get()); addService(ServiceManagerNative.VS, VirtualStorageService.get()); addService(ServiceManagerNative.DEVICE, VDeviceManagerService.get()); addService(ServiceManagerNative.VIRTUAL_LOC, VirtualLocationService.get()); return true; }