[app] Call getEnabledModules() in reloadSingleModule() (#658)

* To get a reliable enabled status, we have to rely on
   backend every time a module is uninstalled from
   the manager.

Co-authored-by: tehcneko <7764726+tehcneko@users.noreply.github.com>
This commit is contained in:
Wang Han 2021-05-22 21:49:40 +08:00 committed by GitHub
parent 33cf2b994c
commit 85bf905d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -103,6 +103,10 @@ public final class ModuleUtil {
public InstalledModule reloadSingleModule(String packageName, int userId) {
PackageInfo pkg;
// Call getEnabledModules() here to let backend handle enabled status
enabledModules = new HashSet<>(Arrays.asList(ConfigManager.getEnabledModules()));
try {
pkg = ConfigManager.getPackageInfo(packageName, PackageManager.GET_META_DATA, userId);
if (pkg == null) {