Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,7 @@ package android { } public static final class R.attr { field public static final int isVrOnly = 16844152; // 0x1010578 field public static final int requiredSystemPropertyName = 16844133; // 0x1010565 field public static final int requiredSystemPropertyValue = 16844134; // 0x1010566 field public static final int searchKeyphrase = 16843871; // 0x101045f Loading core/java/android/view/inputmethod/InputMethodInfo.java +25 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,11 @@ public final class InputMethodInfo implements Parcelable { */ final ResolveInfo mService; /** * IME only supports VR mode. */ final boolean mIsVrOnly; /** * The unique string Id to identify the input method. This is generated * from the input method component. Loading Loading @@ -149,6 +154,7 @@ public final class InputMethodInfo implements Parcelable { PackageManager pm = context.getPackageManager(); String settingsActivityComponent = null; boolean isVrOnly; int isDefaultResId = 0; XmlResourceParser parser = null; Loading Loading @@ -179,6 +185,7 @@ public final class InputMethodInfo implements Parcelable { com.android.internal.R.styleable.InputMethod); settingsActivityComponent = sa.getString( com.android.internal.R.styleable.InputMethod_settingsActivity); isVrOnly = sa.getBoolean(com.android.internal.R.styleable.InputMethod_isVrOnly, false); isDefaultResId = sa.getResourceId( com.android.internal.R.styleable.InputMethod_isDefault, 0); supportsSwitchingToNextInputMethod = sa.getBoolean( Loading Loading @@ -254,6 +261,8 @@ public final class InputMethodInfo implements Parcelable { mIsDefaultResId = isDefaultResId; mIsAuxIme = isAuxIme; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; // TODO(b/68948291): remove this meta-data before release. mIsVrOnly = isVrOnly || service.serviceInfo.metaData.getBoolean("isVrOnly", false); } InputMethodInfo(Parcel source) { Loading @@ -262,6 +271,7 @@ public final class InputMethodInfo implements Parcelable { mIsDefaultResId = source.readInt(); mIsAuxIme = source.readInt() == 1; mSupportsSwitchingToNextInputMethod = source.readInt() == 1; mIsVrOnly = source.readBoolean(); mService = ResolveInfo.CREATOR.createFromParcel(source); mSubtypes = new InputMethodSubtypeArray(source); mForceDefault = false; Loading @@ -274,7 +284,8 @@ public final class InputMethodInfo implements Parcelable { CharSequence label, String settingsActivity) { this(buildDummyResolveInfo(packageName, className, label), false /* isAuxIme */, settingsActivity, null /* subtypes */, 0 /* isDefaultResId */, false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */); false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */, false /* isVrOnly */); } /** Loading @@ -285,7 +296,7 @@ public final class InputMethodInfo implements Parcelable { String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault) { this(ri, isAuxIme, settingsActivity, subtypes, isDefaultResId, forceDefault, true /* supportsSwitchingToNextInputMethod */); true /* supportsSwitchingToNextInputMethod */, false /* isVrOnly */); } /** Loading @@ -294,7 +305,7 @@ public final class InputMethodInfo implements Parcelable { */ public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault, boolean supportsSwitchingToNextInputMethod) { boolean supportsSwitchingToNextInputMethod, boolean isVrOnly) { final ServiceInfo si = ri.serviceInfo; mService = ri; mId = new ComponentName(si.packageName, si.name).flattenToShortString(); Loading @@ -304,6 +315,7 @@ public final class InputMethodInfo implements Parcelable { mSubtypes = new InputMethodSubtypeArray(subtypes); mForceDefault = forceDefault; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; mIsVrOnly = isVrOnly; } private static ResolveInfo buildDummyResolveInfo(String packageName, String className, Loading Loading @@ -397,6 +409,14 @@ public final class InputMethodInfo implements Parcelable { return mSettingsActivityName; } /** * Returns true if IME supports VR mode only. * @hide */ public boolean isVrOnly() { return mIsVrOnly; } /** * Return the count of the subtypes of Input Method. */ Loading Loading @@ -444,6 +464,7 @@ public final class InputMethodInfo implements Parcelable { public void dump(Printer pw, String prefix) { pw.println(prefix + "mId=" + mId + " mSettingsActivityName=" + mSettingsActivityName + " mIsVrOnly=" + mIsVrOnly + " mSupportsSwitchingToNextInputMethod=" + mSupportsSwitchingToNextInputMethod); pw.println(prefix + "mIsDefaultResId=0x" + Integer.toHexString(mIsDefaultResId)); Loading Loading @@ -509,6 +530,7 @@ public final class InputMethodInfo implements Parcelable { dest.writeInt(mIsDefaultResId); dest.writeInt(mIsAuxIme ? 1 : 0); dest.writeInt(mSupportsSwitchingToNextInputMethod ? 1 : 0); dest.writeBoolean(mIsVrOnly); mService.writeToParcel(dest, flags); mSubtypes.writeToParcel(dest); } Loading core/res/res/values/attrs.xml +3 −0 Original line number Diff line number Diff line Loading @@ -3294,6 +3294,9 @@ and subtype in order to provide the consistent user experience in switching between IMEs and subtypes. --> <attr name="supportsSwitchingToNextInputMethod" format="boolean" /> <!-- Specifies if an IME can only be used while a device is in VR mode or on a dedicated device --> <attr name="isVrOnly" format="boolean"/> <attr name="__removed2" format="boolean" /> </declare-styleable> Loading core/res/res/values/public.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2856,6 +2856,8 @@ <public name="buttonCornerRadius" /> <public name="versionCodeMajor" /> <public name="versionMajor" /> <!-- @hide @SystemApi --> <public name="isVrOnly"/> </public-group> <public-group type="style" first-id="0x010302e0"> Loading core/tests/coretests/res/xml/ime_meta_vr_only.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2017 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <input-method xmlns:android="http://schemas.android.com/apk/res/android" android:settingsActivity="com.android.inputmethod.latin.settings.SettingsActivity" android:isVrOnly="true"> </input-method> Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -184,6 +184,7 @@ package android { } public static final class R.attr { field public static final int isVrOnly = 16844152; // 0x1010578 field public static final int requiredSystemPropertyName = 16844133; // 0x1010565 field public static final int requiredSystemPropertyValue = 16844134; // 0x1010566 field public static final int searchKeyphrase = 16843871; // 0x101045f Loading
core/java/android/view/inputmethod/InputMethodInfo.java +25 −3 Original line number Diff line number Diff line Loading @@ -66,6 +66,11 @@ public final class InputMethodInfo implements Parcelable { */ final ResolveInfo mService; /** * IME only supports VR mode. */ final boolean mIsVrOnly; /** * The unique string Id to identify the input method. This is generated * from the input method component. Loading Loading @@ -149,6 +154,7 @@ public final class InputMethodInfo implements Parcelable { PackageManager pm = context.getPackageManager(); String settingsActivityComponent = null; boolean isVrOnly; int isDefaultResId = 0; XmlResourceParser parser = null; Loading Loading @@ -179,6 +185,7 @@ public final class InputMethodInfo implements Parcelable { com.android.internal.R.styleable.InputMethod); settingsActivityComponent = sa.getString( com.android.internal.R.styleable.InputMethod_settingsActivity); isVrOnly = sa.getBoolean(com.android.internal.R.styleable.InputMethod_isVrOnly, false); isDefaultResId = sa.getResourceId( com.android.internal.R.styleable.InputMethod_isDefault, 0); supportsSwitchingToNextInputMethod = sa.getBoolean( Loading Loading @@ -254,6 +261,8 @@ public final class InputMethodInfo implements Parcelable { mIsDefaultResId = isDefaultResId; mIsAuxIme = isAuxIme; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; // TODO(b/68948291): remove this meta-data before release. mIsVrOnly = isVrOnly || service.serviceInfo.metaData.getBoolean("isVrOnly", false); } InputMethodInfo(Parcel source) { Loading @@ -262,6 +271,7 @@ public final class InputMethodInfo implements Parcelable { mIsDefaultResId = source.readInt(); mIsAuxIme = source.readInt() == 1; mSupportsSwitchingToNextInputMethod = source.readInt() == 1; mIsVrOnly = source.readBoolean(); mService = ResolveInfo.CREATOR.createFromParcel(source); mSubtypes = new InputMethodSubtypeArray(source); mForceDefault = false; Loading @@ -274,7 +284,8 @@ public final class InputMethodInfo implements Parcelable { CharSequence label, String settingsActivity) { this(buildDummyResolveInfo(packageName, className, label), false /* isAuxIme */, settingsActivity, null /* subtypes */, 0 /* isDefaultResId */, false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */); false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */, false /* isVrOnly */); } /** Loading @@ -285,7 +296,7 @@ public final class InputMethodInfo implements Parcelable { String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault) { this(ri, isAuxIme, settingsActivity, subtypes, isDefaultResId, forceDefault, true /* supportsSwitchingToNextInputMethod */); true /* supportsSwitchingToNextInputMethod */, false /* isVrOnly */); } /** Loading @@ -294,7 +305,7 @@ public final class InputMethodInfo implements Parcelable { */ public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault, boolean supportsSwitchingToNextInputMethod) { boolean supportsSwitchingToNextInputMethod, boolean isVrOnly) { final ServiceInfo si = ri.serviceInfo; mService = ri; mId = new ComponentName(si.packageName, si.name).flattenToShortString(); Loading @@ -304,6 +315,7 @@ public final class InputMethodInfo implements Parcelable { mSubtypes = new InputMethodSubtypeArray(subtypes); mForceDefault = forceDefault; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; mIsVrOnly = isVrOnly; } private static ResolveInfo buildDummyResolveInfo(String packageName, String className, Loading Loading @@ -397,6 +409,14 @@ public final class InputMethodInfo implements Parcelable { return mSettingsActivityName; } /** * Returns true if IME supports VR mode only. * @hide */ public boolean isVrOnly() { return mIsVrOnly; } /** * Return the count of the subtypes of Input Method. */ Loading Loading @@ -444,6 +464,7 @@ public final class InputMethodInfo implements Parcelable { public void dump(Printer pw, String prefix) { pw.println(prefix + "mId=" + mId + " mSettingsActivityName=" + mSettingsActivityName + " mIsVrOnly=" + mIsVrOnly + " mSupportsSwitchingToNextInputMethod=" + mSupportsSwitchingToNextInputMethod); pw.println(prefix + "mIsDefaultResId=0x" + Integer.toHexString(mIsDefaultResId)); Loading Loading @@ -509,6 +530,7 @@ public final class InputMethodInfo implements Parcelable { dest.writeInt(mIsDefaultResId); dest.writeInt(mIsAuxIme ? 1 : 0); dest.writeInt(mSupportsSwitchingToNextInputMethod ? 1 : 0); dest.writeBoolean(mIsVrOnly); mService.writeToParcel(dest, flags); mSubtypes.writeToParcel(dest); } Loading
core/res/res/values/attrs.xml +3 −0 Original line number Diff line number Diff line Loading @@ -3294,6 +3294,9 @@ and subtype in order to provide the consistent user experience in switching between IMEs and subtypes. --> <attr name="supportsSwitchingToNextInputMethod" format="boolean" /> <!-- Specifies if an IME can only be used while a device is in VR mode or on a dedicated device --> <attr name="isVrOnly" format="boolean"/> <attr name="__removed2" format="boolean" /> </declare-styleable> Loading
core/res/res/values/public.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2856,6 +2856,8 @@ <public name="buttonCornerRadius" /> <public name="versionCodeMajor" /> <public name="versionMajor" /> <!-- @hide @SystemApi --> <public name="isVrOnly"/> </public-group> <public-group type="style" first-id="0x010302e0"> Loading
core/tests/coretests/res/xml/ime_meta_vr_only.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2017 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <input-method xmlns:android="http://schemas.android.com/apk/res/android" android:settingsActivity="com.android.inputmethod.latin.settings.SettingsActivity" android:isVrOnly="true"> </input-method>