Loading core/java/android/app/UiAutomationConnection.java +5 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; import android.view.IWindowManager; import android.view.InputEvent; import android.view.SurfaceControl; Loading Loading @@ -167,9 +168,10 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { throwIfShutdownLocked(); throwIfNotConnectedLocked(); } int callingUserId = UserHandle.getCallingUserId(); final long identity = Binder.clearCallingIdentity(); try { IBinder token = mAccessibilityManager.getWindowToken(windowId); IBinder token = mAccessibilityManager.getWindowToken(windowId, callingUserId); if (token == null) { return false; } Loading @@ -186,9 +188,10 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { throwIfShutdownLocked(); throwIfNotConnectedLocked(); } int callingUserId = UserHandle.getCallingUserId(); final long identity = Binder.clearCallingIdentity(); try { IBinder token = mAccessibilityManager.getWindowToken(windowId); IBinder token = mAccessibilityManager.getWindowToken(windowId, callingUserId); if (token == null) { return null; } Loading core/java/android/view/accessibility/IAccessibilityManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -58,5 +58,5 @@ interface IAccessibilityManager { void temporaryEnableAccessibilityStateUntilKeyguardRemoved(in ComponentName service, boolean touchExplorationEnabled); IBinder getWindowToken(int windowId); IBinder getWindowToken(int windowId, int userId); } services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +2 −3 Original line number Diff line number Diff line Loading @@ -715,7 +715,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } @Override public IBinder getWindowToken(int windowId) { public IBinder getWindowToken(int windowId, int userId) { mSecurityPolicy.enforceCallingPermission( Manifest.permission.RETRIEVE_WINDOW_TOKEN, GET_WINDOW_TOKEN); Loading @@ -724,8 +724,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.getCallingUserId()); .resolveCallingUserIdEnforcingPermissionsLocked(userId); if (resolvedUserId != mCurrentUserId) { return null; } Loading Loading
core/java/android/app/UiAutomationConnection.java +5 −2 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; import android.view.IWindowManager; import android.view.InputEvent; import android.view.SurfaceControl; Loading Loading @@ -167,9 +168,10 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { throwIfShutdownLocked(); throwIfNotConnectedLocked(); } int callingUserId = UserHandle.getCallingUserId(); final long identity = Binder.clearCallingIdentity(); try { IBinder token = mAccessibilityManager.getWindowToken(windowId); IBinder token = mAccessibilityManager.getWindowToken(windowId, callingUserId); if (token == null) { return false; } Loading @@ -186,9 +188,10 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { throwIfShutdownLocked(); throwIfNotConnectedLocked(); } int callingUserId = UserHandle.getCallingUserId(); final long identity = Binder.clearCallingIdentity(); try { IBinder token = mAccessibilityManager.getWindowToken(windowId); IBinder token = mAccessibilityManager.getWindowToken(windowId, callingUserId); if (token == null) { return null; } Loading
core/java/android/view/accessibility/IAccessibilityManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -58,5 +58,5 @@ interface IAccessibilityManager { void temporaryEnableAccessibilityStateUntilKeyguardRemoved(in ComponentName service, boolean touchExplorationEnabled); IBinder getWindowToken(int windowId); IBinder getWindowToken(int windowId, int userId); }
services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java +2 −3 Original line number Diff line number Diff line Loading @@ -715,7 +715,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { } @Override public IBinder getWindowToken(int windowId) { public IBinder getWindowToken(int windowId, int userId) { mSecurityPolicy.enforceCallingPermission( Manifest.permission.RETRIEVE_WINDOW_TOKEN, GET_WINDOW_TOKEN); Loading @@ -724,8 +724,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.getCallingUserId()); .resolveCallingUserIdEnforcingPermissionsLocked(userId); if (resolvedUserId != mCurrentUserId) { return null; } Loading