Avoid activity embedding if the activity is already embedded

Test: manual + robotests com.android.settings.search and com.android.settings.SettingsActivityTest
Bug: 271260497

Change-Id: Ia21ca7a75cacee64d1942e2fe1b439ac4a3cb134
This commit is contained in:
Alexander Milantev
2023-03-14 16:33:17 +00:00
parent dc875cb639
commit 92195471b0
2 changed files with 12 additions and 1 deletions

View File

@@ -102,7 +102,8 @@ public class SearchResultTrampoline extends Activity {
intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
if (!ActivityEmbeddingUtils.isEmbeddingActivityEnabled(this)) {
if (!ActivityEmbeddingUtils.isEmbeddingActivityEnabled(this)
|| ActivityEmbeddingUtils.isAlreadyEmbedded(this)) {
startActivity(intent);
} else if (isSettingsIntelligence(callingActivity)) {
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.SETTINGS_SEARCH_ALWAYS_EXPAND)) {