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

Commit bdca2885 authored by William Escande's avatar William Escande
Browse files

InCallService: profile listener is final

Having a non-final potentially nullable listener is not recommended as
this would lead to silent failure in the registration

Bug: 330247213
Test: atest BluetoothInstrumentationTests:BluetoothInCallServiceTests
Flag: Exempt refactor
Change-Id: I175affe19378c4c85dabf3d4218e31d20eacd2d9
parent e46715ff
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -148,12 +148,7 @@ public class BluetoothInCallService extends InCallService {

    private BluetoothAdapter mAdapter = null;

    /**
     * Listens to connections and disconnections of bluetooth headsets. We need to save the current
     * bluetooth headset so that we know where to send BluetoothCall updates.
     */
    @VisibleForTesting
    public BluetoothProfile.ServiceListener mProfileListener =
    private final BluetoothProfile.ServiceListener mProfileListener =
            new BluetoothProfile.ServiceListener() {
                @Override
                public void onServiceConnected(int profile, BluetoothProfile proxy) {
@@ -779,7 +774,6 @@ public class BluetoothInCallService extends InCallService {
            mBluetoothLeCallControl.unregisterBearer();
            mBluetoothLeCallControl.closeBluetoothLeCallControlProxy(mAdapter);
        }
        mProfileListener = null;
        sInstance = null;
        mCallbacks.clear();
        mBluetoothCallHashMap.clear();