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

Commit 4cb97349 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Set the IME to secure if the target is secure" into sc-dev am: 96f0dd18

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

Change-Id: I76aa60b38b6cdaf08583e1d162d82cb9fe3d8786
parents efc04722 96f0dd18
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3750,6 +3750,10 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
    @VisibleForTesting
    void setImeInputTarget(WindowState target) {
        mImeInputTarget = target;
        boolean canScreenshot = mImeInputTarget == null || !mImeInputTarget.isSecureLocked();
        if (mImeWindowsContainer.setCanScreenshot(canScreenshot)) {
            mWmService.requestTraversal();
        }
    }

    @VisibleForTesting
@@ -3867,7 +3871,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
    void updateImeInputAndControlTarget(WindowState target) {
        if (mImeInputTarget != target) {
            ProtoLog.i(WM_DEBUG_IME, "setInputMethodInputTarget %s", target);
            mImeInputTarget = target;
            setImeInputTarget(target);
            updateImeControlTarget();
        }
    }
+8 −0
Original line number Diff line number Diff line
@@ -3321,4 +3321,12 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
    @WindowManager.LayoutParams.WindowType int getWindowType() {
        return INVALID_WINDOW_TYPE;
    }

    boolean setCanScreenshot(boolean canScreenshot) {
        if (mSurfaceControl == null) {
            return false;
        }
        getPendingTransaction().setSecure(mSurfaceControl, !canScreenshot);
        return true;
    }
}