Fix permission accessing getCurrentUser
Bug: 7174737 Change-Id: I0a6a9a46f4115743d16ada401cd67e3cf30fb380
This commit is contained in:
@@ -836,7 +836,11 @@ public class WifiService extends IWifiManager.Stub {
|
||||
*/
|
||||
public List<ScanResult> getScanResults() {
|
||||
enforceAccessPermission();
|
||||
if (UserHandle.getCallingUserId() != ActivityManager.getCurrentUser()) {
|
||||
int userId = UserHandle.getCallingUserId();
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
int currentUser = ActivityManager.getCurrentUser();
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
if (userId != currentUser) {
|
||||
return new ArrayList<ScanResult>();
|
||||
} else {
|
||||
return mWifiStateMachine.syncGetScanResultsList();
|
||||
|
||||
Reference in New Issue
Block a user