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

Commit a8b6dad8 authored by Adam Powell's avatar Adam Powell Committed by Android Git Automerger
Browse files

am 4af1de39: am fb6431c0: Merge "Fix bug 3064135 - do not allow text handles...

am 4af1de39: am fb6431c0: Merge "Fix bug 3064135 - do not allow text handles on TextViews in sub windows." into gingerbread

Merge commit '4af1de39'

* commit '4af1de39':
  Fix bug 3064135 - do not allow text handles on TextViews in sub windows.
parents d0c37cfe 4af1de39
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewDebug;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.ViewParent;
import android.view.ViewRoot;
@@ -6946,8 +6947,17 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
    }

    private void prepareCursorControllers() {
        boolean windowSupportsHandles = false;

        ViewGroup.LayoutParams params = getRootView().getLayoutParams();
        if (params instanceof WindowManager.LayoutParams) {
            WindowManager.LayoutParams windowParams = (WindowManager.LayoutParams) params;
            windowSupportsHandles = windowParams.type < WindowManager.LayoutParams.FIRST_SUB_WINDOW
                    || windowParams.type > WindowManager.LayoutParams.LAST_SUB_WINDOW;
        }

        // TODO Add an extra android:cursorController flag to disable the controller?
        if (mCursorVisible && mLayout != null) {
        if (windowSupportsHandles && mCursorVisible && mLayout != null) {
            if (mInsertionPointCursorController == null) {
                mInsertionPointCursorController = new InsertionPointCursorController();
            }
@@ -6955,7 +6965,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            mInsertionPointCursorController = null;
        }

        if (textCanBeSelected() && mLayout != null) {
        if (windowSupportsHandles && textCanBeSelected() && mLayout != null) {
            if (mSelectionModifierCursorController == null) {
                mSelectionModifierCursorController = new SelectionModifierCursorController();
            }