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

Commit 18baa69f authored by Yohei Yukawa's avatar Yohei Yukawa Committed by mse1969
Browse files

[BACKPORT] Merge IInputMethodManager#get{,AwareLocked}InputMethodList

This is a follow up CL to our previous CL [1], which introduced

  IInputMethodManager#getAwareLockedInputMethodList

as a variant of

  IInputMethodManager#getInputMethodList.

This CL mechanically merges those two IPC entries into one entry as
specifying

  DirectBootAwareness.AUTO

is something we can do in the IME client side, without changing any
observable semantics.

 [1]: I54d5dbec7e76d6a68935007ed3af0641f717a7c5
      04a22633

Bug: 210083408
Bug: 234882948
Test: presubmit
Change-Id: Ic02484fcbb9c1bbd8e964bb7a2f7acff904e2a33
parent d33433cc
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -64,19 +64,10 @@ final class IInputMethodManagerInvoker {
    }

    @AnyThread
    List<InputMethodInfo> getInputMethodList(@UserIdInt int userId) {
        try {
            return mTarget.getInputMethodList(userId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    @AnyThread
    List<InputMethodInfo> getAwareLockedInputMethodList(@UserIdInt int userId,
    List<InputMethodInfo> getInputMethodList(@UserIdInt int userId,
            @DirectBootAwareness int directBootAwareness) {
        try {
            return mTarget.getAwareLockedInputMethodList(userId, directBootAwareness);
            return mTarget.getInputMethodList(userId, directBootAwareness);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+3 −3
Original line number Diff line number Diff line
@@ -1413,7 +1413,7 @@ public final class InputMethodManager {
        // We intentionally do not use UserHandle.getCallingUserId() here because for system
        // services InputMethodManagerInternal.getInputMethodListAsUser() should be used
        // instead.
        return mServiceInvoker.getInputMethodList(UserHandle.myUserId());
        return mServiceInvoker.getInputMethodList(UserHandle.myUserId(), DirectBootAwareness.AUTO);
    }

    /**
@@ -1427,7 +1427,7 @@ public final class InputMethodManager {
    @RequiresPermission(INTERACT_ACROSS_USERS_FULL)
    @NonNull
    public List<InputMethodInfo> getInputMethodListAsUser(@UserIdInt int userId) {
        return mServiceInvoker.getInputMethodList(userId);
        return mServiceInvoker.getInputMethodList(userId, DirectBootAwareness.AUTO);
    }

    /**
@@ -1443,7 +1443,7 @@ public final class InputMethodManager {
    @NonNull
    public List<InputMethodInfo> getInputMethodListAsUser(@UserIdInt int userId,
            @DirectBootAwareness int directBootAwareness) {
        return mServiceInvoker.getAwareLockedInputMethodList(userId, directBootAwareness);
        return mServiceInvoker.getInputMethodList(userId, directBootAwareness);
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -36,8 +36,7 @@ interface IInputMethodManager {
            int untrustedDisplayId);

    // TODO: Use ParceledListSlice instead
    List<InputMethodInfo> getInputMethodList(int userId);
    List<InputMethodInfo> getAwareLockedInputMethodList(int userId, int directBootAwareness);
    List<InputMethodInfo> getInputMethodList(int userId, int directBootAwareness);
    // TODO: Use ParceledListSlice instead
    List<InputMethodInfo> getEnabledInputMethodList(int userId);
    List<InputMethodSubtype> getEnabledInputMethodSubtypeList(in String imiId,
+4 −12
Original line number Diff line number Diff line
@@ -2141,7 +2141,10 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        return true;
    }

    private List<InputMethodInfo> getInputMethodListInternal(@UserIdInt int userId,
    @BinderThread
    @NonNull
    @Override
    public List<InputMethodInfo> getInputMethodList(@UserIdInt int userId,
            @DirectBootAwareness int directBootAwareness) {
        if (UserHandle.getCallingUserId() != userId) {
            mContext.enforceCallingPermission(
@@ -2162,17 +2165,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        }
    }

    @Override
    public List<InputMethodInfo> getInputMethodList(@UserIdInt int userId) {
        return getInputMethodListInternal(userId, DirectBootAwareness.AUTO);
    }

    @Override
    public List<InputMethodInfo> getAwareLockedInputMethodList(@UserIdInt int userId,
            @DirectBootAwareness int directBootAwareness) {
        return getInputMethodListInternal(userId, directBootAwareness);
    }

    @Override
    public List<InputMethodInfo> getEnabledInputMethodList(@UserIdInt int userId) {
        if (UserHandle.getCallingUserId() != userId) {