From ec8b1449f257337dab95c8e4c4957c749b1291d8 Mon Sep 17 00:00:00 2001 From: kholoud mohamed Date: Fri, 5 Mar 2021 10:31:42 +0000 Subject: [PATCH] Expose getInputMethodListAsUser as a testAPI This is required for a newly added gts test. Bug: 180328483 Bug: 175380793 Test: atest ManagedProvisioningRequiredAppsTest Change-Id: I4b73d9374d7a2ce4c9dfc48682a43d5d48b39042 --- core/api/test-current.txt | 1 + core/java/android/view/inputmethod/InputMethodManager.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/core/api/test-current.txt b/core/api/test-current.txt index e4757e6204b76..501ac9655a4d1 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -2695,6 +2695,7 @@ package android.view.inputmethod { public final class InputMethodManager { method public int getDisplayId(); + method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public java.util.List getInputMethodListAsUser(int); method public boolean hasActiveInputConnection(@Nullable android.view.View); method public boolean isInputMethodPickerShown(); } diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index a8fff8bb6a434..cd9d8bf1cff01 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -1373,7 +1373,9 @@ public final class InputMethodManager { * @return {@link List} of {@link InputMethodInfo}. * @hide */ + @TestApi @RequiresPermission(INTERACT_ACROSS_USERS_FULL) + @NonNull public List getInputMethodListAsUser(@UserIdInt int userId) { try { final Completable.InputMethodInfoList value = Completable.createInputMethodInfoList();