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

Commit 3d33a633 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Add restoreCallingIdentity under finally

Change-Id: I068b1a2fc93300aa9bd17da6933bc8c5f0a6b5e4
parent db831da4
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -640,8 +640,11 @@ public class WifiService extends IWifiManager.Stub {
         */

        long ident = Binder.clearCallingIdentity();
        try {
            handleWifiToggled(enable);
        } finally {
            Binder.restoreCallingIdentity(ident);
        }

        if (enable) {
            if (!mIsReceiverRegistered) {
@@ -838,13 +841,16 @@ public class WifiService extends IWifiManager.Stub {
        enforceAccessPermission();
        int userId = UserHandle.getCallingUserId();
        long ident = Binder.clearCallingIdentity();
        try {
            int currentUser = ActivityManager.getCurrentUser();
        Binder.restoreCallingIdentity(ident);
            if (userId != currentUser) {
                return new ArrayList<ScanResult>();
            } else {
                return mWifiStateMachine.syncGetScanResultsList();
            }
        } finally {
            Binder.restoreCallingIdentity(ident);
        }
    }

    /**