summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Yohei Yukawa <yukawa@google.com> 2017-12-10 18:15:19 -0800
committer Yohei Yukawa <yukawa@google.com> 2017-12-10 18:15:19 -0800
commit7a46c28d4571e037e26a28ea8e2a01312d916d47 (patch)
treee447800abc7978599fdcf485d0f1d243624a54ba
parent84321d87b9b732f2429df0a3830c43659a3a8ee0 (diff)
Simplify IMMS#startVrInputMethodNoCheck a bit
This is a follow up CL to a recent CL [1] that added VR-IME support. Currently, IMMS#startVrInputMethodNoCheck() internally calls IMMS#setInputMethodEnabled(), which enforces the caller user ID check and caller permission check for WRITE_SECURE_SETTINGS. This appears to make sense for IMMS#startVrInputMethodNoCheck(), but in reallity IMMS#startVrInputMethodNoCheck() always gets called on non-binder system server thread hence those checks will never fail. Note that such a call path is fine and not a security issue. What this CL tries to address is just replace IMMS#setInputMethodEnabledLocked() to make it clear that IMMS allows such an operation for callers that have RESTRICTED_VR_ACCESS is intentional. To summarize, this CL just removes redundant operations and there should be no visible behavior change. [1]: I1db7981b5198e7e203d4578cae7e5b6d20037d0d 89a6c48a8b2e54f9b93211c20a126edab0eefe35 Bug: 63037786 Test: compile Change-Id: Iec43177bd698de6efa453d64ceafec3164538151
-rw-r--r--services/core/java/com/android/server/InputMethodManagerService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/InputMethodManagerService.java b/services/core/java/com/android/server/InputMethodManagerService.java
index dc35051d2dfe..37f1dc490fe3 100644
--- a/services/core/java/com/android/server/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/InputMethodManagerService.java
@@ -889,7 +889,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
/**
* Start a VR InputMethod that matches IME with package name of {@param component}.
- * Note: This method is called from {@link VrManager}.
+ * Note: This method is called from {@link android.app.VrManager}.
*/
private void startVrInputMethodNoCheck(@Nullable ComponentName component) {
if (component == null) {
@@ -903,7 +903,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
for (InputMethodInfo info : mMethodList) {
if (TextUtils.equals(info.getPackageName(), packageName) && info.isVrOnly()) {
// set this is as current inputMethod without updating settings.
- setInputMethodEnabled(info.getId(), true);
+ setInputMethodEnabledLocked(info.getId(), true);
setInputMethodLocked(info.getId(), NOT_A_SUBTYPE_ID);
break;
}