summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-02-08 15:56:46 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-02-08 15:56:46 +0000
commitd48e28a9f452da190cdeb8dfc5fca2e743915f8d (patch)
treed8435104890d5d549a0d8ebc262a4031492f9603
parent25ffe6ce31466412b57920d266437f56950c6b65 (diff)
parent7d90aacd9b89beb098aa4f7c0993634e7b2c9d93 (diff)
Merge "Fix permission check bypass in IMMS#dump()" into sc-dev
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index 6f7f69e5b707..1a4c8b7d6571 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -5227,6 +5227,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
@Override
protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
+
boolean asProto = false;
for (int argIndex = 0; argIndex < args.length; argIndex++) {
if (args[argIndex].equals(PROTO_ARG)) {
@@ -5249,8 +5251,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
private void doDump(FileDescriptor fd, PrintWriter pw, String[] args, boolean useProto) {
- if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
-
if (useProto) {
final ProtoOutputStream proto = new ProtoOutputStream(fd);
dumpDebug(proto, InputMethodManagerServiceTraceProto.INPUT_METHOD_MANAGER_SERVICE);