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

Commit 52b69293 authored by Haijie Hong's avatar Haijie Hong
Browse files

Catch IllegalArgumentException when unregister callback

BUG: 359585188
Test: local test
Flag: EXEMPT minor fix
Change-Id: Ie2e485b922b2bf1163d47c14040e6e3d48f55f86
parent 4cffde01
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -255,8 +255,17 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment
    public void onDetach() {
        super.onDetach();
        mManager.getEventManager().unregisterCallback(mBluetoothCallback);
        BluetoothDevice device = mCachedDevice.getDevice();
        try {
            mBluetoothAdapter.removeOnMetadataChangedListener(
                mCachedDevice.getDevice(), mExtraControlMetadataListener);
                    device, mExtraControlMetadataListener);
        } catch (IllegalArgumentException e) {
            Log.w(
                    TAG,
                    "Unable to unregister metadata change callback for "
                            + mCachedDevice,
                    e);
        }
    }

    private void updateExtraControlUri(int viewWidth) {