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

Commit 9bcdd155 authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "SoftInputWindow: Remove clamping logic" into main

parents bc1622b1 6f8725ac
Loading
Loading
Loading
Loading
+0 −20
Original line number Diff line number Diff line
@@ -16,14 +16,12 @@

package android.inputmethodservice;

import static android.inputmethodservice.SoftInputWindowProto.BOUNDS;
import static android.inputmethodservice.SoftInputWindowProto.WINDOW_STATE;

import static java.lang.annotation.RetentionPolicy.SOURCE;

import android.annotation.IntDef;
import android.app.Dialog;
import android.graphics.Rect;
import android.os.Debug;
import android.os.IBinder;
import android.util.Log;
@@ -45,7 +43,6 @@ final class SoftInputWindow extends Dialog {
    private static final String TAG = "SoftInputWindow";

    private final KeyEvent.DispatcherState mDispatcherState;
    private final Rect mBounds = new Rect();
    private final InputMethodService mService;

    @Retention(SOURCE)
@@ -149,22 +146,6 @@ final class SoftInputWindow extends Dialog {
        mDispatcherState.reset();
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        getWindow().getDecorView().getHitRect(mBounds);

        if (ev.isWithinBoundsNoHistory(mBounds.left, mBounds.top,
                mBounds.right - 1, mBounds.bottom - 1)) {
            return super.dispatchTouchEvent(ev);
        } else {
            MotionEvent temp = ev.clampNoHistory(mBounds.left, mBounds.top,
                    mBounds.right - 1, mBounds.bottom - 1);
            boolean handled = super.dispatchTouchEvent(temp);
            temp.recycle();
            return handled;
        }
    }

    @Override
    public void show() {
        switch (mWindowState) {
@@ -273,7 +254,6 @@ final class SoftInputWindow extends Dialog {

    void dumpDebug(ProtoOutputStream proto, long fieldId) {
        final long token = proto.start(fieldId);
        mBounds.dumpDebug(proto, BOUNDS);
        proto.write(WINDOW_STATE, mWindowState);
        proto.end(token);
    }
+1 −1
Original line number Diff line number Diff line
@@ -27,6 +27,6 @@ message SoftInputWindowProto {
    reserved 2;  // window_type
    reserved 3;  // gravity
    reserved 4;  // takes_focus
    optional .android.graphics.RectProto bounds = 5;
    reserved 5;  // bounds
    optional int32 window_state = 6;
}
 No newline at end of file