Skip to content

Commit b2a7d27

Browse files
committed
make bluetooth iconography consistent with other quicksettings icons.
Bug: 7217026 Change-Id: I880ee26e1d92ffa49885cf53b8dbab6b13887423
1 parent 9c022df commit b2a7d27

File tree

11 files changed

+34
-6
lines changed

11 files changed

+34
-6
lines changed
1.9 KB
Loading
250 Bytes
Loading
9 Bytes
Loading
1.27 KB
Loading
119 Bytes
Loading
25 Bytes
Loading
2.67 KB
Loading
354 Bytes
Loading
33 Bytes
Loading

packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import android.app.AlertDialog;
2121
import android.app.Dialog;
2222
import android.app.PendingIntent;
23+
import android.bluetooth.BluetoothAdapter;
2324
import android.content.BroadcastReceiver;
2425
import android.content.ComponentName;
2526
import android.content.Context;
@@ -81,6 +82,7 @@ class QuickSettings {
8182
private DisplayManager mDisplayManager;
8283
private WifiDisplayStatus mWifiDisplayStatus;
8384
private PhoneStatusBar mStatusBarService;
85+
private QuickSettingsModel.BluetoothState mBluetoothState;
8486

8587
private BrightnessController mBrightnessController;
8688
private BluetoothController mBluetoothController;
@@ -115,6 +117,7 @@ public QuickSettings(Context context, QuickSettingsContainerView container) {
115117
mContainerView = container;
116118
mModel = new QuickSettingsModel(context);
117119
mWifiDisplayStatus = new WifiDisplayStatus();
120+
mBluetoothState = new QuickSettingsModel.BluetoothState();
118121
mHandler = new Handler();
119122

120123
Resources r = mContext.getResources();
@@ -128,6 +131,7 @@ public QuickSettings(Context context, QuickSettingsContainerView container) {
128131

129132
IntentFilter filter = new IntentFilter();
130133
filter.addAction(DisplayManager.ACTION_WIFI_DISPLAY_STATUS_CHANGED);
134+
filter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
131135
mContext.registerReceiver(mReceiver, filter);
132136
}
133137

@@ -738,6 +742,10 @@ private void applyWifiDisplayStatus() {
738742
mModel.onWifiDisplayStateChanged(mWifiDisplayStatus);
739743
}
740744

745+
private void applyBluetoothStatus() {
746+
mModel.onBluetoothStateChange(mBluetoothState);
747+
}
748+
741749
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
742750
@Override
743751
public void onReceive(Context context, Intent intent) {
@@ -747,6 +755,12 @@ public void onReceive(Context context, Intent intent) {
747755
mWifiDisplayStatus = status;
748756
applyWifiDisplayStatus();
749757
}
758+
if (intent.getAction().equals(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED)) {
759+
int status = intent.getIntExtra(BluetoothAdapter.EXTRA_CONNECTION_STATE,
760+
BluetoothAdapter.STATE_DISCONNECTED);
761+
mBluetoothState.connected = (status == BluetoothAdapter.STATE_CONNECTED);
762+
applyBluetoothStatus();
763+
}
750764
}
751765
};
752766
}

0 commit comments

Comments
 (0)