本文整理汇总了Java中android.content.pm.ApplicationInfo.FLAG_HAS_CODE属性的典型用法代码示例。如果您正苦于以下问题:Java ApplicationInfo.FLAG_HAS_CODE属性的具体用法?Java ApplicationInfo.FLAG_HAS_CODE怎么用?Java ApplicationInfo.FLAG_HAS_CODE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.content.pm.ApplicationInfo
的用法示例。
在下文中一共展示了ApplicationInfo.FLAG_HAS_CODE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processRestarted
@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);
}
}
}
}
示例2: initApplicationInfoBase
public static void initApplicationInfoBase(PackageSetting ps, VPackage p) {
ApplicationInfo ai = p.applicationInfo;
ai.flags |= ApplicationInfo.FLAG_HAS_CODE;
if (TextUtils.isEmpty(ai.processName)) {
ai.processName = ai.packageName;
}
ai.enabled = true;
ai.nativeLibraryDir = ps.libPath;
ai.uid = ps.appId;
ai.name = ComponentFixer.fixComponentClassName(ps.packageName, ai.name);
ai.publicSourceDir = ps.apkPath;
ai.sourceDir = ps.apkPath;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
ai.splitSourceDirs = new String[]{ps.apkPath};
ai.splitPublicSourceDirs = ai.splitSourceDirs;
ApplicationInfoL.scanSourceDir.set(ai, ai.dataDir);
ApplicationInfoL.scanPublicSourceDir.set(ai, ai.dataDir);
String hostPrimaryCpuAbi = ApplicationInfoL.primaryCpuAbi.get(VirtualCore.get().getContext().getApplicationInfo());
ApplicationInfoL.primaryCpuAbi.set(ai, hostPrimaryCpuAbi);
}
if (ps.dependSystem) {
String[] sharedLibraryFiles = sSharedLibCache.get(ps.packageName);
if (sharedLibraryFiles == null) {
PackageManager hostPM = VirtualCore.get().getUnHookPackageManager();
try {
ApplicationInfo hostInfo = hostPM.getApplicationInfo(ps.packageName, PackageManager.GET_SHARED_LIBRARY_FILES);
sharedLibraryFiles = hostInfo.sharedLibraryFiles;
if (sharedLibraryFiles == null) sharedLibraryFiles = new String[0];
sSharedLibCache.put(ps.packageName, sharedLibraryFiles);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
ai.sharedLibraryFiles = sharedLibraryFiles;
}
}
示例3: fixApplicationInfo
public static void fixApplicationInfo(AppSetting setting, ApplicationInfo applicationInfo, int userId) {
applicationInfo.flags |= ApplicationInfo.FLAG_HAS_CODE;
if (TextUtils.isEmpty(applicationInfo.processName)) {
applicationInfo.processName = applicationInfo.packageName;
}
applicationInfo.name = fixComponentClassName(setting.packageName, applicationInfo.name);
applicationInfo.publicSourceDir = setting.apkPath;
applicationInfo.sourceDir = setting.apkPath;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
applicationInfo.splitSourceDirs = new String[]{setting.apkPath};
applicationInfo.splitPublicSourceDirs = applicationInfo.splitSourceDirs;
ApplicationInfoL.scanSourceDir.set(applicationInfo, applicationInfo.dataDir);
ApplicationInfoL.scanPublicSourceDir.set(applicationInfo, applicationInfo.dataDir);
String hostPrimaryCpuAbi = ApplicationInfoL.primaryCpuAbi.get(VirtualCore.get().getContext().getApplicationInfo());
ApplicationInfoL.primaryCpuAbi.set(applicationInfo, hostPrimaryCpuAbi);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
ApplicationInfoN.deviceEncryptedDataDir.set(applicationInfo, applicationInfo.dataDir);
ApplicationInfoN.deviceProtectedDataDir.set(applicationInfo, applicationInfo.dataDir);
ApplicationInfoN.credentialEncryptedDataDir.set(applicationInfo, applicationInfo.dataDir);
ApplicationInfoN.credentialProtectedDataDir.set(applicationInfo, applicationInfo.dataDir);
}
applicationInfo.enabled = true;
applicationInfo.nativeLibraryDir = setting.libPath;
applicationInfo.dataDir = VEnvironment.getDataUserPackageDirectory(userId, setting.packageName).getPath();
applicationInfo.uid = setting.appId;
if (setting.dependSystem) {
String[] sharedLibraryFiles = sSharedLibCache.get(setting.packageName);
if (sharedLibraryFiles == null) {
PackageManager hostPM = VirtualCore.get().getUnHookPackageManager();
try {
ApplicationInfo hostInfo = hostPM.getApplicationInfo(setting.packageName, PackageManager.GET_SHARED_LIBRARY_FILES);
sharedLibraryFiles = hostInfo.sharedLibraryFiles;
if (sharedLibraryFiles == null) sharedLibraryFiles = new String[0];
sSharedLibCache.put(setting.packageName, sharedLibraryFiles);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
}
applicationInfo.sharedLibraryFiles = sharedLibraryFiles;
}
}