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

Commit b80293cd authored by Vaibhav Devmurari's avatar Vaibhav Devmurari
Browse files

[1/n] Include input feature flags in KeyInterceptionInfo

For "keyboard capture" feature, we plan to use input feature
flags and this is just passing that flag details in
KeyInterceptionInfo object.

DD: go/key_capture
Bug: 416681006
Flag: com.android.hardware.input.request_key_capture_api
Test: Presubmits
Change-Id: I802dde5da5433f3c0a256f0f11909e454fe849f5
parent b405bdfa
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -24,13 +24,15 @@ public class KeyInterceptionInfo {
    // Window layout params attributes.
    public final int layoutParamsType;
    public final int layoutParamsPrivateFlags;
    public final int layoutParamsInputFeatures;
    // Debug friendly name to help identify the window
    public final String windowTitle;
    public final int windowOwnerUid;

    public KeyInterceptionInfo(int type, int flags, String title, int uid) {
    public KeyInterceptionInfo(int type, int flags, int inputFeatures, String title, int uid) {
        layoutParamsType = type;
        layoutParamsPrivateFlags = flags;
        layoutParamsInputFeatures = inputFeatures;
        windowTitle = title;
        windowOwnerUid = uid;
    }
+1 −1
Original line number Diff line number Diff line
@@ -5540,7 +5540,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
                || mKeyInterceptionInfo.windowTitle != getWindowTag()
                || mKeyInterceptionInfo.windowOwnerUid != getOwningUid()) {
            mKeyInterceptionInfo = new KeyInterceptionInfo(mAttrs.type, mAttrs.privateFlags,
                    getWindowTag().toString(), getOwningUid());
                    mAttrs.inputFeatures, getWindowTag().toString(), getOwningUid());
        }
        return mKeyInterceptionInfo;
    }
+1 −1
Original line number Diff line number Diff line
@@ -392,7 +392,7 @@ class TestPhoneWindowManager {
        doNothing().when(mContext).startActivityAsUser(any(), any());
        doNothing().when(mContext).startActivityAsUser(any(), any(), any());

        KeyInterceptionInfo interceptionInfo = new KeyInterceptionInfo(0, 0, null, 0);
        KeyInterceptionInfo interceptionInfo = new KeyInterceptionInfo(0, 0, 0, null, 0);
        doReturn(interceptionInfo)
                .when(mWindowManagerInternal).getKeyInterceptionInfoFromToken(any());

+1 −0
Original line number Diff line number Diff line
@@ -720,6 +720,7 @@ class InputManagerServiceTests {
            } else {
                0
            },
            /* inputFeatures = */0,
            "title",
            /* uid = */0
        )