File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
services/java/com/android/server Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -640,8 +640,11 @@ public synchronized boolean setWifiEnabled(boolean enable) {
640640 */
641641
642642 long ident = Binder .clearCallingIdentity ();
643- handleWifiToggled (enable );
644- Binder .restoreCallingIdentity (ident );
643+ try {
644+ handleWifiToggled (enable );
645+ } finally {
646+ Binder .restoreCallingIdentity (ident );
647+ }
645648
646649 if (enable ) {
647650 if (!mIsReceiverRegistered ) {
@@ -838,12 +841,15 @@ public List<ScanResult> getScanResults() {
838841 enforceAccessPermission ();
839842 int userId = UserHandle .getCallingUserId ();
840843 long ident = Binder .clearCallingIdentity ();
841- int currentUser = ActivityManager .getCurrentUser ();
842- Binder .restoreCallingIdentity (ident );
843- if (userId != currentUser ) {
844- return new ArrayList <ScanResult >();
845- } else {
846- return mWifiStateMachine .syncGetScanResultsList ();
844+ try {
845+ int currentUser = ActivityManager .getCurrentUser ();
846+ if (userId != currentUser ) {
847+ return new ArrayList <ScanResult >();
848+ } else {
849+ return mWifiStateMachine .syncGetScanResultsList ();
850+ }
851+ } finally {
852+ Binder .restoreCallingIdentity (ident );
847853 }
848854 }
849855
You can’t perform that action at this time.
0 commit comments