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

Commit 6072b00b authored by Winson Chung's avatar Winson Chung
Browse files

Fixing crash in emulator due to missing bluetooth.

Change-Id: I0f652198cc759fac44f0de1729fcb52f515071a3
parent db425bbb
Loading
Loading
Loading
Loading
+20 −19
Original line number Diff line number Diff line
@@ -167,10 +167,9 @@ class QuickSettings {
        startSettingsActivity(intent);
    }
    private void startSettingsActivity(Intent intent) {
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        mBar.collapseAllPanels(true);
        mContext.startActivity(intent);

    }

    private void addUserTiles(ViewGroup parent, LayoutInflater inflater) {
@@ -310,6 +309,7 @@ class QuickSettings {
        parent.addView(airplaneTile);

        // Bluetooth
        if (mModel.deviceSupportsBluetooth()) {
            QuickSettingsTileView bluetoothTile = (QuickSettingsTileView)
                    inflater.inflate(R.layout.quick_settings_tile, parent, false);
            bluetoothTile.setContent(R.layout.quick_settings_tile_bluetooth, inflater);
@@ -327,6 +327,7 @@ class QuickSettings {
                }
            });
            parent.addView(bluetoothTile);
        }

        // Brightness
        QuickSettingsTileView brightnessTile = (QuickSettingsTileView)
+3 −0
Original line number Diff line number Diff line
@@ -258,6 +258,9 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
        final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
        onBluetoothStateChange(adapter.isEnabled());
    }
    boolean deviceSupportsBluetooth() {
        return (BluetoothAdapter.getDefaultAdapter() != null);
    }
    // BluetoothController callback
    @Override
    public void onBluetoothStateChange(boolean on) {