Move getUserSwitchability from UserManager to UserManagerService.

UserManager.getUserSwitchability was calling telecomManager.isInCall
method to see whether there is an ongoing phone call. Since the call
was made from client side, it was causing a SecurityException when
switcing users via adb command and breaking CtsMultiUserHostTestCases
tests. This CL moves all the logic from UserManager to
UserManagerService, and calls telecomManager.isInCall() with
Binder.clearCallingIdentity.

Bug: 257538981
Bug: 261505371
Fixes: 260184263
Test: atest CtsMultiUserHostTestCases
Merged-In: Idfca1fcb89688d08878b908ceed9c64f1e7091d3
Change-Id: Idfca1fcb89688d08878b908ceed9c64f1e7091d3
(cherry picked from commit 2f17ef912ee8cc321d54b08acb119d1ad641b756)
3 files changed