Loading services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +9 −3 Original line number Diff line number Diff line Loading @@ -1315,8 +1315,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private void updateServicesLocked(UserState userState) { Map<ComponentName, Service> componentNameToServiceMap = userState.mComponentNameToServiceMap; boolean isUnlockingOrUnlocked = mContext.getSystemService(UserManager.class) boolean isUnlockingOrUnlocked; final long identity = Binder.clearCallingIdentity(); try { isUnlockingOrUnlocked = mContext.getSystemService(UserManager.class) .isUserUnlockingOrUnlocked(userState.mUserId); } finally { Binder.restoreCallingIdentity(identity); } for (int i = 0, count = userState.mInstalledServices.size(); i < count; i++) { AccessibilityServiceInfo installedService = userState.mInstalledServices.get(i); Loading Loading @@ -2531,7 +2537,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { // share the accessibility state of the parent. The call below // performs the current profile parent resolution. final int resolvedUserId = mSecurityPolicy .resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.USER_CURRENT); .resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.getCallingUserId()); return resolvedUserId == mCurrentUserId; } Loading services/accessibility/java/com/android/server/accessibility/DisplayAdjustmentUtils.java +19 −8 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.accessibility; import android.content.ContentResolver; import android.content.Context; import android.os.Binder; import android.provider.Settings.Secure; import android.view.accessibility.AccessibilityManager; Loading Loading @@ -60,11 +61,16 @@ class DisplayAdjustmentUtils { final DisplayTransformManager dtm = LocalServices.getService(DisplayTransformManager.class); int daltonizerMode = AccessibilityManager.DALTONIZER_DISABLED; long identity = Binder.clearCallingIdentity(); try { if (Secure.getIntForUser(cr, Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, 0, userId) != 0) { daltonizerMode = Secure.getIntForUser(cr, Secure.ACCESSIBILITY_DISPLAY_DALTONIZER, DEFAULT_DISPLAY_DALTONIZER, userId); } } finally { Binder.restoreCallingIdentity(identity); } float[] grayscaleMatrix = null; if (daltonizerMode == AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY) { Loading @@ -83,9 +89,14 @@ class DisplayAdjustmentUtils { final ContentResolver cr = context.getContentResolver(); final DisplayTransformManager dtm = LocalServices.getService(DisplayTransformManager.class); long identity = Binder.clearCallingIdentity(); try { final boolean invertColors = Secure.getIntForUser(cr, Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, 0, userId) != 0; dtm.setColorMatrix(DisplayTransformManager.LEVEL_COLOR_MATRIX_INVERT_COLOR, invertColors ? MATRIX_INVERT_COLOR : null); } finally { Binder.restoreCallingIdentity(identity); } } } Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +9 −3 Original line number Diff line number Diff line Loading @@ -1315,8 +1315,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { private void updateServicesLocked(UserState userState) { Map<ComponentName, Service> componentNameToServiceMap = userState.mComponentNameToServiceMap; boolean isUnlockingOrUnlocked = mContext.getSystemService(UserManager.class) boolean isUnlockingOrUnlocked; final long identity = Binder.clearCallingIdentity(); try { isUnlockingOrUnlocked = mContext.getSystemService(UserManager.class) .isUserUnlockingOrUnlocked(userState.mUserId); } finally { Binder.restoreCallingIdentity(identity); } for (int i = 0, count = userState.mInstalledServices.size(); i < count; i++) { AccessibilityServiceInfo installedService = userState.mInstalledServices.get(i); Loading Loading @@ -2531,7 +2537,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { // share the accessibility state of the parent. The call below // performs the current profile parent resolution. final int resolvedUserId = mSecurityPolicy .resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.USER_CURRENT); .resolveCallingUserIdEnforcingPermissionsLocked(UserHandle.getCallingUserId()); return resolvedUserId == mCurrentUserId; } Loading
services/accessibility/java/com/android/server/accessibility/DisplayAdjustmentUtils.java +19 −8 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.accessibility; import android.content.ContentResolver; import android.content.Context; import android.os.Binder; import android.provider.Settings.Secure; import android.view.accessibility.AccessibilityManager; Loading Loading @@ -60,11 +61,16 @@ class DisplayAdjustmentUtils { final DisplayTransformManager dtm = LocalServices.getService(DisplayTransformManager.class); int daltonizerMode = AccessibilityManager.DALTONIZER_DISABLED; long identity = Binder.clearCallingIdentity(); try { if (Secure.getIntForUser(cr, Secure.ACCESSIBILITY_DISPLAY_DALTONIZER_ENABLED, 0, userId) != 0) { daltonizerMode = Secure.getIntForUser(cr, Secure.ACCESSIBILITY_DISPLAY_DALTONIZER, DEFAULT_DISPLAY_DALTONIZER, userId); } } finally { Binder.restoreCallingIdentity(identity); } float[] grayscaleMatrix = null; if (daltonizerMode == AccessibilityManager.DALTONIZER_SIMULATE_MONOCHROMACY) { Loading @@ -83,9 +89,14 @@ class DisplayAdjustmentUtils { final ContentResolver cr = context.getContentResolver(); final DisplayTransformManager dtm = LocalServices.getService(DisplayTransformManager.class); long identity = Binder.clearCallingIdentity(); try { final boolean invertColors = Secure.getIntForUser(cr, Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED, 0, userId) != 0; dtm.setColorMatrix(DisplayTransformManager.LEVEL_COLOR_MATRIX_INVERT_COLOR, invertColors ? MATRIX_INVERT_COLOR : null); } finally { Binder.restoreCallingIdentity(identity); } } }