Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db831da4 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Fix permission accessing getCurrentUser

Bug: 7174737
Change-Id: I0a6a9a46f4115743d16ada401cd67e3cf30fb380
parent 61e8180b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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();