Ensuring that badge override is respected even if component name

is set on the Shortcut

Bug: 276319271
Test: atest IconCacheTest
Flag: N/A
Change-Id: I33802ecd23485ba092f842ec3c3d58e2fc286f92
This commit is contained in:
Sunny Goyal
2023-03-31 09:08:27 -07:00
parent 3f10b13a09
commit 899bf30fe8
3 changed files with 164 additions and 29 deletions

View File

@@ -181,9 +181,10 @@ public class InstallSessionHelper {
public boolean isTrustedPackage(String pkg, UserHandle user) {
synchronized (mSessionVerifiedMap) {
if (!mSessionVerifiedMap.containsKey(pkg)) {
boolean hasSystemFlag = new PackageManagerHelper(mAppContext).getApplicationInfo(
pkg, user, ApplicationInfo.FLAG_SYSTEM) != null;
mSessionVerifiedMap.put(pkg, DEBUG || hasSystemFlag);
boolean hasSystemFlag = DEBUG || mAppContext.getPackageName().equals(pkg)
|| new PackageManagerHelper(mAppContext)
.getApplicationInfo(pkg, user, ApplicationInfo.FLAG_SYSTEM) != null;
mSessionVerifiedMap.put(pkg, hasSystemFlag);
}
}
return mSessionVerifiedMap.get(pkg);