Search in sources :

Example 1 with ShortcutsChangedTask

use of com.android.launcher3.model.ShortcutsChangedTask in project android_packages_apps_Launcher3 by crdroidandroid.

the class LauncherModel method onAppIconChanged.

/**
 * Called when the icon for an app changes, outside of package event
 */
@WorkerThread
public void onAppIconChanged(String packageName, UserHandle user) {
    // Update the icon for the calendar package
    Context context = mApp.getContext();
    onPackageChanged(packageName, user);
    List<ShortcutInfo> pinnedShortcuts = new ShortcutRequest(context, user).forPackage(packageName).query(ShortcutRequest.PINNED);
    if (!pinnedShortcuts.isEmpty()) {
        enqueueModelUpdateTask(new ShortcutsChangedTask(packageName, pinnedShortcuts, user, false));
    }
}
Also used : Context(android.content.Context) ShortcutInfo(android.content.pm.ShortcutInfo) ShortcutsChangedTask(com.android.launcher3.model.ShortcutsChangedTask) ShortcutRequest(com.android.launcher3.shortcuts.ShortcutRequest) WorkerThread(androidx.annotation.WorkerThread)

Aggregations

Context (android.content.Context)1 ShortcutInfo (android.content.pm.ShortcutInfo)1 WorkerThread (androidx.annotation.WorkerThread)1 ShortcutsChangedTask (com.android.launcher3.model.ShortcutsChangedTask)1 ShortcutRequest (com.android.launcher3.shortcuts.ShortcutRequest)1