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

Commit 89c82814 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Add restoreCallingIdentity under finally" into jb-mr1-dev

parents 8406d05b 3d33a633
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);
        }
    }

    /**