Merge "Avoid activity embedding if the activity is already embedded" into udc-dev am: b8beeb1cda
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22071824 Change-Id: If302fb70957b0f7e67799c1368a318b19d0df8dd Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
e0f5d68f1f
@@ -23,6 +23,7 @@ import android.util.FeatureFlagUtils;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
|
||||
import androidx.window.embedding.ActivityEmbeddingController;
|
||||
import androidx.window.embedding.SplitController;
|
||||
|
||||
import com.android.settings.R;
|
||||
@@ -81,4 +82,13 @@ public class ActivityEmbeddingUtils {
|
||||
return dm.widthPixels >= (int) TypedValue.applyDimension(
|
||||
TypedValue.COMPLEX_UNIT_DIP, MIN_REGULAR_HOMEPAGE_LAYOUT_WIDTH_DP, dm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if activity is already embedded
|
||||
*/
|
||||
public static boolean isAlreadyEmbedded(Activity activity) {
|
||||
return ActivityEmbeddingController
|
||||
.getInstance(activity)
|
||||
.isActivityEmbedded(activity);
|
||||
}
|
||||
}
|
||||
|
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user