Merge "Make sure we start new activity only in UI thread." into tm-qpr-dev

This commit is contained in:
TreeHugger Robot
2023-02-21 21:13:26 +00:00
committed by Android (Google) Code Review

View File

@@ -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();