Loading core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -1453,6 +1453,7 @@ package android { field public static final int supportsAssist = 16844016; // 0x10104f0 field public static final int supportsBatteryGameMode; field public static final int supportsInlineSuggestions = 16844301; // 0x101060d field public static final int supportsInlineSuggestionsWithTouchExploration; field public static final int supportsLaunchVoiceAssistFromKeyguard = 16844017; // 0x10104f1 field public static final int supportsLocalInteraction = 16844047; // 0x101050f field public static final int supportsMultipleDisplays = 16844182; // 0x1010596 core/java/android/view/inputmethod/InputMethodInfo.java +37 −5 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import java.util.List; * @attr ref android.R.styleable#InputMethod_isDefault * @attr ref android.R.styleable#InputMethod_supportsSwitchingToNextInputMethod * @attr ref android.R.styleable#InputMethod_supportsInlineSuggestions * @attr ref android.R.styleable#InputMethod_supportsInlineSuggestionsWithTouchExploration * @attr ref android.R.styleable#InputMethod_suppressesSpellChecker * @attr ref android.R.styleable#InputMethod_showInInputMethodPicker * @attr ref android.R.styleable#InputMethod_configChanges Loading Loading @@ -124,6 +125,11 @@ public final class InputMethodInfo implements Parcelable { */ private final boolean mInlineSuggestionsEnabled; /** * The flag whether this IME supports inline suggestions when touch exploration is enabled. */ private final boolean mSupportsInlineSuggestionsWithTouchExploration; /** * The flag whether this IME suppresses spell checker. */ Loading Loading @@ -189,6 +195,7 @@ public final class InputMethodInfo implements Parcelable { boolean isAuxIme = true; boolean supportsSwitchingToNextInputMethod = false; // false as default boolean inlineSuggestionsEnabled = false; // false as default boolean supportsInlineSuggestionsWithTouchExploration = false; // false as default boolean suppressesSpellChecker = false; // false as default boolean showInInputMethodPicker = true; // true as default mForceDefault = false; Loading Loading @@ -234,6 +241,9 @@ public final class InputMethodInfo implements Parcelable { false); inlineSuggestionsEnabled = sa.getBoolean( com.android.internal.R.styleable.InputMethod_supportsInlineSuggestions, false); supportsInlineSuggestionsWithTouchExploration = sa.getBoolean( com.android.internal.R.styleable .InputMethod_supportsInlineSuggestionsWithTouchExploration, false); suppressesSpellChecker = sa.getBoolean( com.android.internal.R.styleable.InputMethod_suppressesSpellChecker, false); showInInputMethodPicker = sa.getBoolean( Loading Loading @@ -314,6 +324,8 @@ public final class InputMethodInfo implements Parcelable { mIsAuxIme = isAuxIme; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; mInlineSuggestionsEnabled = inlineSuggestionsEnabled; mSupportsInlineSuggestionsWithTouchExploration = supportsInlineSuggestionsWithTouchExploration; mSuppressesSpellChecker = suppressesSpellChecker; mShowInInputMethodPicker = showInInputMethodPicker; mIsVrOnly = isVrOnly; Loading @@ -326,6 +338,7 @@ public final class InputMethodInfo implements Parcelable { mIsAuxIme = source.readInt() == 1; mSupportsSwitchingToNextInputMethod = source.readInt() == 1; mInlineSuggestionsEnabled = source.readInt() == 1; mSupportsInlineSuggestionsWithTouchExploration = source.readInt() == 1; mSuppressesSpellChecker = source.readBoolean(); mShowInInputMethodPicker = source.readBoolean(); mIsVrOnly = source.readBoolean(); Loading @@ -345,7 +358,8 @@ public final class InputMethodInfo implements Parcelable { settingsActivity, null /* subtypes */, 0 /* isDefaultResId */, false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */, false /* inlineSuggestionsEnabled */, false /* isVrOnly */, 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */); 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */, false /* inlineSuggestionsEnabled */); } /** Loading @@ -360,7 +374,8 @@ public final class InputMethodInfo implements Parcelable { settingsActivity, null /* subtypes */, 0 /* isDefaultResId */, false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */, false /* inlineSuggestionsEnabled */, false /* isVrOnly */, handledConfigChanges, false /* supportsStylusHandwriting */); false /* supportsStylusHandwriting */, false /* inlineSuggestionsEnabled */); } /** Loading @@ -373,7 +388,8 @@ public final class InputMethodInfo implements Parcelable { this(ri, isAuxIme, settingsActivity, subtypes, isDefaultResId, forceDefault, true /* supportsSwitchingToNextInputMethod */, false /* inlineSuggestionsEnabled */, false /* isVrOnly */, 0 /* handledconfigChanges */, false /* supportsStylusHandwriting */); false /* supportsStylusHandwriting */, false /* inlineSuggestionsEnabled */); } /** Loading @@ -385,7 +401,8 @@ public final class InputMethodInfo implements Parcelable { boolean supportsSwitchingToNextInputMethod, boolean isVrOnly) { this(ri, isAuxIme, settingsActivity, subtypes, isDefaultResId, forceDefault, supportsSwitchingToNextInputMethod, false /* inlineSuggestionsEnabled */, isVrOnly, 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */); 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */, false /* inlineSuggestionsEnabled */); } /** Loading @@ -395,7 +412,8 @@ public final class InputMethodInfo implements Parcelable { public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault, boolean supportsSwitchingToNextInputMethod, boolean inlineSuggestionsEnabled, boolean isVrOnly, int handledConfigChanges, boolean supportsStylusHandwriting) { boolean isVrOnly, int handledConfigChanges, boolean supportsStylusHandwriting, boolean supportsInlineSuggestionsWithTouchExploration) { final ServiceInfo si = ri.serviceInfo; mService = ri; mId = new ComponentName(si.packageName, si.name).flattenToShortString(); Loading @@ -406,6 +424,8 @@ public final class InputMethodInfo implements Parcelable { mForceDefault = forceDefault; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; mInlineSuggestionsEnabled = inlineSuggestionsEnabled; mSupportsInlineSuggestionsWithTouchExploration = supportsInlineSuggestionsWithTouchExploration; mSuppressesSpellChecker = false; mShowInInputMethodPicker = true; mIsVrOnly = isVrOnly; Loading Loading @@ -583,6 +603,8 @@ public final class InputMethodInfo implements Parcelable { + " mIsVrOnly=" + mIsVrOnly + " mSupportsSwitchingToNextInputMethod=" + mSupportsSwitchingToNextInputMethod + " mInlineSuggestionsEnabled=" + mInlineSuggestionsEnabled + " mSupportsInlineSuggestionsWithTouchExploration=" + mSupportsInlineSuggestionsWithTouchExploration + " mSuppressesSpellChecker=" + mSuppressesSpellChecker + " mShowInInputMethodPicker=" + mShowInInputMethodPicker + " mSupportsStylusHandwriting=" + mSupportsStylusHandwriting); Loading Loading @@ -653,6 +675,15 @@ public final class InputMethodInfo implements Parcelable { return mInlineSuggestionsEnabled; } /** * Returns {@code true} if this input method supports inline suggestions when touch exploration * is enabled. * @hide */ public boolean supportsInlineSuggestionsWithTouchExploration() { return mSupportsInlineSuggestionsWithTouchExploration; } /** * Return {@code true} if this input method suppresses spell checker. */ Loading Loading @@ -683,6 +714,7 @@ public final class InputMethodInfo implements Parcelable { dest.writeInt(mIsAuxIme ? 1 : 0); dest.writeInt(mSupportsSwitchingToNextInputMethod ? 1 : 0); dest.writeInt(mInlineSuggestionsEnabled ? 1 : 0); dest.writeInt(mSupportsInlineSuggestionsWithTouchExploration ? 1 : 0); dest.writeBoolean(mSuppressesSpellChecker); dest.writeBoolean(mShowInInputMethodPicker); dest.writeBoolean(mIsVrOnly); Loading core/res/res/values/attrs.xml +8 −0 Original line number Diff line number Diff line Loading @@ -3644,6 +3644,14 @@ <attr name="__removed2" format="boolean" /> <!-- Specifies whether the IME supports showing inline suggestions. --> <attr name="supportsInlineSuggestions" format="boolean" /> <!-- Specifies whether the IME supports showing inline suggestions when touch exploration is enabled. This does nothing if supportsInlineSuggestions is false. The default value is false and most IMEs should not set this to true since the older menu-style Autofill works better with touch exploration. This attribute should be set to true in special situations, such as if this is an accessibility-focused IME which blocks user interaction with the app window while the IME is displayed. --> <attr name="supportsInlineSuggestionsWithTouchExploration" format="boolean" /> <!-- Specifies whether the IME suppresses system spell checker. The default value is false. If an IME sets this attribute to true, the system spell checker will be disabled while the IME has an Loading core/res/res/values/public.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3280,6 +3280,7 @@ <public name="knownActivityEmbeddingCerts" /> <public name="intro" /> <public name="enableOnBackInvokedCallback" /> <public name="supportsInlineSuggestionsWithTouchExploration" /> </staging-public-group> <staging-public-group type="id" first-id="0x01de0000"> Loading core/tests/coretests/res/xml/ime_meta_inline_suggestions_with_touch_exploration.xml 0 → 100644 +28 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2022 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:supportsInlineSuggestionsWithTouchExploration="true" > <subtype android:label="subtype1" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" /> </input-method> Loading
core/api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -1453,6 +1453,7 @@ package android { field public static final int supportsAssist = 16844016; // 0x10104f0 field public static final int supportsBatteryGameMode; field public static final int supportsInlineSuggestions = 16844301; // 0x101060d field public static final int supportsInlineSuggestionsWithTouchExploration; field public static final int supportsLaunchVoiceAssistFromKeyguard = 16844017; // 0x10104f1 field public static final int supportsLocalInteraction = 16844047; // 0x101050f field public static final int supportsMultipleDisplays = 16844182; // 0x1010596
core/java/android/view/inputmethod/InputMethodInfo.java +37 −5 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ import java.util.List; * @attr ref android.R.styleable#InputMethod_isDefault * @attr ref android.R.styleable#InputMethod_supportsSwitchingToNextInputMethod * @attr ref android.R.styleable#InputMethod_supportsInlineSuggestions * @attr ref android.R.styleable#InputMethod_supportsInlineSuggestionsWithTouchExploration * @attr ref android.R.styleable#InputMethod_suppressesSpellChecker * @attr ref android.R.styleable#InputMethod_showInInputMethodPicker * @attr ref android.R.styleable#InputMethod_configChanges Loading Loading @@ -124,6 +125,11 @@ public final class InputMethodInfo implements Parcelable { */ private final boolean mInlineSuggestionsEnabled; /** * The flag whether this IME supports inline suggestions when touch exploration is enabled. */ private final boolean mSupportsInlineSuggestionsWithTouchExploration; /** * The flag whether this IME suppresses spell checker. */ Loading Loading @@ -189,6 +195,7 @@ public final class InputMethodInfo implements Parcelable { boolean isAuxIme = true; boolean supportsSwitchingToNextInputMethod = false; // false as default boolean inlineSuggestionsEnabled = false; // false as default boolean supportsInlineSuggestionsWithTouchExploration = false; // false as default boolean suppressesSpellChecker = false; // false as default boolean showInInputMethodPicker = true; // true as default mForceDefault = false; Loading Loading @@ -234,6 +241,9 @@ public final class InputMethodInfo implements Parcelable { false); inlineSuggestionsEnabled = sa.getBoolean( com.android.internal.R.styleable.InputMethod_supportsInlineSuggestions, false); supportsInlineSuggestionsWithTouchExploration = sa.getBoolean( com.android.internal.R.styleable .InputMethod_supportsInlineSuggestionsWithTouchExploration, false); suppressesSpellChecker = sa.getBoolean( com.android.internal.R.styleable.InputMethod_suppressesSpellChecker, false); showInInputMethodPicker = sa.getBoolean( Loading Loading @@ -314,6 +324,8 @@ public final class InputMethodInfo implements Parcelable { mIsAuxIme = isAuxIme; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; mInlineSuggestionsEnabled = inlineSuggestionsEnabled; mSupportsInlineSuggestionsWithTouchExploration = supportsInlineSuggestionsWithTouchExploration; mSuppressesSpellChecker = suppressesSpellChecker; mShowInInputMethodPicker = showInInputMethodPicker; mIsVrOnly = isVrOnly; Loading @@ -326,6 +338,7 @@ public final class InputMethodInfo implements Parcelable { mIsAuxIme = source.readInt() == 1; mSupportsSwitchingToNextInputMethod = source.readInt() == 1; mInlineSuggestionsEnabled = source.readInt() == 1; mSupportsInlineSuggestionsWithTouchExploration = source.readInt() == 1; mSuppressesSpellChecker = source.readBoolean(); mShowInInputMethodPicker = source.readBoolean(); mIsVrOnly = source.readBoolean(); Loading @@ -345,7 +358,8 @@ public final class InputMethodInfo implements Parcelable { settingsActivity, null /* subtypes */, 0 /* isDefaultResId */, false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */, false /* inlineSuggestionsEnabled */, false /* isVrOnly */, 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */); 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */, false /* inlineSuggestionsEnabled */); } /** Loading @@ -360,7 +374,8 @@ public final class InputMethodInfo implements Parcelable { settingsActivity, null /* subtypes */, 0 /* isDefaultResId */, false /* forceDefault */, true /* supportsSwitchingToNextInputMethod */, false /* inlineSuggestionsEnabled */, false /* isVrOnly */, handledConfigChanges, false /* supportsStylusHandwriting */); false /* supportsStylusHandwriting */, false /* inlineSuggestionsEnabled */); } /** Loading @@ -373,7 +388,8 @@ public final class InputMethodInfo implements Parcelable { this(ri, isAuxIme, settingsActivity, subtypes, isDefaultResId, forceDefault, true /* supportsSwitchingToNextInputMethod */, false /* inlineSuggestionsEnabled */, false /* isVrOnly */, 0 /* handledconfigChanges */, false /* supportsStylusHandwriting */); false /* supportsStylusHandwriting */, false /* inlineSuggestionsEnabled */); } /** Loading @@ -385,7 +401,8 @@ public final class InputMethodInfo implements Parcelable { boolean supportsSwitchingToNextInputMethod, boolean isVrOnly) { this(ri, isAuxIme, settingsActivity, subtypes, isDefaultResId, forceDefault, supportsSwitchingToNextInputMethod, false /* inlineSuggestionsEnabled */, isVrOnly, 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */); 0 /* handledConfigChanges */, false /* supportsStylusHandwriting */, false /* inlineSuggestionsEnabled */); } /** Loading @@ -395,7 +412,8 @@ public final class InputMethodInfo implements Parcelable { public InputMethodInfo(ResolveInfo ri, boolean isAuxIme, String settingsActivity, List<InputMethodSubtype> subtypes, int isDefaultResId, boolean forceDefault, boolean supportsSwitchingToNextInputMethod, boolean inlineSuggestionsEnabled, boolean isVrOnly, int handledConfigChanges, boolean supportsStylusHandwriting) { boolean isVrOnly, int handledConfigChanges, boolean supportsStylusHandwriting, boolean supportsInlineSuggestionsWithTouchExploration) { final ServiceInfo si = ri.serviceInfo; mService = ri; mId = new ComponentName(si.packageName, si.name).flattenToShortString(); Loading @@ -406,6 +424,8 @@ public final class InputMethodInfo implements Parcelable { mForceDefault = forceDefault; mSupportsSwitchingToNextInputMethod = supportsSwitchingToNextInputMethod; mInlineSuggestionsEnabled = inlineSuggestionsEnabled; mSupportsInlineSuggestionsWithTouchExploration = supportsInlineSuggestionsWithTouchExploration; mSuppressesSpellChecker = false; mShowInInputMethodPicker = true; mIsVrOnly = isVrOnly; Loading Loading @@ -583,6 +603,8 @@ public final class InputMethodInfo implements Parcelable { + " mIsVrOnly=" + mIsVrOnly + " mSupportsSwitchingToNextInputMethod=" + mSupportsSwitchingToNextInputMethod + " mInlineSuggestionsEnabled=" + mInlineSuggestionsEnabled + " mSupportsInlineSuggestionsWithTouchExploration=" + mSupportsInlineSuggestionsWithTouchExploration + " mSuppressesSpellChecker=" + mSuppressesSpellChecker + " mShowInInputMethodPicker=" + mShowInInputMethodPicker + " mSupportsStylusHandwriting=" + mSupportsStylusHandwriting); Loading Loading @@ -653,6 +675,15 @@ public final class InputMethodInfo implements Parcelable { return mInlineSuggestionsEnabled; } /** * Returns {@code true} if this input method supports inline suggestions when touch exploration * is enabled. * @hide */ public boolean supportsInlineSuggestionsWithTouchExploration() { return mSupportsInlineSuggestionsWithTouchExploration; } /** * Return {@code true} if this input method suppresses spell checker. */ Loading Loading @@ -683,6 +714,7 @@ public final class InputMethodInfo implements Parcelable { dest.writeInt(mIsAuxIme ? 1 : 0); dest.writeInt(mSupportsSwitchingToNextInputMethod ? 1 : 0); dest.writeInt(mInlineSuggestionsEnabled ? 1 : 0); dest.writeInt(mSupportsInlineSuggestionsWithTouchExploration ? 1 : 0); dest.writeBoolean(mSuppressesSpellChecker); dest.writeBoolean(mShowInInputMethodPicker); dest.writeBoolean(mIsVrOnly); Loading
core/res/res/values/attrs.xml +8 −0 Original line number Diff line number Diff line Loading @@ -3644,6 +3644,14 @@ <attr name="__removed2" format="boolean" /> <!-- Specifies whether the IME supports showing inline suggestions. --> <attr name="supportsInlineSuggestions" format="boolean" /> <!-- Specifies whether the IME supports showing inline suggestions when touch exploration is enabled. This does nothing if supportsInlineSuggestions is false. The default value is false and most IMEs should not set this to true since the older menu-style Autofill works better with touch exploration. This attribute should be set to true in special situations, such as if this is an accessibility-focused IME which blocks user interaction with the app window while the IME is displayed. --> <attr name="supportsInlineSuggestionsWithTouchExploration" format="boolean" /> <!-- Specifies whether the IME suppresses system spell checker. The default value is false. If an IME sets this attribute to true, the system spell checker will be disabled while the IME has an Loading
core/res/res/values/public.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3280,6 +3280,7 @@ <public name="knownActivityEmbeddingCerts" /> <public name="intro" /> <public name="enableOnBackInvokedCallback" /> <public name="supportsInlineSuggestionsWithTouchExploration" /> </staging-public-group> <staging-public-group type="id" first-id="0x01de0000"> Loading
core/tests/coretests/res/xml/ime_meta_inline_suggestions_with_touch_exploration.xml 0 → 100644 +28 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2022 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:supportsInlineSuggestionsWithTouchExploration="true" > <subtype android:label="subtype1" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" /> </input-method>