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

Commit 46e75294 authored by Jeff Brown's avatar Jeff Brown
Browse files

Enable touch splitting for all windows by default.

New default only applies to applications with targetSdkVersion >=
HONEYCOMB.  Old applications default to no touch splitting for
their windows.

In addition, enabled split touch for various system windows.

Bug: 3049580
Change-Id: Idc8da9baa2cd8e1e4e76af8967d7b6a5ccb94427
parent 1a22bdb0
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -10371,6 +10371,17 @@
 visibility="public"
>
</field>
<field name="windowEnableSplitTouch"
 type="int"
 transient="false"
 volatile="false"
 value="16843560"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="windowEnterAnimation"
 type="int"
 transient="false"
@@ -246481,7 +246492,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="t" type="T">
<parameter name="arg0" type="T">
</parameter>
</method>
</interface>
+2 −1
Original line number Diff line number Diff line
@@ -298,7 +298,8 @@ public class MediaController extends FrameLayout {
            p.y = anchorpos[1] + mAnchor.getHeight() - p.height;
            p.format = PixelFormat.TRANSLUCENT;
            p.type = WindowManager.LayoutParams.TYPE_APPLICATION_PANEL;
            p.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM;
            p.flags |= WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM
                    | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
            p.token = null;
            p.windowAnimations = 0; // android.R.style.DropDownAnimationDown;
            mWindowManager.addView(mDecor, p);
+10 −6
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.StateListDrawable;
import android.os.Build;
import android.os.IBinder;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
@@ -87,7 +88,7 @@ public class PopupWindow {
    private boolean mTouchable = true;
    private boolean mOutsideTouchable = false;
    private boolean mClippingEnabled = true;
    private boolean mSplitTouchEnabled;
    private int mSplitTouchEnabled = -1;
    private boolean mLayoutInScreen;
    private boolean mClipToScreen;

@@ -602,14 +603,17 @@ public class PopupWindow {
     * @hide
     */
    public boolean isSplitTouchEnabled() {
        return mSplitTouchEnabled;
        if (mSplitTouchEnabled < 0 && mContext != null) {
            return mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.HONEYCOMB;
        }
        return mSplitTouchEnabled == 1;
    }

    /**
     * <p>Allows the popup window to split touches across other windows that also
     * support split touch.  When this flag is not set, the first pointer
     * support split touch.  When this flag is false, the first pointer
     * that goes down determines the window to which all subsequent touches
     * go until all pointers go up.  When this flag is set, each pointer
     * go until all pointers go up.  When this flag is true, each pointer
     * (not necessarily the first) that goes down determines the window
     * to which all subsequent touches of that pointer will go until that
     * pointer goes up thereby enabling touches with multiple pointers
@@ -620,7 +624,7 @@ public class PopupWindow {
     * @hide
     */
    public void setSplitTouchEnabled(boolean enabled) {
        mSplitTouchEnabled = enabled;
        mSplitTouchEnabled = enabled ? 1 : 0;
    }

    /**
@@ -993,7 +997,7 @@ public class PopupWindow {
        if (!mClippingEnabled) {
            curFlags |= WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS;
        }
        if (mSplitTouchEnabled) {
        if (isSplitTouchEnabled()) {
            curFlags |= WindowManager.LayoutParams.FLAG_SPLIT_TOUCH;
        }
        if (mLayoutInScreen) {
+13 −0
Original line number Diff line number Diff line
@@ -345,6 +345,18 @@
             because there will be no such interaction coming. -->
        <attr name="windowNoDisplay" format="boolean" />

        <!-- Flag indicating that this window should allow touches to be split
             across other windows that also support split touch.
             The default value is true for applications with a targetSdkVersion
             of Honeycomb or newer; false otherwise.
             When this flag is false, the first pointer that goes down determines
             the window to which all subsequent touches go until all pointers go up.
             When this flag is true, each pointer (not necessarily the first) that
             goes down determines the window to which all subsequent touches of that
             pointer will go until that pointers go up thereby enabling touches
             with multiple pointers to be split across multiple windows. -->
        <attr name="windowEnableSplitTouch" format="boolean" />

        <!-- ============ -->
        <!-- Alert Dialog styles -->
        <!-- ============ -->
@@ -1227,6 +1239,7 @@
        <attr name="windowActionBar" />
        <attr name="windowActionModeOverlay" />
        <attr name="windowActionBarOverlay" />
        <attr name="windowEnableSplitTouch" />
    </declare-styleable>

    <!-- The set of attributes that describe a AlertDialog's theme. -->
+2 −3
Original line number Diff line number Diff line
@@ -1365,12 +1365,13 @@
  <public type="attr" name="selectableItemBackground" />
  <public type="attr" name="autoAdvanceViewId" />
  <public type="attr" name="useIntrinsicSizeAsMinimum" />

  <public type="attr" name="actionModeCutDrawable" />
  <public type="attr" name="actionModeCopyDrawable" />
  <public type="attr" name="actionModePasteDrawable" />
  <public type="attr" name="textEditPasteWindowLayout" />
  <public type="attr" name="textEditNoPasteWindowLayout" />
  <public type="attr" name="textIsSelectable" />
  <public type="attr" name="windowEnableSplitTouch" />

  <public type="anim" name="animator_fade_in" />
  <public type="anim" name="animator_fade_out" />
@@ -1440,6 +1441,4 @@
  <public type="style" name="Theme.Holo.DialogWhenLarge" />
  
  <public type="string" name="selectTextMode" />

  <public type="attr" name="textIsSelectable" />
</resources>
Loading