Loading packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +20 −12 Original line number Diff line number Diff line Loading @@ -131,21 +131,10 @@ public class BluetoothTile extends QSTileImpl<BooleanState> { if (enabled) { if (connected) { state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_connected); state.icon = new BluetoothConnectedTileIcon(); state.contentDescription = mContext.getString( R.string.accessibility_bluetooth_name, state.label); final CachedBluetoothDevice lastDevice = mController.getLastDevice(); if (lastDevice != null) { final int batteryLevel = lastDevice.getBatteryLevel(); if (batteryLevel != BluetoothDevice.BATTERY_LEVEL_UNKNOWN) { state.icon = new BluetoothBatteryTileIcon( batteryLevel, mContext.getResources().getFraction( R.fraction.bt_battery_scale_fraction, 1, 1)); } } state.label = mController.getLastDeviceName(); } else if (state.isTransient) { state.icon = ResourceIcon.get(R.drawable.ic_bluetooth_transient_animation); Loading Loading @@ -281,6 +270,25 @@ public class BluetoothTile extends QSTileImpl<BooleanState> { } } /** * Bluetooth icon wrapper (when connected with no battery indicator) for Quick Settings. This is * used instead of {@link com.android.systemui.qs.tileimpl.QSTileImpl.DrawableIcon} in order to * use a context that reflects dark/light theme attributes. */ private class BluetoothConnectedTileIcon extends Icon { BluetoothConnectedTileIcon() { // Do nothing. Default constructor to limit visibility. } @Override public Drawable getDrawable(Context context) { // This method returns Pair<Drawable, String> - the first value is the drawable. return context.getDrawable(R.drawable.ic_qs_bluetooth_connected); } } protected class BluetoothDetailAdapter implements DetailAdapter, QSDetailItems.Callback { // We probably won't ever have space in the UI for more than 20 devices, so don't // get info for them. Loading Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +20 −12 Original line number Diff line number Diff line Loading @@ -131,21 +131,10 @@ public class BluetoothTile extends QSTileImpl<BooleanState> { if (enabled) { if (connected) { state.icon = ResourceIcon.get(R.drawable.ic_qs_bluetooth_connected); state.icon = new BluetoothConnectedTileIcon(); state.contentDescription = mContext.getString( R.string.accessibility_bluetooth_name, state.label); final CachedBluetoothDevice lastDevice = mController.getLastDevice(); if (lastDevice != null) { final int batteryLevel = lastDevice.getBatteryLevel(); if (batteryLevel != BluetoothDevice.BATTERY_LEVEL_UNKNOWN) { state.icon = new BluetoothBatteryTileIcon( batteryLevel, mContext.getResources().getFraction( R.fraction.bt_battery_scale_fraction, 1, 1)); } } state.label = mController.getLastDeviceName(); } else if (state.isTransient) { state.icon = ResourceIcon.get(R.drawable.ic_bluetooth_transient_animation); Loading Loading @@ -281,6 +270,25 @@ public class BluetoothTile extends QSTileImpl<BooleanState> { } } /** * Bluetooth icon wrapper (when connected with no battery indicator) for Quick Settings. This is * used instead of {@link com.android.systemui.qs.tileimpl.QSTileImpl.DrawableIcon} in order to * use a context that reflects dark/light theme attributes. */ private class BluetoothConnectedTileIcon extends Icon { BluetoothConnectedTileIcon() { // Do nothing. Default constructor to limit visibility. } @Override public Drawable getDrawable(Context context) { // This method returns Pair<Drawable, String> - the first value is the drawable. return context.getDrawable(R.drawable.ic_qs_bluetooth_connected); } } protected class BluetoothDetailAdapter implements DetailAdapter, QSDetailItems.Callback { // We probably won't ever have space in the UI for more than 20 devices, so don't // get info for them. Loading