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

Commit b7de86ec authored by Chienyuan's avatar Chienyuan
Browse files

BluetoothManagerService: catch NoSuchElementException for unlinkToDeath

linkToDeath fail will cause NoSuchElementException when following
unlinkToDeath, add try catch to handle it.

Bug: 121104808
Test: build pass
Change-Id: I2f3337ad417567ea3b4dea3eb004c60f96527c41
parent fe1ee419
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ import java.util.HashMap;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantReadWriteLock;

@@ -1259,7 +1260,11 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
            if (mService == null) {
                return;
            }
            try {
                mService.unlinkToDeath(this, 0);
            } catch (NoSuchElementException e) {
                Log.e(TAG, "error unlinking to death", e);
            }
            mService = null;
            mClassName = null;