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

Commit 8f9c3ccb authored by ryanywlin's avatar ryanywlin Committed by android-build-merger
Browse files

2nd attempt handle BT is not supported on emulator

am: 59287d40

Change-Id: I8c9d2a14dc85d45633a6b7d54ff6e6577b0739b4
parents adc04c06 59287d40
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -170,12 +170,20 @@ public abstract class AudioSwitchPreferenceController extends BasePreferenceCont

    @Override
    public void onStart() {
        if (mLocalBluetoothManager == null) {
            Log.e(TAG, "Bluetooth is not supported on this device");
            return;
        }
        mLocalBluetoothManager.setForegroundActivity(mContext);
        register();
    }

    @Override
    public void onStop() {
        if (mLocalBluetoothManager == null) {
            Log.e(TAG, "Bluetooth is not supported on this device");
            return;
        }
        mLocalBluetoothManager.setForegroundActivity(null);
        unregister();
    }
+2 −0
Original line number Diff line number Diff line
@@ -186,6 +186,8 @@ public class AudioOutputSwitchPreferenceControllerTest {

        AudioSwitchPreferenceController controller = new AudioSwitchPreferenceControllerTestable(
                mContext, TEST_KEY);
        controller.onStart();
        controller.onStop();

        assertThat(mLocalBluetoothManager).isNull();
    }