From d3cbe81e59a9c494e94d2160c0da50751d647c16 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 15 Jul 2022 11:49:08 -0700 Subject: [PATCH] Import EnforcePermission in IMMS This is a follow up CL for a recent global clean-up CL [1], which migrated IInputMethodManager#removeImeSurface() from manual permission check with Context.enforceCallingPermission(INTERNAL_SYSTEM_WINDOW) with @EnforcePermission("INTERNAL_SYSTEM_WINDOW"). To minimize the risk of merge conflicts, that CL did not import EnforcePermission. Now that the CL gets merged successfully, let's simplify the code for future use of @EnforcePermission attribute in InputMethodManagerService. This is a mechanical refactoring. There should be no behavior change. [1]: Id9bdeb71e84962d55fd1657e91856d84e1c3d11b f48d794e014942a8a810c6448780d7cd6f7885ec Bug: 234882948 Test: presubmit Change-Id: Id7d02ef0055a65c1e4527afff43959444418f751 --- .../android/server/inputmethod/InputMethodManagerService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 34b2769da86c0..4fda63fd27a73 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -59,6 +59,7 @@ import android.annotation.AnyThread; import android.annotation.BinderThread; import android.annotation.ColorInt; import android.annotation.DrawableRes; +import android.annotation.EnforcePermission; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -4281,7 +4282,7 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub }); } - @android.annotation.EnforcePermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW) + @EnforcePermission(Manifest.permission.INTERNAL_SYSTEM_WINDOW) @Override public void removeImeSurface() { mHandler.obtainMessage(MSG_REMOVE_IME_SURFACE).sendToTarget();