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

Commit e146d824 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 4965 into donut

* changes:
  Fix bugs 1827027, 1808979, 1820700.
parents 72be4049 a465a170
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -297,6 +297,10 @@ public class BaseInputConnection implements InputConnection {
            b = tmp;
        }

        if (a <= 0) {
            return "";
        }
        
        if (length > a) {
            length = a;
        }
@@ -488,14 +492,14 @@ public class BaseInputConnection implements InputConnection {
        } else {
            a = Selection.getSelectionStart(content);
            b = Selection.getSelectionEnd(content);
            if (a >=0 && b>= 0 && a != b) {
            if (a < 0) a = 0;
            if (b < 0) b = 0;
            if (b < a) {
                int tmp = a;
                a = b;
                b = tmp;
            }
        }
        }

        if (composing) {
            Spannable sp = null;
+7 −0
Original line number Diff line number Diff line
@@ -6469,6 +6469,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        
        protected void onReceiveResult(int resultCode, Bundle resultData) {
            if (resultCode != InputMethodManager.RESULT_SHOWN) {
                final int len = mText.length();
                if (mNewStart > len) {
                    mNewStart = len;
                }
                if (mNewEnd > len) {
                    mNewEnd = len;
                }
                Selection.setSelection((Spannable)mText, mNewStart, mNewEnd);
            }
        }