Allowing the root user to use the screen introspection APIs.
We were allowing the system and the shell user to access use the
screen introspection APIs but the root user was not able to to so.
This change enableS the root user to also use these APIs. Note that
we usually allow the root user to access privileged functionality
similarly to the shell user of the system.
bug:8877685
Change-Id: Ie4008339e864b835bd3a2d5e06b042e4431c5270
diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
index fd6b467..83e69d6f 100644
--- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -2820,7 +2820,8 @@
public int resolveCallingUserIdEnforcingPermissionsLocked(int userId) {
final int callingUid = Binder.getCallingUid();
- if (callingUid == Process.SYSTEM_UID
+ if (callingUid == 0
+ || callingUid == Process.SYSTEM_UID
|| callingUid == Process.SHELL_UID) {
return mCurrentUserId;
}