Fix logical shortcut (#1632)

This commit is contained in:
LoveSy 2022-02-05 17:37:03 +08:00 committed by GitHub
parent bde9990c50
commit 9f20d8609f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -810,6 +810,7 @@ public class ConfigManager {
public boolean disableModule(String packageName) {
if (packageName.equals("lspd")) return false;
Log.e(TAG, "disable " + packageName);
boolean changed = executeInTransaction(() -> {
ContentValues values = new ContentValues();
values.put("enabled", 0);
@ -829,13 +830,13 @@ public class ConfigManager {
PackageInfo pkgInfo = PackageService.getPackageInfoFromAllUsers(packageName, PackageService.MATCH_ALL_FLAGS).values().stream().findFirst().orElse(null);
if (pkgInfo == null || pkgInfo.applicationInfo == null) return false;
var modulePath = getModuleApkPath(pkgInfo.applicationInfo);
if (modulePath == null) return true;
boolean changed = updateModuleApkPath(packageName, modulePath, false) ||
executeInTransaction(() -> {
if (modulePath == null) return false;
boolean changed = updateModuleApkPath(packageName, modulePath, false);
changed = executeInTransaction(() -> {
ContentValues values = new ContentValues();
values.put("enabled", 1);
return db.update("modules", values, "module_pkg_name = ?", new String[]{packageName}) > 0;
});
}) || changed;
if (changed) {
// Called by manager, should be async
updateCaches(false);