mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 09:26:51 +00:00
Adding support for customizing shortcut pinning logic
> Allowing support for overring shortcut badge > Updating pendingShortcutInfo so that the handler can be easily overridden Bug: 268253894 Test: Verified on device Change-Id: I3184cb6494bc98c7eed33798b35b4e6e6a1e7ddc
This commit is contained in:
@@ -171,15 +171,22 @@ public class InstallSessionHelper {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
String pkg = sessionInfo.getInstallerPackageName();
|
||||
return isTrustedPackage(sessionInfo.getInstallerPackageName(), getUserHandle(sessionInfo))
|
||||
? sessionInfo : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the provided packageName can be trusted for user configurations
|
||||
*/
|
||||
public boolean isTrustedPackage(String pkg, UserHandle user) {
|
||||
synchronized (mSessionVerifiedMap) {
|
||||
if (!mSessionVerifiedMap.containsKey(pkg)) {
|
||||
boolean hasSystemFlag = new PackageManagerHelper(mAppContext).getApplicationInfo(
|
||||
pkg, getUserHandle(sessionInfo), ApplicationInfo.FLAG_SYSTEM) != null;
|
||||
pkg, user, ApplicationInfo.FLAG_SYSTEM) != null;
|
||||
mSessionVerifiedMap.put(pkg, DEBUG || hasSystemFlag);
|
||||
}
|
||||
}
|
||||
return mSessionVerifiedMap.get(pkg) ? sessionInfo : null;
|
||||
return mSessionVerifiedMap.get(pkg);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
||||
Reference in New Issue
Block a user