RESTRICT AUTOMERGE Revert "Let the system dialog honor FLAG_ALT_FOCUSABLE_IM"

This reverts commit 9f55f3d8b1.

Reason for revert: Broke z-order of notifications b/265969292

Merged-In: Ic9fd3d502bf876098dc92fb4aa06805ed68b84c2
Change-Id: Ic9fd3d502bf876098dc92fb4aa06805ed68b84c2
This commit is contained in:
Daichi Hirono
2023-02-08 06:52:19 +00:00
committed by Adrian Roos
parent 9f55f3d8b1
commit 96d77cba14
4 changed files with 0 additions and 49 deletions

View File

@@ -357,7 +357,6 @@ final class SaveUi {
params.width = WindowManager.LayoutParams.MATCH_PARENT;
params.accessibilityTitle = context.getString(R.string.autofill_save_accessibility_title);
params.windowAnimations = R.style.AutofillSaveAnimation;
params.setTrustedOverlay();
show();
}

View File

@@ -5668,14 +5668,6 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
&& imeTarget.compareTo(this) <= 0;
return inTokenWithAndAboveImeTarget;
}
// The condition is for the system dialog not belonging to any Activity.
// (^FLAG_NOT_FOCUSABLE & FLAG_ALT_FOCUSABLE_IM) means the dialog is still focusable but
// should be placed above the IME window.
if ((mAttrs.flags & (FLAG_NOT_FOCUSABLE | FLAG_ALT_FOCUSABLE_IM))
== FLAG_ALT_FOCUSABLE_IM && isTrustedOverlay() && canAddInternalSystemWindow()) {
return true;
}
return false;
}

View File

@@ -42,7 +42,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_TOAST;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doNothing;
@@ -935,19 +934,6 @@ public class WindowStateTests extends WindowTestsBase {
assertFalse(sameTokenWindow.needsRelativeLayeringToIme());
}
@UseTestDisplay(addWindows = {W_ACTIVITY, W_INPUT_METHOD})
@Test
public void testNeedsRelativeLayeringToIme_systemDialog() {
WindowState systemDialogWindow = createWindow(null, TYPE_SECURE_SYSTEM_OVERLAY,
mDisplayContent,
"SystemDialog", true);
mDisplayContent.setImeLayeringTarget(mAppWindow);
mAppWindow.getRootTask().setWindowingMode(WINDOWING_MODE_MULTI_WINDOW);
makeWindowVisible(mImeWindow);
systemDialogWindow.mAttrs.flags |= FLAG_ALT_FOCUSABLE_IM;
assertTrue(systemDialogWindow.needsRelativeLayeringToIme());
}
@Test
public void testSetFreezeInsetsState() {
final WindowState app = createWindow(null, TYPE_APPLICATION, "app");

View File

@@ -22,7 +22,6 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.view.WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ABOVE_SUB_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
@@ -32,7 +31,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_SUB_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_SECURE_SYSTEM_OVERLAY;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_ADDITIONAL;
import static android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR_SUB_PANEL;
import static android.view.WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY;
@@ -545,28 +543,4 @@ public class ZOrderingTests extends WindowTestsBase {
assertZOrderGreaterThan(mTransaction, popupWindow.getSurfaceControl(),
mDisplayContent.getImeContainer().getSurfaceControl());
}
@Test
public void testSystemDialogWindow_expectHigherThanIme_inMultiWindow() {
// Simulate the app window is in multi windowing mode and being IME target
mAppWindow.getConfiguration().windowConfiguration.setWindowingMode(
WINDOWING_MODE_MULTI_WINDOW);
mDisplayContent.setImeLayeringTarget(mAppWindow);
mDisplayContent.setImeInputTarget(mAppWindow);
makeWindowVisible(mImeWindow);
// Create a popupWindow
final WindowState systemDialogWindow = createWindow(null, TYPE_SECURE_SYSTEM_OVERLAY,
mDisplayContent, "SystemDialog", true);
systemDialogWindow.mAttrs.flags |= FLAG_ALT_FOCUSABLE_IM;
spyOn(systemDialogWindow);
mDisplayContent.assignChildLayers(mTransaction);
// Verify the surface layer of the popupWindow should higher than IME
verify(systemDialogWindow).needsRelativeLayeringToIme();
assertThat(systemDialogWindow.needsRelativeLayeringToIme()).isTrue();
assertZOrderGreaterThan(mTransaction, systemDialogWindow.getSurfaceControl(),
mDisplayContent.getImeContainer().getSurfaceControl());
}
}