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
      f48d794e01

Bug: 234882948
Test: presubmit
Change-Id: Id7d02ef0055a65c1e4527afff43959444418f751
This commit is contained in:
Yohei Yukawa
2022-07-15 11:49:08 -07:00
parent 3e744915e3
commit d3cbe81e59

View File

@@ -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();