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

Commit 709c542b authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Fixing crash in emulator due to missing bluetooth." into jb-mr1-dev

parents 73e0d75c 6072b00b
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) {