[core] [app] Show freezed apps

This commit is contained in:
LoveSy 2021-03-03 20:07:47 +08:00 committed by LoveSy
parent bbcc3437b9
commit 4442f684b9
2 changed files with 5 additions and 2 deletions

View File

@ -118,7 +118,7 @@ public class AppHelper {
public static List<PackageInfo> getAppList(boolean force) {
if (appList == null || force) {
appList = ConfigManager.getInstalledPackagesFromAllUsers(PackageManager.GET_META_DATA, true);
appList = ConfigManager.getInstalledPackagesFromAllUsers(PackageManager.GET_META_DATA | PackageManager.MATCH_UNINSTALLED_PACKAGES, true);
}
return appList;
}

View File

@ -31,6 +31,7 @@ import android.os.ServiceManager;
import android.util.Log;
import android.util.Pair;
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@ -97,7 +98,7 @@ public class PackageService {
}
if (filterNoProcess) {
res = res.stream().filter(packageInfo -> {
int baseFlag = PackageManager.MATCH_DISABLED_COMPONENTS | PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
int baseFlag = PackageManager.MATCH_DISABLED_COMPONENTS | PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE | PackageManager.MATCH_UNINSTALLED_PACKAGES;
try {
PackageInfo pkgInfo = getPackageInfoWithComponents(packageInfo.packageName, baseFlag, packageInfo.applicationInfo.uid / 100000);
return !fetchProcesses(pkgInfo).isEmpty();
@ -171,6 +172,8 @@ public class PackageService {
}
}
if (pkgInfo == null || pkgInfo.applicationInfo == null || pkgInfo.applicationInfo.sourceDir == null || pkgInfo.applicationInfo.deviceProtectedDataDir == null || !new File(pkgInfo.applicationInfo.sourceDir).exists() || !new File(pkgInfo.applicationInfo.deviceProtectedDataDir).exists())
return null;
return pkgInfo;
}
}