Skip to content

Commit 27f3de6

Browse files
committed
Fixs the incorrect message for SecurityException
when injecting a Key, Pointer and Trackball events into the UI across applications, the corresponding methods throw SecurityException with incorrect permission message. INJECT EVENT permission should be INJECT_EVENTS
1 parent b81b144 commit 27f3de6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

services/java/com/android/server/WindowManagerService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5285,7 +5285,7 @@ public boolean injectKeyEvent(KeyEvent ev, boolean sync) {
52855285
switch (result) {
52865286
case INJECT_NO_PERMISSION:
52875287
throw new SecurityException(
5288-
"Injecting to another application requires INJECT_EVENT permission");
5288+
"Injecting to another application requires INJECT_EVENTS permission");
52895289
case INJECT_SUCCEEDED:
52905290
return true;
52915291
}
@@ -5313,7 +5313,7 @@ public boolean injectPointerEvent(MotionEvent ev, boolean sync) {
53135313
switch (result) {
53145314
case INJECT_NO_PERMISSION:
53155315
throw new SecurityException(
5316-
"Injecting to another application requires INJECT_EVENT permission");
5316+
"Injecting to another application requires INJECT_EVENTS permission");
53175317
case INJECT_SUCCEEDED:
53185318
return true;
53195319
}
@@ -5341,7 +5341,7 @@ public boolean injectTrackballEvent(MotionEvent ev, boolean sync) {
53415341
switch (result) {
53425342
case INJECT_NO_PERMISSION:
53435343
throw new SecurityException(
5344-
"Injecting to another application requires INJECT_EVENT permission");
5344+
"Injecting to another application requires INJECT_EVENTS permission");
53455345
case INJECT_SUCCEEDED:
53465346
return true;
53475347
}

0 commit comments

Comments
 (0)