Merge branch 'android15-release' into merge-aosp15
This commit is contained in:
commit
eeb7416bfe
1401 files changed
+86072
-39248
No files matched your search
@@ -17,11 +17,13 @@
|
||||
*/
|
||||
package com.android.launcher3.model;
|
||||
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_ENABLED;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_WORK_PROFILE_QUIET_MODE_ENABLED;
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED;
|
||||
import static com.android.launcher3.model.data.WorkspaceItemInfo.FLAG_AUTOINSTALL_ICON;
|
||||
import static com.android.launcher3.model.data.WorkspaceItemInfo.FLAG_RESTORED_ICON;
|
||||
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -35,8 +37,9 @@ import android.content.pm.PackageManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.Flags;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.LauncherModel.ModelUpdateTask;
|
||||
import com.android.launcher3.LauncherSettings;
|
||||
import com.android.launcher3.LauncherSettings.Favorites;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
@@ -48,7 +51,7 @@ import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.pm.PackageInstallInfo;
|
||||
import com.android.launcher3.pm.UserCache;
|
||||
import com.android.launcher3.shortcuts.ShortcutRequest;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.util.ApiWrapper;
|
||||
import com.android.launcher3.util.FlagOp;
|
||||
import com.android.launcher3.util.IntSet;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
@@ -70,13 +73,16 @@ import java.util.stream.Collectors;
|
||||
import app.lawnchair.preferences.PreferenceManager;
|
||||
|
||||
/**
|
||||
* Handles updates due to changes in package manager (app installed/updated/removed)
|
||||
* Handles updates due to changes in package manager (app
|
||||
* installed/updated/removed)
|
||||
* or when a user availability changes.
|
||||
*/
|
||||
public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
@SuppressWarnings("NewApi")
|
||||
public class PackageUpdatedTask implements ModelUpdateTask {
|
||||
|
||||
private static boolean DEBUG = false;
|
||||
// TODO(b/290090023): Set to false after root causing is done.
|
||||
private static final String TAG = "PackageUpdatedTask";
|
||||
private static final boolean DEBUG = true;
|
||||
|
||||
public static final int OP_NONE = 0;
|
||||
public static final int OP_ADD = 1;
|
||||
@@ -108,8 +114,9 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(@NonNull final LauncherAppState app, @NonNull final BgDataModel dataModel,
|
||||
@NonNull final AllAppsList appsList) {
|
||||
public void execute(@NonNull ModelTaskController taskController, @NonNull BgDataModel dataModel,
|
||||
@NonNull AllAppsList appsList) {
|
||||
final LauncherAppState app = taskController.getApp();
|
||||
final Context context = app.getContext();
|
||||
final IconCache iconCache = app.getIconCache();
|
||||
|
||||
@@ -122,41 +129,39 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
: ItemInfoMatcher.ofPackages(packageSet, mUser);
|
||||
final HashSet<ComponentName> removedComponents = new HashSet<>();
|
||||
final HashMap<String, List<LauncherActivityInfo>> activitiesLists = new HashMap<>();
|
||||
final PackageManagerHelper packageManagerHelper = new PackageManagerHelper(context);
|
||||
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Package updated: mOp=" + getOpString()
|
||||
+ " packages=" + Arrays.toString(packages));
|
||||
}
|
||||
switch (mOp) {
|
||||
case OP_ADD: {
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (DEBUG) Log.d(TAG, "mAllAppsList.addPackage " + packages[i]);
|
||||
iconCache.updateIconsForPkg(packages[i], mUser);
|
||||
if (FeatureFlags.PROMISE_APPS_IN_ALL_APPS.get()) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "OP_ADD: PROMISE_APPS_IN_ALL_APPS enabled:"
|
||||
+ " removing promise icon apps from package=" + packages[i]);
|
||||
}
|
||||
appsList.removePackage(packages[i], mUser);
|
||||
}
|
||||
activitiesLists.put(
|
||||
packages[i], appsList.addPackage(context, packages[i], mUser));
|
||||
activitiesLists.put(packages[i],
|
||||
appsList.addPackage(context, packages[i], mUser));
|
||||
}
|
||||
flagOp = FlagOp.removeFlag(WorkspaceItemInfo.FLAG_DISABLED_NOT_AVAILABLE);
|
||||
break;
|
||||
}
|
||||
case OP_UPDATE:
|
||||
try (SafeCloseable t =
|
||||
appsList.trackRemoves(a -> removedComponents.add(a.componentName))) {
|
||||
try (SafeCloseable t = appsList.trackRemoves(a -> {
|
||||
Log.d(TAG, "OP_UPDATE - AllAppsList.trackRemoves callback:"
|
||||
+ " removed component=" + a.componentName
|
||||
+ " id=" + a.id
|
||||
+ " Look for earlier AllAppsList logs to find more information.");
|
||||
removedComponents.add(a.componentName);
|
||||
})) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (DEBUG) Log.d(TAG, "mAllAppsList.updatePackage " + packages[i]);
|
||||
iconCache.updateIconsForPkg(packages[i], mUser);
|
||||
activitiesLists.put(
|
||||
packages[i], appsList.updatePackage(context, packages[i], mUser));
|
||||
|
||||
// The update may have changed which shortcuts/widgets are available.
|
||||
// Refresh the widgets for the package if we have an activity running.
|
||||
Launcher launcher = Launcher.ACTIVITY_TRACKER.getCreatedActivity();
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.WORK_TAB_MISSING, "launcher: " + launcher);
|
||||
}
|
||||
if (launcher != null) {
|
||||
launcher.refreshAndBindWidgetsForPackageUser(
|
||||
new PackageUserKey(packages[i], mUser));
|
||||
}
|
||||
activitiesLists.put(packages[i],
|
||||
appsList.updatePackage(context, packages[i], mUser));
|
||||
}
|
||||
}
|
||||
// Since package was just updated, the target must be available now.
|
||||
@@ -164,22 +169,25 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
break;
|
||||
case OP_REMOVE: {
|
||||
for (int i = 0; i < N; i++) {
|
||||
FileLog.d(TAG, "Removing app icon" + packages[i]);
|
||||
iconCache.removeIconsForPkg(packages[i], mUser);
|
||||
PreferenceManager pm = PreferenceManager.getInstance(context);
|
||||
if (packages[i].equals(pm.getIconPackPackage().get())) {
|
||||
pm.getIconPackPackage().set("");
|
||||
};
|
||||
}
|
||||
;
|
||||
if (packages[i].equals(pm.getThemedIconPackPackage().get())) {
|
||||
pm.getThemedIconPackPackage().set("");
|
||||
};
|
||||
}
|
||||
;
|
||||
final boolean isThemedIconsAvailable = context.getPackageManager()
|
||||
.queryIntentActivityOptions(
|
||||
new ComponentName(context.getApplicationInfo().packageName, context.getApplicationInfo().className),
|
||||
null,
|
||||
new Intent(context.getResources().getString(R.string.icon_packs_intent_name)),
|
||||
PackageManager.GET_RESOLVED_FILTER).stream().map(it -> it.activityInfo.packageName)
|
||||
.noneMatch(it -> packageManagerHelper.isAppInstalled(it, mUser));
|
||||
.queryIntentActivityOptions(
|
||||
new ComponentName(context.getApplicationInfo().packageName,
|
||||
context.getApplicationInfo().className),
|
||||
null,
|
||||
new Intent(context.getResources().getString(R.string.icon_packs_intent_name)),
|
||||
PackageManager.GET_RESOLVED_FILTER)
|
||||
.stream().map(it -> it.activityInfo.packageName)
|
||||
.noneMatch(it -> packageManagerHelper.isAppInstalled(it, mUser));
|
||||
if (isThemedIconsAvailable) {
|
||||
pm.getThemedIcons().set(false);
|
||||
}
|
||||
@@ -188,7 +196,9 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
case OP_UNAVAILABLE:
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (DEBUG) Log.d(TAG, "mAllAppsList.removePackage " + packages[i]);
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, getOpString() + ": removing package=" + packages[i]);
|
||||
}
|
||||
appsList.removePackage(packages[i], mUser);
|
||||
}
|
||||
flagOp = FlagOp.addFlag(WorkspaceItemInfo.FLAG_DISABLED_NOT_AVAILABLE);
|
||||
@@ -197,19 +207,28 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
case OP_UNSUSPEND:
|
||||
flagOp = FlagOp.NO_OP.setFlag(
|
||||
WorkspaceItemInfo.FLAG_DISABLED_SUSPENDED, mOp == OP_SUSPEND);
|
||||
if (DEBUG) Log.d(TAG, "mAllAppsList.(un)suspend " + N);
|
||||
appsList.updateDisabledFlags(matcher, flagOp);
|
||||
break;
|
||||
case OP_USER_AVAILABILITY_CHANGE: {
|
||||
UserManagerState ums = new UserManagerState();
|
||||
ums.init(UserCache.INSTANCE.get(context),
|
||||
context.getSystemService(UserManager.class));
|
||||
UserManager userManager = context.getSystemService(UserManager.class);
|
||||
ums.init(UserCache.INSTANCE.get(context), userManager);
|
||||
boolean isUserQuiet = ums.isUserQuiet(mUser);
|
||||
flagOp = FlagOp.NO_OP.setFlag(
|
||||
WorkspaceItemInfo.FLAG_DISABLED_QUIET_USER, ums.isUserQuiet(mUser));
|
||||
WorkspaceItemInfo.FLAG_DISABLED_QUIET_USER, isUserQuiet);
|
||||
appsList.updateDisabledFlags(matcher, flagOp);
|
||||
|
||||
// We are not synchronizing here, as int operations are atomic
|
||||
appsList.setFlags(FLAG_QUIET_MODE_ENABLED, ums.isAnyProfileQuietModeEnabled());
|
||||
if (Flags.enablePrivateSpace()) {
|
||||
UserCache userCache = UserCache.INSTANCE.get(context);
|
||||
if (userCache.getUserInfo(mUser).isWork()) {
|
||||
appsList.setFlags(FLAG_WORK_PROFILE_QUIET_MODE_ENABLED, isUserQuiet);
|
||||
} else if (userCache.getUserInfo(mUser).isPrivate()) {
|
||||
appsList.setFlags(FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED, isUserQuiet);
|
||||
}
|
||||
} else {
|
||||
// We are not synchronizing here, as int operations are atomic
|
||||
appsList.setFlags(FLAG_QUIET_MODE_ENABLED, ums.isAnyProfileQuietModeEnabled());
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -217,7 +236,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
break;
|
||||
}
|
||||
|
||||
bindApplicationsIfNeeded();
|
||||
taskController.bindApplicationsIfNeeded();
|
||||
|
||||
final IntSet removedShortcuts = new IntSet();
|
||||
// Shortcuts to keep even if the corresponding app was removed
|
||||
@@ -251,14 +270,22 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
boolean isTargetValid = !cn.getClassName().equals(
|
||||
IconCache.EMPTY_CLASS_NAME);
|
||||
if (si.itemType == Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
|
||||
List<ShortcutInfo> shortcut =
|
||||
new ShortcutRequest(context, mUser)
|
||||
.forPackage(cn.getPackageName(),
|
||||
si.getDeepShortcutId())
|
||||
.query(ShortcutRequest.PINNED);
|
||||
List<ShortcutInfo> shortcut = new ShortcutRequest(context, mUser)
|
||||
.forPackage(cn.getPackageName(),
|
||||
si.getDeepShortcutId())
|
||||
.query(ShortcutRequest.PINNED);
|
||||
if (shortcut.isEmpty()) {
|
||||
isTargetValid = false;
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Pinned Shortcut not found for updated"
|
||||
+ " package=" + si.getTargetPackage());
|
||||
}
|
||||
} else {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "Found pinned shortcut for updated"
|
||||
+ " package=" + si.getTargetPackage()
|
||||
+ ", isTargetValid=" + isTargetValid);
|
||||
}
|
||||
si.updateFromDeepShortcutInfo(shortcut.get(0), context);
|
||||
infoUpdated = true;
|
||||
}
|
||||
@@ -266,18 +293,33 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
isTargetValid = context.getSystemService(LauncherApps.class)
|
||||
.isActivityEnabled(cn, mUser);
|
||||
}
|
||||
if (!isTargetValid && si.hasStatusFlag(
|
||||
FLAG_RESTORED_ICON | FLAG_AUTOINSTALL_ICON)) {
|
||||
|
||||
if (!isTargetValid && (si.hasStatusFlag(
|
||||
FLAG_RESTORED_ICON | FLAG_AUTOINSTALL_ICON)
|
||||
|| si.isArchived())) {
|
||||
if (updateWorkspaceItemIntent(context, si, packageName)) {
|
||||
infoUpdated = true;
|
||||
} else if (si.hasPromiseIconUi()) {
|
||||
removedShortcuts.add(si.id);
|
||||
if (DEBUG) {
|
||||
FileLog.w(TAG, "Removing restored shortcut promise icon"
|
||||
+ " that no longer points to valid component."
|
||||
+ " id=" + si.id
|
||||
+ ", package=" + si.getTargetPackage()
|
||||
+ ", status=" + si.status
|
||||
+ ", isArchived=" + si.isArchived());
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else if (!isTargetValid) {
|
||||
removedShortcuts.add(si.id);
|
||||
FileLog.e(TAG, "Restored shortcut no longer valid "
|
||||
+ si.getIntent());
|
||||
if (DEBUG) {
|
||||
FileLog.w(TAG, "Removing shortcut that no longer points to"
|
||||
+ " valid component."
|
||||
+ " id=" + si.id
|
||||
+ " package=" + si.getTargetPackage()
|
||||
+ " status=" + si.status);
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
si.status = WorkspaceItemInfo.DEFAULT;
|
||||
@@ -292,13 +334,29 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
if (isNewApkAvailable) {
|
||||
List<LauncherActivityInfo> activities = activitiesLists.get(
|
||||
packageName);
|
||||
// TODO: See if we can migrate this to
|
||||
// AppInfo#updateRuntimeFlagsForActivityTarget
|
||||
si.setProgressLevel(
|
||||
activities == null || activities.isEmpty()
|
||||
? 100
|
||||
: PackageManagerHelper.getLoadingProgress(
|
||||
activities.get(0)),
|
||||
PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING);
|
||||
// In case an app is archived, we need to make sure that archived state
|
||||
// in WorkspaceItemInfo is refreshed.
|
||||
if (Flags.enableSupportForArchiving() && !activities.isEmpty()) {
|
||||
boolean newArchivalState = activities.get(
|
||||
0).getActivityInfo().isArchived;
|
||||
if (newArchivalState != si.isArchived()) {
|
||||
si.runtimeStatusFlags ^= FLAG_ARCHIVED;
|
||||
infoUpdated = true;
|
||||
}
|
||||
}
|
||||
if (si.itemType == Favorites.ITEM_TYPE_APPLICATION) {
|
||||
if (activities != null && !activities.isEmpty()) {
|
||||
si.setNonResizeable(ApiWrapper.INSTANCE.get(context)
|
||||
.isNonResizeableActivity(activities.get(0)));
|
||||
}
|
||||
iconCache.getTitleAndIcon(si, si.usingLowResIcon());
|
||||
infoUpdated = true;
|
||||
}
|
||||
@@ -315,7 +373,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
updatedWorkspaceItems.add(si);
|
||||
}
|
||||
if (infoUpdated && si.id != ItemInfo.NO_ID) {
|
||||
getModelWriter().updateItemInDatabase(si);
|
||||
taskController.getModelWriter().updateItemInDatabase(si);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -324,9 +382,8 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
&& widgetInfo.hasRestoreFlag(
|
||||
LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)
|
||||
&& packageSet.contains(widgetInfo.providerName.getPackageName())) {
|
||||
widgetInfo.restoreStatus &=
|
||||
~LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY
|
||||
& ~LauncherAppWidgetInfo.FLAG_RESTORE_STARTED;
|
||||
widgetInfo.restoreStatus &= ~LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY
|
||||
& ~LauncherAppWidgetInfo.FLAG_RESTORE_STARTED;
|
||||
|
||||
// adding this flag ensures that launcher shows 'click to setup'
|
||||
// if the widget has a config activity. In case there is no config
|
||||
@@ -334,20 +391,21 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
widgetInfo.restoreStatus |= LauncherAppWidgetInfo.FLAG_UI_NOT_READY;
|
||||
|
||||
widgets.add(widgetInfo);
|
||||
getModelWriter().updateItemInDatabase(widgetInfo);
|
||||
taskController.getModelWriter().updateItemInDatabase(widgetInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bindUpdatedWorkspaceItems(updatedWorkspaceItems);
|
||||
taskController.bindUpdatedWorkspaceItems(updatedWorkspaceItems);
|
||||
if (!removedShortcuts.isEmpty()) {
|
||||
deleteAndBindComponentsRemoved(
|
||||
taskController.deleteAndBindComponentsRemoved(
|
||||
ItemInfoMatcher.ofItemIds(removedShortcuts),
|
||||
"removed because the target component is invalid");
|
||||
"removing shortcuts with invalid target components."
|
||||
+ " ids=" + removedShortcuts);
|
||||
}
|
||||
|
||||
if (!widgets.isEmpty()) {
|
||||
scheduleCallbackTask(c -> c.bindWidgetsRestored(widgets));
|
||||
taskController.scheduleCallbackTask(c -> c.bindWidgetsRestored(widgets));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,14 +413,21 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
if (mOp == OP_REMOVE) {
|
||||
// Mark all packages in the broadcast to be removed
|
||||
Collections.addAll(removedPackages, packages);
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "OP_REMOVE: removing packages=" + Arrays.toString(packages));
|
||||
}
|
||||
|
||||
// No need to update the removedComponents as
|
||||
// removedPackages is a super-set of removedComponents
|
||||
} else if (mOp == OP_UPDATE) {
|
||||
// Mark disabled packages in the broadcast to be removed
|
||||
final LauncherApps launcherApps = context.getSystemService(LauncherApps.class);
|
||||
for (int i=0; i<N; i++) {
|
||||
for (int i = 0; i < N; i++) {
|
||||
if (!launcherApps.isPackageEnabled(packages[i], mUser)) {
|
||||
if (DEBUG) {
|
||||
Log.d(TAG, "OP_UPDATE:"
|
||||
+ " package " + packages[i] + " is disabled, removing package.");
|
||||
}
|
||||
removedPackages.add(packages[i]);
|
||||
}
|
||||
}
|
||||
@@ -372,13 +437,13 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
Predicate<ItemInfo> removeMatch = ItemInfoMatcher.ofPackages(removedPackages, mUser)
|
||||
.or(ItemInfoMatcher.ofComponents(removedComponents, mUser))
|
||||
.and(ItemInfoMatcher.ofItemIds(forceKeepShortcuts).negate());
|
||||
deleteAndBindComponentsRemoved(removeMatch,
|
||||
taskController.deleteAndBindComponentsRemoved(removeMatch,
|
||||
"removed because the corresponding package or component is removed. "
|
||||
+ "mOp=" + mOp + " removedPackages=" + removedPackages.stream().collect(
|
||||
Collectors.joining(",", "[", "]"))
|
||||
+ " removedComponents=" + removedComponents.stream()
|
||||
.filter(Objects::nonNull).map(ComponentName::toShortString)
|
||||
.collect(Collectors.joining(",", "[", "]")));
|
||||
.filter(Objects::nonNull).map(ComponentName::toShortString)
|
||||
.collect(Collectors.joining(",", "[", "]")));
|
||||
|
||||
// Remove any queued items from the install queue
|
||||
ItemInstallQueue.INSTANCE.get(context)
|
||||
@@ -386,28 +451,32 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
|
||||
if (mOp == OP_ADD) {
|
||||
// Load widgets for the new package. Changes due to app updates are handled through
|
||||
// Load widgets for the new package. Changes due to app updates are handled
|
||||
// through
|
||||
// AppWidgetHost events, this is just to initialize the long-press options.
|
||||
for (int i = 0; i < N; i++) {
|
||||
dataModel.widgetsModel.update(app, new PackageUserKey(packages[i], mUser));
|
||||
}
|
||||
bindUpdatedWidgets(dataModel);
|
||||
taskController.bindUpdatedWidgets(dataModel);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates {@param si}'s intent to point to a new ComponentName.
|
||||
*
|
||||
* @return Whether the shortcut intent was changed.
|
||||
*/
|
||||
private boolean updateWorkspaceItemIntent(Context context,
|
||||
WorkspaceItemInfo si, String packageName) {
|
||||
if (si.itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) {
|
||||
// Do not update intent for deep shortcuts as they contain additional information
|
||||
// Do not update intent for deep shortcuts as they contain additional
|
||||
// information
|
||||
// about the shortcut.
|
||||
return false;
|
||||
}
|
||||
// Try to find the best match activity.
|
||||
Intent intent = new PackageManagerHelper(context).getAppLaunchIntent(packageName, mUser);
|
||||
Intent intent = PackageManagerHelper.INSTANCE.get(context)
|
||||
.getAppLaunchIntent(packageName, mUser);
|
||||
if (intent != null) {
|
||||
si.intent = intent;
|
||||
si.status = WorkspaceItemInfo.DEFAULT;
|
||||
@@ -415,4 +484,18 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private String getOpString() {
|
||||
return switch (mOp) {
|
||||
case OP_NONE -> "NONE";
|
||||
case OP_ADD -> "ADD";
|
||||
case OP_UPDATE -> "UPDATE";
|
||||
case OP_REMOVE -> "REMOVE";
|
||||
case OP_UNAVAILABLE -> "UNAVAILABLE";
|
||||
case OP_SUSPEND -> "SUSPEND";
|
||||
case OP_UNSUSPEND -> "UNSUSPEND";
|
||||
case OP_USER_AVAILABILITY_CHANGE -> "USER_AVAILABILITY_CHANGE";
|
||||
default -> "UNKNOWN";
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user