Loading packages/SystemUI/src/com/android/systemui/qs/QSDetail.java +3 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,9 @@ public class QSDetail extends LinearLayout { return; } mQsDetailHeaderSwitch.setChecked(state); final boolean toggleEnabled = mDetailAdapter != null && mDetailAdapter.getToggleEnabled(); mQsDetailHeader.setEnabled(toggleEnabled); mQsDetailHeaderSwitch.setEnabled(toggleEnabled); } private void handleScanStateChanged(boolean state) { Loading packages/SystemUI/src/com/android/systemui/qs/QSTile.java +3 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,9 @@ public abstract class QSTile<TState extends State> { public interface DetailAdapter { CharSequence getTitle(); Boolean getToggleState(); default boolean getToggleEnabled() { return true; } View createDetailView(Context context, View convertView, ViewGroup parent); Intent getSettingsIntent(); void setToggleState(boolean state); Loading packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.qs.tiles; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; Loading Loading @@ -207,6 +208,12 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> { return mState.value; } @Override public boolean getToggleEnabled() { return mController.getBluetoothState() == BluetoothAdapter.STATE_OFF || mController.getBluetoothState() == BluetoothAdapter.STATE_ON; } @Override public Intent getSettingsIntent() { return BLUETOOTH_SETTINGS; Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java +3 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,9 @@ public interface BluetoothController { boolean isBluetoothSupported(); boolean isBluetoothEnabled(); int getBluetoothState(); boolean isBluetoothConnected(); boolean isBluetoothConnecting(); String getLastDeviceName(); Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java +9 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa private CachedBluetoothDevice mLastDevice; private final H mHandler = new H(); private int mState; public BluetoothControllerImpl(Context context, Looper bgLooper) { mLocalBluetoothManager = LocalBluetoothManager.getInstance(context, null); Loading Loading @@ -119,6 +120,11 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa return mEnabled; } @Override public int getBluetoothState() { return mState; } @Override public boolean isBluetoothConnected() { return mConnectionState == BluetoothAdapter.STATE_CONNECTED; Loading Loading @@ -192,7 +198,9 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa @Override public void onBluetoothStateChanged(int bluetoothState) { mEnabled = bluetoothState == BluetoothAdapter.STATE_ON; mEnabled = bluetoothState == BluetoothAdapter.STATE_ON || bluetoothState == BluetoothAdapter.STATE_TURNING_ON; mState = bluetoothState; mHandler.sendEmptyMessage(H.MSG_STATE_CHANGED); } Loading Loading
packages/SystemUI/src/com/android/systemui/qs/QSDetail.java +3 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,9 @@ public class QSDetail extends LinearLayout { return; } mQsDetailHeaderSwitch.setChecked(state); final boolean toggleEnabled = mDetailAdapter != null && mDetailAdapter.getToggleEnabled(); mQsDetailHeader.setEnabled(toggleEnabled); mQsDetailHeaderSwitch.setEnabled(toggleEnabled); } private void handleScanStateChanged(boolean state) { Loading
packages/SystemUI/src/com/android/systemui/qs/QSTile.java +3 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,9 @@ public abstract class QSTile<TState extends State> { public interface DetailAdapter { CharSequence getTitle(); Boolean getToggleState(); default boolean getToggleEnabled() { return true; } View createDetailView(Context context, View convertView, ViewGroup parent); Intent getSettingsIntent(); void setToggleState(boolean state); Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +7 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.qs.tiles; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; Loading Loading @@ -207,6 +208,12 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> { return mState.value; } @Override public boolean getToggleEnabled() { return mController.getBluetoothState() == BluetoothAdapter.STATE_OFF || mController.getBluetoothState() == BluetoothAdapter.STATE_ON; } @Override public Intent getSettingsIntent() { return BLUETOOTH_SETTINGS; Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothController.java +3 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,9 @@ public interface BluetoothController { boolean isBluetoothSupported(); boolean isBluetoothEnabled(); int getBluetoothState(); boolean isBluetoothConnected(); boolean isBluetoothConnecting(); String getLastDeviceName(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java +9 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa private CachedBluetoothDevice mLastDevice; private final H mHandler = new H(); private int mState; public BluetoothControllerImpl(Context context, Looper bgLooper) { mLocalBluetoothManager = LocalBluetoothManager.getInstance(context, null); Loading Loading @@ -119,6 +120,11 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa return mEnabled; } @Override public int getBluetoothState() { return mState; } @Override public boolean isBluetoothConnected() { return mConnectionState == BluetoothAdapter.STATE_CONNECTED; Loading Loading @@ -192,7 +198,9 @@ public class BluetoothControllerImpl implements BluetoothController, BluetoothCa @Override public void onBluetoothStateChanged(int bluetoothState) { mEnabled = bluetoothState == BluetoothAdapter.STATE_ON; mEnabled = bluetoothState == BluetoothAdapter.STATE_ON || bluetoothState == BluetoothAdapter.STATE_TURNING_ON; mState = bluetoothState; mHandler.sendEmptyMessage(H.MSG_STATE_CHANGED); } Loading