Remove unnecessary IMMS#calledFromValidUser()
If an IPC end point is exposed only to IMEs via
IInputMethodPrivilegedOperations.aidl, there is no need to call
calledFromValidUser() because the caller verification is expected to
be already done by calledWithValidTokenLocked().
Bug: 34886274
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I5f124dd5c4dcabe5e0d6bce9056251c5a8a95321
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index d400940..a7b6c8b 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -3120,9 +3120,6 @@
@BinderThread
private boolean switchToPreviousInputMethod(IBinder token) {
- if (!calledFromValidUser()) {
- return false;
- }
synchronized (mMethodMap) {
if (!calledWithValidTokenLocked(token)) {
return false;
@@ -3195,9 +3192,6 @@
@BinderThread
private boolean switchToNextInputMethod(IBinder token, boolean onlyCurrentIme) {
- if (!calledFromValidUser()) {
- return false;
- }
synchronized (mMethodMap) {
if (!calledWithValidTokenLocked(token)) {
return false;
@@ -3215,9 +3209,6 @@
@BinderThread
private boolean shouldOfferSwitchingToNextInputMethod(@NonNull IBinder token) {
- if (!calledFromValidUser()) {
- return false;
- }
synchronized (mMethodMap) {
if (!calledWithValidTokenLocked(token)) {
return false;
@@ -3362,9 +3353,6 @@
@BinderThread
private void hideMySoftInput(@NonNull IBinder token, int flags) {
- if (!calledFromValidUser()) {
- return;
- }
synchronized (mMethodMap) {
if (!calledWithValidTokenLocked(token)) {
return;
@@ -3380,9 +3368,6 @@
@BinderThread
private void showMySoftInput(@NonNull IBinder token, int flags) {
- if (!calledFromValidUser()) {
- return;
- }
synchronized (mMethodMap) {
if (!calledWithValidTokenLocked(token)) {
return;
@@ -4534,10 +4519,6 @@
@BinderThread
private IInputContentUriToken createInputContentUriToken(@Nullable IBinder token,
@Nullable Uri contentUri, @Nullable String packageName) {
- if (!calledFromValidUser()) {
- return null;
- }
-
if (token == null) {
throw new NullPointerException("token");
}
@@ -4591,9 +4572,6 @@
@BinderThread
private void reportFullscreenMode(IBinder token, boolean fullscreen) {
- if (!calledFromValidUser()) {
- return;
- }
synchronized (mMethodMap) {
if (!calledWithValidTokenLocked(token)) {
return;