mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Moving package installer initialization to worker thread
Bug: 169002215 Change-Id: Ie7b9a1eb27b634455e3d43da411037642efd0534
This commit is contained in:
@@ -25,8 +25,11 @@ import android.content.pm.PackageManager;
|
||||
import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.WorkerThread;
|
||||
|
||||
import com.android.launcher3.model.ItemInstallQueue;
|
||||
import com.android.launcher3.pm.InstallSessionHelper;
|
||||
import com.android.launcher3.util.Executors;
|
||||
|
||||
/**
|
||||
* BroadcastReceiver to handle session commit intent.
|
||||
@@ -38,6 +41,11 @@ public class SessionCommitReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
Executors.MODEL_EXECUTOR.execute(() -> processIntent(context, intent));
|
||||
}
|
||||
|
||||
@WorkerThread
|
||||
private static void processIntent(Context context, Intent intent) {
|
||||
if (!isEnabled(context)) {
|
||||
// User has decided to not add icons on homescreen.
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user