Merge "Fix NPE by making Toast on UI thread" into udc-dev am: 8b0a18473b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21803381

Change-Id: I6f3434d1f8fa54113aeb73af4d58459335299215
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Louis Chang
2023-03-07 09:34:35 +00:00
committed by Automerger Merge Worker

View File

@@ -1729,14 +1729,11 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
}
if (ActivitySecurityModelFeatureFlags.shouldShowToast(callingUid)) {
Toast toast = Toast.makeText(mService.mContext,
UiThread.getHandler().post(() -> Toast.makeText(mService.mContext,
(ActivitySecurityModelFeatureFlags.DOC_LINK
+ (restrictActivitySwitch
? "returned home due to "
: "would return home due to ")
+ callingLabel),
Toast.LENGTH_LONG);
UiThread.getHandler().post(toast::show);
+ (restrictActivitySwitch ? " returned home due to "
: " would return home due to ")
+ callingLabel), Toast.LENGTH_LONG).show());
}
// If the activity switch should be restricted, return home rather than the