Remove normalize_home_intent flag
Bug: 378505461
Test: wm presubmit
Flag: EXEMPT remove flag
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f207b00bc1eff76bc788f5a2578e3e3f2c960f6b)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3f9327ec06278c80fc59171dc4aa2c063d10ee7a)
Merged-In: I071d4d9e451f1aaab5c625444232b2285bbd472a
Change-Id: I071d4d9e451f1aaab5c625444232b2285bbd472a
diff --git a/core/java/android/window/flags/windowing_sdk.aconfig b/core/java/android/window/flags/windowing_sdk.aconfig
index ae84644..5a092b8 100644
--- a/core/java/android/window/flags/windowing_sdk.aconfig
+++ b/core/java/android/window/flags/windowing_sdk.aconfig
@@ -138,13 +138,3 @@
purpose: PURPOSE_BUGFIX
}
}
-
-flag {
- namespace: "windowing_sdk"
- name: "normalize_home_intent"
- description: "To ensure home is started in correct intent"
- bug: "378505461"
- metadata {
- purpose: PURPOSE_BUGFIX
- }
-}
diff --git a/services/core/java/com/android/server/wm/ActivityStartInterceptor.java b/services/core/java/com/android/server/wm/ActivityStartInterceptor.java
index 6709e3a..7b6ebbf 100644
--- a/services/core/java/com/android/server/wm/ActivityStartInterceptor.java
+++ b/services/core/java/com/android/server/wm/ActivityStartInterceptor.java
@@ -71,7 +71,6 @@
import com.android.server.LocalServices;
import com.android.server.am.ActivityManagerService;
import com.android.server.wm.ActivityInterceptorCallback.ActivityInterceptResult;
-import com.android.window.flags.Flags;
/**
* A class that contains activity intercepting logic for {@link ActivityStarter#execute()}
@@ -502,33 +501,27 @@
}
boolean intercepted = false;
- if (Flags.normalizeHomeIntent()) {
- if (!ACTION_MAIN.equals(mIntent.getAction()) || (!mIntent.hasCategory(CATEGORY_HOME)
- && !mIntent.hasCategory(CATEGORY_SECONDARY_HOME))) {
- // not a home intent
+ if (!ACTION_MAIN.equals(mIntent.getAction()) || (!mIntent.hasCategory(CATEGORY_HOME)
+ && !mIntent.hasCategory(CATEGORY_SECONDARY_HOME))) {
+ // not a home intent
+ return false;
+ }
+
+ if (mComponentSpecified) {
+ final ComponentName homeComponent = mIntent.getComponent();
+ final Intent homeIntent = mService.getHomeIntent();
+ final ActivityInfo aInfo = mService.mRootWindowContainer.resolveHomeActivity(
+ mUserId, homeIntent);
+ if (!aInfo.getComponentName().equals(homeComponent)) {
+ // Do nothing if the intent is not for the default home component.
return false;
}
+ }
- if (mComponentSpecified) {
- final ComponentName homeComponent = mIntent.getComponent();
- final Intent homeIntent = mService.getHomeIntent();
- final ActivityInfo aInfo = mService.mRootWindowContainer.resolveHomeActivity(
- mUserId, homeIntent);
- if (!aInfo.getComponentName().equals(homeComponent)) {
- // Do nothing if the intent is not for the default home component.
- return false;
- }
- }
-
- if (!ActivityRecord.isHomeIntent(mIntent) || mComponentSpecified) {
- // This is not a standard home intent, make it so if possible.
- normalizeHomeIntent();
- intercepted = true;
- }
- } else {
- if (!ActivityRecord.isHomeIntent(mIntent)) {
- return false;
- }
+ if (!ActivityRecord.isHomeIntent(mIntent) || mComponentSpecified) {
+ // This is not a standard home intent, make it so if possible.
+ normalizeHomeIntent();
+ intercepted = true;
}
intercepted |= replaceToSecondaryHomeIntentIfNeeded();
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStartInterceptorTest.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStartInterceptorTest.java
index bacf5ed..6c4f638 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStartInterceptorTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStartInterceptorTest.java
@@ -53,7 +53,6 @@
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
-import android.platform.test.annotations.EnableFlags;
import android.platform.test.annotations.Presubmit;
import android.platform.test.flag.junit.SetFlagsRule;
import android.testing.DexmakerShareClassLoaderRule;
@@ -68,7 +67,6 @@
import com.android.internal.app.UnlaunchableAppActivity;
import com.android.server.LocalServices;
import com.android.server.am.ActivityManagerService;
-import com.android.window.flags.Flags;
import org.junit.After;
import org.junit.Before;
@@ -242,7 +240,6 @@
}
@Test
- @EnableFlags(Flags.FLAG_NORMALIZE_HOME_INTENT)
public void testInterceptIncorrectHomeIntent() {
// Create a non-standard home intent
final Intent homeIntent = new Intent(Intent.ACTION_MAIN);