Loading core/java/android/app/VrManager.java +19 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.ComponentName; import android.content.Context; import android.os.Handler; Loading Loading @@ -214,4 +215,22 @@ public class VrManager { e.rethrowFromSystemServer(); } } /** * Start VR Input method for the packageName in {@link ComponentName}. * This method notifies InputMethodManagerService to use VR IME instead of * regular phone IME. * @param componentName ComponentName of a VR InputMethod that should be set as selected * input by InputMethodManagerService. * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setVrInputMethod(ComponentName componentName) { try { mService.setVrInputMethod(componentName); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } } core/java/android/service/vr/IVrManager.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.service.vr; import android.app.Vr2dDisplayProperties; import android.content.ComponentName; import android.service.vr.IVrStateCallbacks; import android.service.vr.IPersistentVrStateCallbacks; Loading Loading @@ -109,5 +110,13 @@ interface IVrManager { * @param standy True if the device is entering standby, false if it's exiting standby. */ void setStandbyEnabled(boolean standby); /** * Start VR Input method for the given packageName in {@param componentName}. * This method notifies InputMethodManagerService to use VR IME instead of * regular phone IME. */ void setVrInputMethod(in ComponentName componentName); } core/java/android/view/inputmethod/InputMethodManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -697,6 +697,19 @@ public final class InputMethodManager { } } /** * Returns a list of VR InputMethod currently installed. * @hide */ @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public List<InputMethodInfo> getVrInputMethodList() { try { return mService.getVrInputMethodList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } public List<InputMethodInfo> getEnabledInputMethodList() { try { return mService.getEnabledInputMethodList(); Loading core/java/android/view/inputmethod/InputMethodManagerInternal.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.view.inputmethod; import android.content.ComponentName; /** * Input method manager local system service interface. * Loading @@ -37,4 +39,9 @@ public interface InputMethodManagerInternal { * Hides the current input method, if visible. */ void hideCurrentInputMethod(); /** * Switches to VR InputMethod defined in the packageName of {@param componentName}. */ void startVrInputMethodNoCheck(ComponentName componentName); } core/java/com/android/internal/inputmethod/InputMethodUtils.java +1 −3 Original line number Diff line number Diff line Loading @@ -836,7 +836,6 @@ public class InputMethodUtils { private final Resources mRes; private final ContentResolver mResolver; private final HashMap<String, InputMethodInfo> mMethodMap; private final ArrayList<InputMethodInfo> mMethodList; /** * On-memory data store to emulate when {@link #mCopyOnWrite} is {@code true}. Loading Loading @@ -906,7 +905,6 @@ public class InputMethodUtils { mRes = res; mResolver = resolver; mMethodMap = methodMap; mMethodList = methodList; switchCurrentUser(userId, copyOnWrite); } Loading Loading @@ -1087,7 +1085,7 @@ public class InputMethodUtils { final ArrayList<InputMethodInfo> res = new ArrayList<>(); for (Pair<String, ArrayList<String>> ims: imsList) { InputMethodInfo info = mMethodMap.get(ims.first); if (info != null) { if (info != null && !info.isVrOnly()) { res.add(info); } } Loading Loading
core/java/android/app/VrManager.java +19 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.ComponentName; import android.content.Context; import android.os.Handler; Loading Loading @@ -214,4 +215,22 @@ public class VrManager { e.rethrowFromSystemServer(); } } /** * Start VR Input method for the packageName in {@link ComponentName}. * This method notifies InputMethodManagerService to use VR IME instead of * regular phone IME. * @param componentName ComponentName of a VR InputMethod that should be set as selected * input by InputMethodManagerService. * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public void setVrInputMethod(ComponentName componentName) { try { mService.setVrInputMethod(componentName); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } }
core/java/android/service/vr/IVrManager.aidl +9 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.service.vr; import android.app.Vr2dDisplayProperties; import android.content.ComponentName; import android.service.vr.IVrStateCallbacks; import android.service.vr.IPersistentVrStateCallbacks; Loading Loading @@ -109,5 +110,13 @@ interface IVrManager { * @param standy True if the device is entering standby, false if it's exiting standby. */ void setStandbyEnabled(boolean standby); /** * Start VR Input method for the given packageName in {@param componentName}. * This method notifies InputMethodManagerService to use VR IME instead of * regular phone IME. */ void setVrInputMethod(in ComponentName componentName); }
core/java/android/view/inputmethod/InputMethodManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -697,6 +697,19 @@ public final class InputMethodManager { } } /** * Returns a list of VR InputMethod currently installed. * @hide */ @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS) public List<InputMethodInfo> getVrInputMethodList() { try { return mService.getVrInputMethodList(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } public List<InputMethodInfo> getEnabledInputMethodList() { try { return mService.getEnabledInputMethodList(); Loading
core/java/android/view/inputmethod/InputMethodManagerInternal.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.view.inputmethod; import android.content.ComponentName; /** * Input method manager local system service interface. * Loading @@ -37,4 +39,9 @@ public interface InputMethodManagerInternal { * Hides the current input method, if visible. */ void hideCurrentInputMethod(); /** * Switches to VR InputMethod defined in the packageName of {@param componentName}. */ void startVrInputMethodNoCheck(ComponentName componentName); }
core/java/com/android/internal/inputmethod/InputMethodUtils.java +1 −3 Original line number Diff line number Diff line Loading @@ -836,7 +836,6 @@ public class InputMethodUtils { private final Resources mRes; private final ContentResolver mResolver; private final HashMap<String, InputMethodInfo> mMethodMap; private final ArrayList<InputMethodInfo> mMethodList; /** * On-memory data store to emulate when {@link #mCopyOnWrite} is {@code true}. Loading Loading @@ -906,7 +905,6 @@ public class InputMethodUtils { mRes = res; mResolver = resolver; mMethodMap = methodMap; mMethodList = methodList; switchCurrentUser(userId, copyOnWrite); } Loading Loading @@ -1087,7 +1085,7 @@ public class InputMethodUtils { final ArrayList<InputMethodInfo> res = new ArrayList<>(); for (Pair<String, ArrayList<String>> ims: imsList) { InputMethodInfo info = mMethodMap.get(ims.first); if (info != null) { if (info != null && !info.isVrOnly()) { res.add(info); } } Loading