summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2014-06-05 09:55:37 -0400
committerJohn Spurlock <jspurlock@google.com>2014-06-05 23:20:15 -0400
commita625b7412069342c30e9f964ce9abc969bf097b4 (patch)
treea5ee329d3d1473a8b6c7c7aa114feea75008a6c1
parent1c121e124ab25b14242c80c99e55cc9089fcc457 (diff)
downloadframeworks_base-a625b7412069342c30e9f964ce9abc969bf097b4.zip
frameworks_base-a625b7412069342c30e9f964ce9abc969bf097b4.tar.gz
frameworks_base-a625b7412069342c30e9f964ce9abc969bf097b4.tar.bz2
QuickSettings: Bluetooth updates.
- Use "Bluetooth" string when connecting. - Use @hidden device alias (instead of name) for label. - Use the same icon in the status bar. Bug:15186962 Change-Id: I25613bebf069c91e76d6933f2512b3f0a8020474
-rw-r--r--packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.pngbin940 -> 0 bytes
-rw-r--r--packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.pngbin979 -> 0 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.pngbin654 -> 0 bytes
-rw-r--r--packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.pngbin687 -> 0 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth.pngbin1260 -> 0 bytes
-rw-r--r--packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth_connected.pngbin1330 -> 0 bytes
-rw-r--r--packages/SystemUI/res/drawable-xxhdpi/stat_sys_data_bluetooth.pngbin2243 -> 0 bytes
-rw-r--r--packages/SystemUI/res/drawable-xxhdpi/stat_sys_data_bluetooth_connected.pngbin2150 -> 0 bytes
-rw-r--r--packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml28
-rw-r--r--packages/SystemUI/res/drawable/stat_sys_data_bluetooth_connected.xml28
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java8
12 files changed, 63 insertions, 3 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png
deleted file mode 100644
index 7ed4c78..0000000
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png
deleted file mode 100644
index 08c07b2..0000000
--- a/packages/SystemUI/res/drawable-hdpi/stat_sys_data_bluetooth_connected.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png
deleted file mode 100644
index bd4e1ae..0000000
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png
deleted file mode 100644
index e82c6e4..0000000
--- a/packages/SystemUI/res/drawable-mdpi/stat_sys_data_bluetooth_connected.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth.png
deleted file mode 100644
index 757dbf3..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth_connected.png b/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth_connected.png
deleted file mode 100644
index d431dc2..0000000
--- a/packages/SystemUI/res/drawable-xhdpi/stat_sys_data_bluetooth_connected.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/stat_sys_data_bluetooth.png b/packages/SystemUI/res/drawable-xxhdpi/stat_sys_data_bluetooth.png
deleted file mode 100644
index 17ffdb9..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/stat_sys_data_bluetooth.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable-xxhdpi/stat_sys_data_bluetooth_connected.png b/packages/SystemUI/res/drawable-xxhdpi/stat_sys_data_bluetooth_connected.png
deleted file mode 100644
index 6ec234e..0000000
--- a/packages/SystemUI/res/drawable-xxhdpi/stat_sys_data_bluetooth_connected.png
+++ /dev/null
Binary files differ
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml b/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml
new file mode 100644
index 0000000..e28490b
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_data_bluetooth.xml
@@ -0,0 +1,28 @@
+<!--
+Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android" >
+ <size
+ android:width="18dp"
+ android:height="18dp"/>
+
+ <viewport
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0"/>
+
+ <path
+ android:fill="#FFFFFFFF"
+ android:pathData="M35.4,15.4L24.0,4.0l-2.0,0.0l0.0,15.2L12.8,10.0L10.0,12.8L21.2,24.0L10.0,35.2l2.8,2.8l9.2,-9.2L22.0,44.0l2.0,0.0l11.4,-11.4L26.8,24.0L35.4,15.4zM26.0,11.7l3.8,3.8L26.0,19.2L26.0,11.7zM29.8,32.6L26.0,36.3l0.0,-7.5L29.8,32.6z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/stat_sys_data_bluetooth_connected.xml b/packages/SystemUI/res/drawable/stat_sys_data_bluetooth_connected.xml
new file mode 100644
index 0000000..c012d14
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_data_bluetooth_connected.xml
@@ -0,0 +1,28 @@
+<!--
+Copyright (C) 2014 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android" >
+ <size
+ android:width="18dp"
+ android:height="18dp"/>
+
+ <viewport
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0"/>
+
+ <path
+ android:fill="#FFFFFFFF"
+ android:pathData="M14.0,24.0l-4.0,-4.0l-4.0,4.0l4.0,4.0L14.0,24.0zM35.4,15.4L24.0,4.0l-2.0,0.0l0.0,15.2L12.8,10.0L10.0,12.8L21.2,24.0L10.0,35.2l2.8,2.8l9.2,-9.2L22.0,44.0l2.0,0.0l11.4,-11.4L26.8,24.0L35.4,15.4zM26.0,11.7l3.8,3.8L26.0,19.2L26.0,11.7zM29.8,32.6L26.0,36.3l0.0,-7.5L29.8,32.6zM38.0,20.0l-4.0,4.0l4.0,4.0l4.0,-4.0L38.0,20.0z"/>
+</vector>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
index 20ed629..7431e69 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
@@ -84,7 +84,7 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> {
} else if (connecting) {
state.iconId = R.drawable.ic_qs_bluetooth_connecting;
stateContentDescription = mContext.getString(R.string.accessibility_desc_connecting);
- state.label = mController.getLastDeviceName();
+ state.label = mContext.getString(R.string.quick_settings_bluetooth_label);
} else {
state.iconId = R.drawable.ic_qs_bluetooth_on;
stateContentDescription = mContext.getString(R.string.accessibility_desc_on);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
index 117bf61..379b509 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/BluetoothControllerImpl.java
@@ -45,6 +45,7 @@ public class BluetoothControllerImpl extends BroadcastReceiver implements Blueto
filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
filter.addAction(BluetoothAdapter.ACTION_CONNECTION_STATE_CHANGED);
filter.addAction(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
+ filter.addAction(BluetoothDevice.ACTION_ALIAS_CHANGED);
context.registerReceiver(this, filter);
final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
@@ -104,8 +105,8 @@ public class BluetoothControllerImpl extends BroadcastReceiver implements Blueto
@Override
public String getLastDeviceName() {
- return mLastDevice != null ? mLastDevice.getName()
- : mBondedDevices.size() == 1 ? mBondedDevices.iterator().next().getName()
+ return mLastDevice != null ? mLastDevice.getAliasName()
+ : mBondedDevices.size() == 1 ? mBondedDevices.iterator().next().getAliasName()
: null;
}
@@ -122,6 +123,9 @@ public class BluetoothControllerImpl extends BroadcastReceiver implements Blueto
== BluetoothAdapter.STATE_CONNECTING;
mLastDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
}
+ if (action.equals(BluetoothDevice.ACTION_ALIAS_CHANGED)) {
+ mLastDevice = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
+ }
fireCallbacks();
updateBondedBluetoothDevices();
}