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

Commit 509ea6b2 authored by Chong Zhang's avatar Chong Zhang
Browse files

Only send touch event in NonClientDecorView to caption bar

bug: 24537314
Change-Id: I3735398b2c9425b11c44f37669ba7267f9cc32bf
parent f05de8f3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ import com.android.internal.policy.PhoneWindow;
 * </ul>
 * This will be mitigated once b/22527834 will be addressed.
 */
public class NonClientDecorView extends LinearLayout implements View.OnClickListener {
public class NonClientDecorView extends LinearLayout
        implements View.OnClickListener, View.OnTouchListener {
    private final static String TAG = "NonClientDecorView";
    // The height of a window which has focus in DIP.
    private final int DECOR_SHADOW_FOCUSED_HEIGHT_IN_DIP = 20;
@@ -112,7 +113,7 @@ public class NonClientDecorView extends LinearLayout implements View.OnClickList
    }

    @Override
    public boolean onTouchEvent(MotionEvent e) {
    public boolean onTouch(View v, MotionEvent e) {
        // Note: There are no mixed events. When a new device gets used (e.g. 1. Mouse, 2. touch)
        // the old input device events get cancelled first. So no need to remember the kind of
        // input device we are listening to.
@@ -224,6 +225,7 @@ public class NonClientDecorView extends LinearLayout implements View.OnClickList
        boolean invisible = isFillingScreen() || !mShowDecor;
        View caption = getChildAt(0);
        caption.setVisibility(invisible ? GONE : VISIBLE);
        caption.setOnTouchListener(this);
        mVisible = !invisible;
    }