diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-05-24 01:24:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-05-24 01:24:08 +0000 |
commit | d3dcb497bd9c78570718a0e65eeba9de96debcd3 (patch) | |
tree | d40e2002cbaff0ca5f2c02ab9c40881992904b3b | |
parent | f54839bf35fe082802f90026ccba35d88940fe38 (diff) | |
parent | 9fd2d0ee0a604bb14ba4cff132fd277e36c3fbef (diff) | |
download | android_packages_apps_Trebuchet-d3dcb497bd9c78570718a0e65eeba9de96debcd3.tar.gz android_packages_apps_Trebuchet-d3dcb497bd9c78570718a0e65eeba9de96debcd3.tar.bz2 android_packages_apps_Trebuchet-d3dcb497bd9c78570718a0e65eeba9de96debcd3.zip |
Merge "Fix crash when launching some apps which require icons to be loaded on the model thread" into ub-launcher3-qt-dev
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragView.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/views/FloatingIconView.java | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index 9d46cf2ab..d1bd2db13 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -44,6 +44,7 @@ import android.view.View; import com.android.launcher3.FastBitmapDrawable; import com.android.launcher3.ItemInfo; import com.android.launcher3.Launcher; +import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherSettings; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager; @@ -54,7 +55,6 @@ import com.android.launcher3.anim.Interpolators; import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.util.Themes; import com.android.launcher3.util.Thunk; -import com.android.launcher3.util.UiThreadHelper; import java.util.Arrays; @@ -210,7 +210,7 @@ public class DragView extends View implements LauncherStateManager.StateListener return; } // Load the adaptive icon on a background thread and add the view in ui thread. - new Handler(UiThreadHelper.getBackgroundLooper()).postAtFrontOfQueue(new Runnable() { + new Handler(LauncherModel.getWorkerLooper()).postAtFrontOfQueue(new Runnable() { @Override public void run() { Object[] outObj = new Object[1]; diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index f63bcddf0..f4a382255 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -40,7 +40,6 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.os.CancellationSignal; import android.os.Handler; -import android.os.Looper; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; @@ -63,7 +62,6 @@ import com.android.launcher3.graphics.ShiftedBitmapDrawable; import com.android.launcher3.icons.LauncherIcons; import com.android.launcher3.popup.SystemShortcut; import com.android.launcher3.shortcuts.DeepShortcutView; -import com.android.launcher3.util.UiThreadHelper; import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; @@ -642,7 +640,7 @@ public class FloatingIconView extends View implements originalView.setVisibility(INVISIBLE); }; CancellationSignal loadIconSignal = view.mLoadIconSignal; - new Handler(UiThreadHelper.getBackgroundLooper()).postAtFrontOfQueue(() -> { + new Handler(LauncherModel.getWorkerLooper()).postAtFrontOfQueue(() -> { view.getIcon(originalView, (ItemInfo) originalView.getTag(), isOpening, onIconLoaded, loadIconSignal); }); |