[core] Extend modules' scope for themselves to all users

This commit is contained in:
LoveSy 2021-05-21 05:43:14 +08:00 committed by LoveSy
parent 9d417fa6cf
commit 3600359b33
1 changed files with 9 additions and 1 deletions

View File

@ -414,8 +414,16 @@ public class ConfigManager {
obsoletePackages.add(app);
continue;
}
for (ProcessScope processScope : processesScope)
for (ProcessScope processScope : processesScope) {
cachedScope.computeIfAbsent(processScope, ignored -> new HashMap<>()).put(module_pkg, apk_path);
if (module_pkg.equals(app.packageName)) {
var appId = processScope.uid % PER_USER_RANGE;
for (var user : UserService.getUsers()) {
cachedScope.computeIfAbsent(new ProcessScope(processScope.processName, user * PER_USER_RANGE + appId),
ignored -> new HashMap<>()).put(module_pkg, apk_path);
}
}
}
} catch (RemoteException e) {
Log.e(TAG, Log.getStackTraceString(e));
}