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

Commit e36a63b1 authored by Keisuke Kuroyanagi's avatar Keisuke Kuroyanagi Committed by android-build-merger
Browse files

Merge "Allow switching keyboard layout to null." into nyc-dev am: da067dcb

am: 01aecff5

* commit '01aecff5':
  Allow switching keyboard layout to null.

Change-Id: I77248d9e954f182c49238cfc61a1255d0a4cede9
parents a53168c2 01aecff5
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer;
import org.xmlpull.v1.XmlSerializer;


import android.annotation.Nullable;
import android.view.Surface;
import android.view.Surface;
import android.hardware.input.TouchCalibration;
import android.hardware.input.TouchCalibration;
import android.text.TextUtils;
import android.text.TextUtils;
@@ -342,6 +343,7 @@ final class PersistentDataStore {
                "x_ymix", "x_offset", "y_xmix", "y_scale", "y_offset" };
                "x_ymix", "x_offset", "y_xmix", "y_scale", "y_offset" };


        private TouchCalibration[] mTouchCalibration = new TouchCalibration[4];
        private TouchCalibration[] mTouchCalibration = new TouchCalibration[4];
        @Nullable
        private String mCurrentKeyboardLayout;
        private String mCurrentKeyboardLayout;
        private List<String> mUnassociatedKeyboardLayouts = new ArrayList<>();
        private List<String> mUnassociatedKeyboardLayouts = new ArrayList<>();
        private ArrayMap<InputMethodSubtypeHandle, String> mKeyboardLayouts = new ArrayMap<>();
        private ArrayMap<InputMethodSubtypeHandle, String> mKeyboardLayouts = new ArrayMap<>();
@@ -368,6 +370,7 @@ final class PersistentDataStore {
            }
            }
        }
        }


        @Nullable
        public String getCurrentKeyboardLayout() {
        public String getCurrentKeyboardLayout() {
            return mCurrentKeyboardLayout;
            return mCurrentKeyboardLayout;
        }
        }
@@ -443,7 +446,7 @@ final class PersistentDataStore {


        public boolean switchKeyboardLayout(InputMethodSubtypeHandle imeHandle) {
        public boolean switchKeyboardLayout(InputMethodSubtypeHandle imeHandle) {
            final String layout = mKeyboardLayouts.get(imeHandle);
            final String layout = mKeyboardLayouts.get(imeHandle);
            if (layout != null && !TextUtils.equals(mCurrentKeyboardLayout, layout)) {
            if (!TextUtils.equals(mCurrentKeyboardLayout, layout)) {
                mCurrentKeyboardLayout = layout;
                mCurrentKeyboardLayout = layout;
                return true;
                return true;
            }
            }