diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2019-05-23 18:13:19 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2019-05-23 18:13:43 -0700 |
commit | 9fd2d0ee0a604bb14ba4cff132fd277e36c3fbef (patch) | |
tree | 86c6340f422d9236a87b7b8cc5da6980bdb7962a | |
parent | 571e51161cb1e4ab7685aca5b370fba73c5727e6 (diff) | |
download | android_packages_apps_Trebuchet-9fd2d0ee0a604bb14ba4cff132fd277e36c3fbef.tar.gz android_packages_apps_Trebuchet-9fd2d0ee0a604bb14ba4cff132fd277e36c3fbef.tar.bz2 android_packages_apps_Trebuchet-9fd2d0ee0a604bb14ba4cff132fd277e36c3fbef.zip |
Fix crash when launching some apps which require icons to be loaded on
the model thread
Change-Id: I945a94c458d872b41e44b4b3a2d023f85d8a7c88
-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); }); |