Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39eab599 authored by Taran Singh's avatar Taran Singh Committed by Automerger Merge Worker
Browse files

Merge "Don't allow pinned window to be IME target" into rvc-dev am: 218e017d am: 11f5d41c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11875421

Change-Id: I51fdf322bf66aea859bf8b5364cec77bdaa1d176
parents c1754c03 11f5d41c
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -2339,6 +2339,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
            return false;
            return false;
        }
        }


        if (inPinnedWindowingMode()) {
            return false;
        }

        final boolean windowsAreFocusable = mActivityRecord == null || mActivityRecord.windowsAreFocusable();
        final boolean windowsAreFocusable = mActivityRecord == null || mActivityRecord.windowsAreFocusable();
        if (!windowsAreFocusable) {
        if (!windowsAreFocusable) {
            // This window can't be an IME target if the app's windows should not be focusable.
            // This window can't be an IME target if the app's windows should not be focusable.
+7 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.server.wm;


import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.hardware.camera2.params.OutputConfiguration.ROTATION_90;
import static android.hardware.camera2.params.OutputConfiguration.ROTATION_90;
import static android.view.InsetsState.ITYPE_STATUS_BAR;
import static android.view.InsetsState.ITYPE_STATUS_BAR;
@@ -244,6 +245,12 @@ public class WindowStateTests extends WindowTestsBase {
        appWindow.mAttrs.flags &= ~FLAG_NOT_FOCUSABLE;
        appWindow.mAttrs.flags &= ~FLAG_NOT_FOCUSABLE;
        assertTrue(appWindow.canBeImeTarget());
        assertTrue(appWindow.canBeImeTarget());


        // Verify PINNED windows can't be IME target.
        int initialMode = appWindow.mActivityRecord.getWindowingMode();
        appWindow.mActivityRecord.setWindowingMode(WINDOWING_MODE_PINNED);
        assertFalse(appWindow.canBeImeTarget());
        appWindow.mActivityRecord.setWindowingMode(initialMode);

        // Make windows invisible
        // Make windows invisible
        appWindow.hideLw(false /* doAnimation */);
        appWindow.hideLw(false /* doAnimation */);
        imeWindow.hideLw(false /* doAnimation */);
        imeWindow.hideLw(false /* doAnimation */);