Removing multiple system RPCs to packageMAnager and userManager from UI thread

Bug: 158427348
Change-Id: Ibb1837fe932000b69cf5683bb01727fc32abca91
This commit is contained in:
Sunny Goyal
2020-06-08 17:06:09 -07:00
parent 70ff0c1144
commit 28daf4a76f
18 changed files with 213 additions and 121 deletions
@@ -52,6 +52,7 @@ public class AllAppsStore {
private final List<OnUpdateListener> mUpdateListeners = new CopyOnWriteArrayList<>();
private final ArrayList<ViewGroup> mIconContainers = new ArrayList<>();
private int mModelFlags;
private int mDeferUpdatesFlags = 0;
private boolean mUpdatePending = false;
@@ -63,11 +64,21 @@ public class AllAppsStore {
/**
* Sets the current set of apps.
*/
public void setApps(AppInfo[] apps) {
public void setApps(AppInfo[] apps, int flags) {
mApps = apps;
mModelFlags = flags;
notifyUpdate();
}
/**
* @see com.android.launcher3.model.BgDataModel.Callbacks#FLAG_QUIET_MODE_ENABLED
* @see com.android.launcher3.model.BgDataModel.Callbacks#FLAG_HAS_SHORTCUT_PERMISSION
* @see com.android.launcher3.model.BgDataModel.Callbacks#FLAG_QUIET_MODE_CHANGE_PERMISSION
*/
public boolean hasModelFlag(int mask) {
return (mModelFlags & mask) != 0;
}
public AppInfo getApp(ComponentKey key) {
mTempInfo.componentName = key.componentName;
mTempInfo.user = key.user;