From 43577a660425af8efbbe369040aa49d8201f5b2d Mon Sep 17 00:00:00 2001 From: Becky Qiu Date: Fri, 17 Feb 2023 11:55:17 -0800 Subject: [PATCH] Make sure we start new activity only in UI thread. Bug: 269576728 Test: local Change-Id: I76ee93e54d6e645a62a427d0a779277532efae4a --- src/com/android/launcher3/views/ActivityContext.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java index f7837f50b0..b6f622359e 100644 --- a/src/com/android/launcher3/views/ActivityContext.java +++ b/src/com/android/launcher3/views/ActivityContext.java @@ -313,7 +313,7 @@ public interface ActivityContext { */ default boolean startActivitySafely( View v, Intent intent, @Nullable ItemInfo item) { - + Preconditions.assertUIThread(); Context context = (Context) this; if (isAppBlockedForSafeMode() && !PackageManagerHelper.isSystemApp(context, intent)) { Toast.makeText(context, R.string.safemode_shortcut_error, Toast.LENGTH_SHORT).show();