Migrate PackageManagerHelper to MainThreadInitializedObject
- This is in preparation for other things that can be loaded with PMH initialization and prevents duplicate temporary helpers from loading this many times. - Most calls in PMH can use the app context, but one call requires starting activities/showing toasts so that one needs to take the context and can be made static instead. Bug: 323112914 Test: atest NexusLauncherTests Change-Id: Id11c780955880cf49c022cbf2744c41e1b696355
This commit is contained in:
@@ -78,7 +78,7 @@ public class ShortcutsChangedTask extends BaseModelUpdateTask {
|
||||
|
||||
if (!matchingWorkspaceItems.isEmpty()) {
|
||||
if (mShortcuts.isEmpty()) {
|
||||
PackageManagerHelper packageManagerHelper = new PackageManagerHelper(
|
||||
PackageManagerHelper packageManagerHelper = PackageManagerHelper.INSTANCE.get(
|
||||
app.getContext());
|
||||
// Verify that the app is indeed installed.
|
||||
if (!packageManagerHelper.isAppInstalled(mPackageName, mUser)
|
||||
|
||||
Reference in New Issue
Block a user