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

Commit 2988d2db authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Unimplement VrManager#setVrInputMethod()

A system API VrManager#setVrInputMethod(), which was originally
introduced in Android P [1], has hever been used actually.  To avoid
unnecessary maintenance burden in the Android Framework, this CL makes
VrManager#setVrInputMethod() no-op.

For those who want to develop VR Keyboard, they should be able to use
Android P build to see if it actually works and it's actually what
they want.  In the future, if we can have a working prototype, we can
revisit here to see if we want to restore the framework implementation
or not.

Note that with this CL IMEs that have android:isVrOnly="true" will
always be ignored.

There should be no user/developer visible behavior change because this
is about an unused system API.

 [1]: I1db7981b5198e7e203d4578cae7e5b6d20037d0d
      89a6c48a

Bug: 72522822
Fix: 122058241
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:InputMethodInfoTest
Test: atest FrameworksServicesTests:InputMethodManagerServiceTests
Change-Id: I5464ff74b92ff4a0d30002d643bd3c89925f0f0c
parent 72d25b2d
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -215,19 +215,12 @@ public class VrManager {
    }

    /**
     * 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.
     * This method is not implemented.
     *
     * @param componentName not used
     */
    @RequiresPermission(android.Manifest.permission.RESTRICTED_VR_ACCESS)
    public void setVrInputMethod(ComponentName componentName) {
        try {
            mService.setVrInputMethod(componentName);
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }

    /**
+0 −8
Original line number Diff line number Diff line
@@ -110,13 +110,5 @@ 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);

}
+0 −13
Original line number Diff line number Diff line
@@ -922,19 +922,6 @@ 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();
+0 −1
Original line number Diff line number Diff line
@@ -35,7 +35,6 @@ interface IInputMethodManager {

    // TODO: Use ParceledListSlice instead
    List<InputMethodInfo> getInputMethodList();
    List<InputMethodInfo> getVrInputMethodList();
    // TODO: Use ParceledListSlice instead
    List<InputMethodInfo> getEnabledInputMethodList();
    List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId,
+0 −10
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.server.inputmethod;

import android.annotation.NonNull;
import android.annotation.UserIdInt;
import android.content.ComponentName;
import android.view.inputmethod.InputMethodInfo;

import com.android.server.LocalServices;
@@ -41,11 +40,6 @@ public abstract class InputMethodManagerInternal {
     */
    public abstract void hideCurrentInputMethod();

    /**
     * Switches to VR InputMethod defined in the packageName of {@param componentName}.
     */
    public abstract void startVrInputMethodNoCheck(ComponentName componentName);

    /**
     * Returns the list of installed input methods for the specified user.
     *
@@ -75,10 +69,6 @@ public abstract class InputMethodManagerInternal {
                public void hideCurrentInputMethod() {
                }

                @Override
                public void startVrInputMethodNoCheck(ComponentName componentName) {
                }

                @Override
                public List<InputMethodInfo> getInputMethodListAsUser(int userId) {
                    return Collections.emptyList();
Loading