From efabdcc7d637bc36c0d44a0502787060b69307cb Mon Sep 17 00:00:00 2001 From: menghanli Date: Thu, 14 May 2020 09:29:04 +0800 Subject: [PATCH] Avoid launching activity-based feature to force stop exist actiivty and recreate it. Root cause: FLAG_ACTIVITY_CLEAR_TASK would cause the exist activity are finished and new one items to be started. It causes Live Transcribe main activity goes onStart call of new activity is followed by onStop call of old activity, which cause the mic stopping. Solution: Remmove the FLAG_ACTIVITY_CLEAR_TASK. Bug: 156455425 Test: Manual test Change-Id: I86778577ff37d7f14b28e5eca3087fa9cf5cb2c1 --- .../LaunchAccessibilityActivityPreferenceFragment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/accessibility/LaunchAccessibilityActivityPreferenceFragment.java b/src/com/android/settings/accessibility/LaunchAccessibilityActivityPreferenceFragment.java index 6078cc1e5a8..23c0c57bbf1 100644 --- a/src/com/android/settings/accessibility/LaunchAccessibilityActivityPreferenceFragment.java +++ b/src/com/android/settings/accessibility/LaunchAccessibilityActivityPreferenceFragment.java @@ -148,7 +148,7 @@ public class LaunchAccessibilityActivityPreferenceFragment extends final Bundle bundle = ActivityOptions.makeBasic().setLaunchDisplayId(displayId).toBundle(); intent.setComponent(name); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { final int userId = UserHandle.myUserId(); getPrefContext().startActivityAsUser(intent, bundle, UserHandle.of(userId));