summaryrefslogtreecommitdiffstats
path: root/services/accessibility
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2014-10-01 23:24:46 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-01 23:24:47 +0000
commitd35b072dca42d249c219c886322c122739b086d7 (patch)
tree25dae4999e3f26cad436a3ef33e9e757898d753d /services/accessibility
parent144508d5da4dec37183617ec259ab83d2db4f012 (diff)
parentceac51deddb873956c647d1b2dc7b2cc251d404b (diff)
downloadframeworks_base-d35b072dca42d249c219c886322c122739b086d7.zip
frameworks_base-d35b072dca42d249c219c886322c122739b086d7.tar.gz
frameworks_base-d35b072dca42d249c219c886322c122739b086d7.tar.bz2
Merge "Fix accessiblity introspection from the shell user regression." into lmp-dev
Diffstat (limited to 'services/accessibility')
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index cc17422..7d4156f 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -2117,7 +2117,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return null;
}
@@ -2148,7 +2148,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return null;
}
@@ -2181,7 +2181,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return false;
}
@@ -2233,7 +2233,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return false;
}
@@ -2285,7 +2285,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return false;
}
@@ -2337,7 +2337,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return false;
}
@@ -2390,7 +2390,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return false;
}
@@ -2441,7 +2441,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return false;
}
@@ -2480,7 +2480,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return false;
}
@@ -2527,7 +2527,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
// performs the current profile parent resolution.
final int resolvedUserId = mSecurityPolicy
.resolveCallingUserIdEnforcingPermissionsLocked(
- UserHandle.getCallingUserId());
+ UserHandle.USER_CURRENT);
if (resolvedUserId != mCurrentUserId) {
return false;
}
@@ -3621,6 +3621,12 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub {
if (callingUserId == userId) {
return resolveProfileParentLocked(userId);
}
+ final int callingUserParentId = resolveProfileParentLocked(callingUserId);
+ if (callingUserParentId == mCurrentUserId &&
+ (userId == UserHandle.USER_CURRENT
+ || userId == UserHandle.USER_CURRENT_OR_SELF)) {
+ return mCurrentUserId;
+ }
if (!hasPermission(Manifest.permission.INTERACT_ACROSS_USERS)
&& !hasPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL)) {
throw new SecurityException("Call from user " + callingUserId + " as user "