Fix resolved AppDescriptor not cached with root

This commit is contained in:
emanuele-f 2022-06-08 11:25:51 +02:00
parent 711d970279
commit 31488d55e1

View File

@ -141,7 +141,7 @@ public class AppsResolver {
PackageInfo pinfo = (PackageInfo) getPackageInfoAsUser.invoke(mPm, packageName, pm_flags, Utils.getUserId(uid));
if(pinfo != null)
return new AppDescriptor(mPm, pinfo);
app = new AppDescriptor(mPm, pinfo);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
Log.w(TAG, "getPackageInfoAsUser call fails, falling back to standard resolution");
e.printStackTrace();
@ -149,7 +149,9 @@ public class AppsResolver {
}
}
app = resolve(mPm, packageName, pm_flags);
if(app == null)
app = resolve(mPm, packageName, pm_flags);
if(app != null)
mApps.put(uid, app);