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:56:36 -07:00
parent 70ff0c1144
commit 28daf4a76f
18 changed files with 213 additions and 121 deletions
@@ -35,6 +35,7 @@ import androidx.annotation.Nullable;
import com.android.launcher3.AppFilter;
import com.android.launcher3.compat.AlphabeticIndexCompat;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.BgDataModel.Callbacks;
import com.android.launcher3.model.data.AppInfo;
import com.android.launcher3.model.data.PromiseAppInfo;
import com.android.launcher3.pm.PackageInstallInfo;
@@ -72,6 +73,13 @@ public class AllAppsList {
private AlphabeticIndexCompat mIndex;
/**
* @see Callbacks#FLAG_HAS_SHORTCUT_PERMISSION
* @see Callbacks#FLAG_QUIET_MODE_ENABLED
* @see Callbacks#FLAG_QUIET_MODE_CHANGE_PERMISSION
*/
private int mFlags;
/**
* Boring constructor.
*/
@@ -90,6 +98,33 @@ public class AllAppsList {
return result;
}
/**
* Helper to checking {@link Callbacks#FLAG_HAS_SHORTCUT_PERMISSION}
*/
public boolean hasShortcutHostPermission() {
return (mFlags & Callbacks.FLAG_HAS_SHORTCUT_PERMISSION) != 0;
}
/**
* Sets or clears the provided flag
*/
public void setFlags(int flagMask, boolean enabled) {
if (enabled) {
mFlags |= flagMask;
} else {
mFlags &= ~flagMask;
}
mDataChanged = true;
}
/**
* Returns the model flags
*/
public int getFlags() {
return mFlags;
}
/**
* Add the supplied ApplicationInfo objects to the list, and enqueue it into the
* list to broadcast when notify() is called.