SysUI Tuner: Status bar work
Improve general status bar goodness, more exactness, less breakage.
Extra extra icons, disabled by default.
Control all the status bar things!
Probably other stuff (10000).
Change-Id: I5d6282a4dcbcefea9f0880042cdf6293cb693712
diff --git a/packages/SystemUI/res/drawable/ic_headset.xml b/packages/SystemUI/res/drawable/ic_headset.xml
new file mode 100644
index 0000000..58759f9
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_headset.xml
@@ -0,0 +1,28 @@
+<!--
+ Copyright (C) 2016 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.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:width="17.0dp"
+ android:height="17.0dp"
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M24.0,2.0C14.06,2.0 6.0,10.06 6.0,20.0l0.0,14.0c0.0,3.31 2.69,6.0 6.0,6.0l6.0,0.0L18.0,24.0l-8.0,0.0l0.0,-4.0c0.0,-7.73 6.27,-14.0 14.0,-14.0s14.0,6.27 14.0,14.0l0.0,4.0l-8.0,0.0l0.0,16.0l6.0,0.0c3.31,0.0 6.0,-2.69 6.0,-6.0L42.0,20.0c0.0,-9.94 -8.06,-18.0 -18.0,-18.0z"/>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/drawable/ic_headset_mic.xml b/packages/SystemUI/res/drawable/ic_headset_mic.xml
new file mode 100644
index 0000000..5d02120
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_headset_mic.xml
@@ -0,0 +1,28 @@
+<!--
+ Copyright (C) 2016 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.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:width="17.0dp"
+ android:height="17.0dp"
+ android:viewportWidth="48.0"
+ android:viewportHeight="48.0">
+ <path
+ android:fillColor="#FFFFFFFF"
+ android:pathData="M24.0,2.0C14.06,2.0 6.0,10.06 6.0,20.0l0.0,14.0c0.0,3.31 2.69,6.0 6.0,6.0l6.0,0.0L18.0,24.0l-8.0,0.0l0.0,-4.0c0.0,-7.73 6.27,-14.0 14.0,-14.0s14.0,6.27 14.0,14.0l0.0,4.0l-8.0,0.0l0.0,16.0l8.0,0.0l0.0,2.0L24.0,42.0l0.0,4.0l12.0,0.0c3.31,0.0 6.0,-2.69 6.0,-6.0L42.0,20.0c0.0,-9.94 -8.06,-18.0 -18.0,-18.0z"/>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/drawable/stat_sys_auto_rotate_landscape.xml b/packages/SystemUI/res/drawable/stat_sys_auto_rotate_landscape.xml
new file mode 100644
index 0000000..ba0709e
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_auto_rotate_landscape.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 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.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:height="17dp"
+ android:width="17dp"
+ android:viewportHeight="48"
+ android:viewportWidth="48" >
+ <group
+ android:name="ic_screen_rotation_48px_outlines"
+ android:translateX="24"
+ android:translateY="24" >
+ <group
+ android:name="ic_screen_rotation_48px_outlines_pivot"
+ android:translateX="-24.15"
+ android:translateY="-24.25" >
+ <group
+ android:name="arrows"
+ android:translateX="24.1"
+ android:translateY="24.1" >
+ <group
+ android:name="arrows_pivot"
+ android:translateX="-24.1"
+ android:translateY="-24.1" >
+ <path
+ android:name="arrow_top"
+ android:pathData="M 33.1499938965,5.25 c 6.5,3.10000610352 11.1999969482,9.40000915527 11.8999938965,17.0 c 0.0,0.0 3.00001525879,0.0 3.00001525879,0.0 c -1.00001525879,-12.3000030518 -11.3000030518,-22.0 -23.9000091553,-22.0 c -0.399993896484,0.0 -0.899993896484,0.0 -1.30000305176,0.100006103516 c 0.0,0.0 7.60000610352,7.59999084473 7.60000610352,7.59999084473 c 0.0,0.0 2.69999694824,-2.69999694824 2.69999694824,-2.69999694824 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="1" />
+ <path
+ android:name="arrow_bottom"
+ android:pathData="M 15.1499938965,43.25 c -6.5,-3.09999084473 -11.1999969482,-9.5 -11.8999938965,-17.0 c 0.0,0.0 -3.0,0.0 -3.0,0.0 c 1.0,12.3000030518 11.299987793,22.0 23.8999938965,22.0 c 0.399993896484,0.0 0.899993896484,0.0 1.30000305176,-0.0999908447266 c 0.0,0.0 -7.60000610352,-7.60000610352 -7.60000610352,-7.60000610352 c 0.0,0.0 -2.69999694824,2.69999694824 -2.69999694824,2.69999694824 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="1" />
+ </group>
+ </group>
+ <group
+ android:name="device"
+ android:translateX="24.14999"
+ android:translateY="24.25" >
+ <path
+ android:name="body"
+ android:pathData="M -3.5,-20.5 c -1.19999694824,-1.19999694824 -3.10000610352,-1.19999694824 -4.19999694824,0.0 c 0.0,0.0 -12.8000030518,12.6999969482 -12.8000030518,12.6999969482 c -1.19999694824,1.19999694824 -1.19999694824,3.10000610352 0.0,4.19999694824 c 0.0,0.0 24.0,24.0000152588 24.0,24.0000152588 c 1.19999694824,1.19999694824 3.10000610352,1.19999694824 4.19999694824,0.0 c 0.0,0.0 12.6999969482,-12.700012207 12.6999969482,-12.700012207 c 1.20001220703,-1.19999694824 1.20001220703,-3.09999084473 0.0,-4.19999694824 c 0.0,0.0 -23.8999938965,-24.0 -23.8999938965,-24.0 Z M 2.84999084473,15.5500183105 c 0.0,0.0 -18.6000061035,-18.5000457764 -18.6000061035,-18.5000457764 c 0.0,0.0 12.5999908447,-12.8000030518 12.5999908447,-12.8000030518 c 0.0,0.0 18.6000213623,18.5000457764 18.6000213623,18.5000457764 c 0.0,0.0 -12.6000061035,12.8000030518 -12.6000061035,12.8000030518 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="1" />
+ </group>
+ </group>
+ </group>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/drawable/stat_sys_auto_rotate_portrait.xml b/packages/SystemUI/res/drawable/stat_sys_auto_rotate_portrait.xml
new file mode 100644
index 0000000..46a1f35
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_auto_rotate_portrait.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 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.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:height="17dp"
+ android:width="17dp"
+ android:viewportHeight="48"
+ android:viewportWidth="48" >
+ <group
+ android:name="icon"
+ android:translateX="24"
+ android:translateY="24" >
+ <group
+ android:name="icon_pivot"
+ android:translateX="-24.15"
+ android:translateY="-24.25" >
+ <group
+ android:name="arrows"
+ android:translateX="24.1"
+ android:translateY="24.1" >
+ <group
+ android:name="arrows_pivot"
+ android:translateX="-24.1"
+ android:translateY="-24.1" >
+ <path
+ android:name="arrow_top"
+ android:pathData="M 33.1499938965,5.25 c 6.5,3.10000610352 11.1999969482,9.40000915527 11.8999938965,17.0 c 0.0,0.0 3.00001525879,0.0 3.00001525879,0.0 c -1.00001525879,-12.3000030518 -11.3000030518,-22.0 -23.9000091553,-22.0 c -0.399993896484,0.0 -0.899993896484,0.0 -1.30000305176,0.100006103516 c 0.0,0.0 7.60000610352,7.59999084473 7.60000610352,7.59999084473 c 0.0,0.0 2.69999694824,-2.69999694824 2.69999694824,-2.69999694824 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="1" />
+ <path
+ android:name="arrow_bottom"
+ android:pathData="M 15.1499938965,43.25 c -6.5,-3.09999084473 -11.1999969482,-9.5 -11.8999938965,-17.0 c 0.0,0.0 -3.0,0.0 -3.0,0.0 c 1.0,12.3000030518 11.299987793,22.0 23.8999938965,22.0 c 0.399993896484,0.0 0.899993896484,0.0 1.30000305176,-0.0999908447266 c 0.0,0.0 -7.60000610352,-7.60000610352 -7.60000610352,-7.60000610352 c 0.0,0.0 -2.69999694824,2.69999694824 -2.69999694824,2.69999694824 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="1" />
+ </group>
+ </group>
+ <group
+ android:name="device"
+ android:translateX="24.14999"
+ android:translateY="24.25" >
+ <path
+ android:name="device_1"
+ android:pathData="M -3.5,-20.5 c -1.19999694824,-1.19999694824 -3.10000610352,-1.19999694824 -4.19999694824,0.0 c 0.0,0.0 -12.8000030518,12.6999969482 -12.8000030518,12.6999969482 c -1.19999694824,1.19999694824 -1.19999694824,3.10000610352 0.0,4.19999694824 c 0.0,0.0 24.0,24.0000152588 24.0,24.0000152588 c 1.19999694824,1.19999694824 3.10000610352,1.19999694824 4.19999694824,0.0 c 0.0,0.0 12.6999969482,-12.700012207 12.6999969482,-12.700012207 c 1.20001220703,-1.19999694824 1.20001220703,-3.09999084473 0.0,-4.19999694824 c 0.0,0.0 -23.8999938965,-24.0 -23.8999938965,-24.0 Z M 2.84999084473,15.5500183105 c 0.0,0.0 -18.6000061035,-18.5000457764 -18.6000061035,-18.5000457764 c 0.0,0.0 12.5999908447,-12.8000030518 12.5999908447,-12.8000030518 c 0.0,0.0 18.6000213623,18.5000457764 18.6000213623,18.5000457764 c 0.0,0.0 -12.6000061035,12.8000030518 -12.6000061035,12.8000030518 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="1" />
+ </group>
+ </group>
+ </group>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/drawable/stat_sys_rotate_landscape.xml b/packages/SystemUI/res/drawable/stat_sys_rotate_landscape.xml
new file mode 100644
index 0000000..58ed7e6
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_rotate_landscape.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 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.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:height="17dp"
+ android:width="17dp"
+ android:viewportHeight="48"
+ android:viewportWidth="48" >
+ <group
+ android:name="ic_screen_rotation_48px_outlines"
+ android:translateX="24"
+ android:translateY="24" >
+ <group
+ android:name="ic_screen_rotation_48px_outlines_pivot"
+ android:translateX="-24.15"
+ android:translateY="-24.25" >
+ <group
+ android:name="arrows"
+ android:translateX="24.1"
+ android:translateY="24.1"
+ android:scaleX="0.9"
+ android:scaleY="0.9"
+ android:rotation="-135" >
+ <group
+ android:name="arrows_pivot"
+ android:translateX="-24.1"
+ android:translateY="-24.1" >
+ <path
+ android:name="arrow_top"
+ android:pathData="M 33.1499938965,5.25 c 6.5,3.10000610352 11.1999969482,9.40000915527 11.8999938965,17.0 c 0.0,0.0 3.00001525879,0.0 3.00001525879,0.0 c -1.00001525879,-12.3000030518 -11.3000030518,-22.0 -23.9000091553,-22.0 c -0.399993896484,0.0 -0.899993896484,0.0 -1.30000305176,0.100006103516 c 0.0,0.0 7.60000610352,7.59999084473 7.60000610352,7.59999084473 c 0.0,0.0 2.69999694824,-2.69999694824 2.69999694824,-2.69999694824 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="0" />
+ <path
+ android:name="arrow_bottom"
+ android:pathData="M 15.1499938965,43.25 c -6.5,-3.09999084473 -11.1999969482,-9.5 -11.8999938965,-17.0 c 0.0,0.0 -3.0,0.0 -3.0,0.0 c 1.0,12.3000030518 11.299987793,22.0 23.8999938965,22.0 c 0.399993896484,0.0 0.899993896484,0.0 1.30000305176,-0.0999908447266 c 0.0,0.0 -7.60000610352,-7.60000610352 -7.60000610352,-7.60000610352 c 0.0,0.0 -2.69999694824,2.69999694824 -2.69999694824,2.69999694824 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="0" />
+ </group>
+ </group>
+ <group
+ android:name="device"
+ android:translateX="24.14999"
+ android:translateY="24.25"
+ android:rotation="-45" >
+ <path
+ android:name="body"
+ android:pathData="M -3.34053039551,-22.9980926514 c -1.3207244873,-1.3207244873 -3.46876525879,-1.26383972168 -4.74829101563,0.125762939453 c 0.0,0.0 -14.8512420654,14.7411804199 -14.8512420654,14.7411804199 c -1.39259338379,1.392578125 -1.44947814941,3.54061889648 -0.125762939453,4.74827575684 c 0.0,0.0 26.4143981934,26.4144134521 26.4143981934,26.4144134521 c 1.3207244873,1.3207244873 3.46876525879,1.26382446289 4.74829101562,-0.125762939453 c 0.0,0.0 14.7381896973,-14.7381896973 14.7381896973,-14.7381896973 c 1.392578125,-1.39259338379 1.44947814941,-3.54061889648 0.125762939453,-4.74829101562 c 0.0,0.0 -26.3013458252,-26.417388916 -26.3013458252,-26.417388916 Z M 2.87156677246,16.9857940674 c 0.0,0.0 -19.7573547363,-19.7573699951 -19.7573547363,-19.7573699951 c 0.0,0.0 14.0142059326,-14.2142181396 14.0142059326,-14.2142181396 c 0.0,0.0 19.7573699951,19.7573699951 19.7573699951,19.7573699951 c 0.0,0.0 -14.0142211914,14.2142181396 -14.0142211914,14.2142181396 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="1" />
+ </group>
+ </group>
+ </group>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/drawable/stat_sys_rotate_portrait.xml b/packages/SystemUI/res/drawable/stat_sys_rotate_portrait.xml
new file mode 100644
index 0000000..b63ffe0
--- /dev/null
+++ b/packages/SystemUI/res/drawable/stat_sys_rotate_portrait.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2016 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.
+-->
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:insetLeft="2.5dp"
+ android:insetRight="2.5dp">
+ <vector
+ android:height="17dp"
+ android:width="17dp"
+ android:viewportHeight="48"
+ android:viewportWidth="48" >
+ <group
+ android:name="icon"
+ android:translateX="24"
+ android:translateY="24" >
+ <group
+ android:name="icon_pivot"
+ android:translateX="-24.15"
+ android:translateY="-24.25" >
+ <group
+ android:name="arrows"
+ android:translateX="24.1"
+ android:translateY="24.1"
+ android:scaleX="0.9"
+ android:scaleY="0.9"
+ android:rotation="-221" >
+ <group
+ android:name="arrows_pivot"
+ android:translateX="-24.1"
+ android:translateY="-24.1" >
+ <path
+ android:name="arrow_top"
+ android:pathData="M 33.1499938965,5.25 c 6.5,3.10000610352 11.1999969482,9.40000915527 11.8999938965,17.0 c 0.0,0.0 3.00001525879,0.0 3.00001525879,0.0 c -1.00001525879,-12.3000030518 -11.3000030518,-22.0 -23.9000091553,-22.0 c -0.399993896484,0.0 -0.899993896484,0.0 -1.30000305176,0.100006103516 c 0.0,0.0 7.60000610352,7.59999084473 7.60000610352,7.59999084473 c 0.0,0.0 2.69999694824,-2.69999694824 2.69999694824,-2.69999694824 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="0" />
+ <path
+ android:name="arrow_bottom"
+ android:pathData="M 15.1499938965,43.25 c -6.5,-3.09999084473 -11.1999969482,-9.5 -11.8999938965,-17.0 c 0.0,0.0 -3.0,0.0 -3.0,0.0 c 1.0,12.3000030518 11.299987793,22.0 23.8999938965,22.0 c 0.399993896484,0.0 0.899993896484,0.0 1.30000305176,-0.0999908447266 c 0.0,0.0 -7.60000610352,-7.60000610352 -7.60000610352,-7.60000610352 c 0.0,0.0 -2.69999694824,2.69999694824 -2.69999694824,2.69999694824 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="0" />
+ </group>
+ </group>
+ <group
+ android:name="device"
+ android:translateX="24.14999"
+ android:translateY="24.25"
+ android:rotation="-135" >
+ <path
+ android:name="device_1"
+ android:pathData="M -3.34053039551,-22.9980926514 c -1.3207244873,-1.3207244873 -3.46876525879,-1.26383972168 -4.74829101563,0.125762939453 c 0.0,0.0 -14.8512420654,14.7411804199 -14.8512420654,14.7411804199 c -1.39259338379,1.392578125 -1.44947814941,3.54061889648 -0.125762939453,4.74827575684 c 0.0,0.0 26.4143981934,26.4144134521 26.4143981934,26.4144134521 c 1.3207244873,1.3207244873 3.46876525879,1.26382446289 4.74829101562,-0.125762939453 c 0.0,0.0 14.7381896973,-14.7381896973 14.7381896973,-14.7381896973 c 1.392578125,-1.39259338379 1.44947814941,-3.54061889648 0.125762939453,-4.74829101562 c 0.0,0.0 -26.3013458252,-26.417388916 -26.3013458252,-26.417388916 Z M 2.87156677246,16.9857940674 c 0.0,0.0 -19.7573547363,-19.7573699951 -19.7573547363,-19.7573699951 c 0.0,0.0 14.0142059326,-14.2142181396 14.0142059326,-14.2142181396 c 0.0,0.0 19.7573699951,19.7573699951 19.7573699951,19.7573699951 c 0.0,0.0 -14.0142211914,14.2142181396 -14.0142211914,14.2142181396 Z"
+ android:fillColor="#FFFFFFFF"
+ android:fillAlpha="1" />
+ </group>
+ </group>
+ </group>
+ </vector>
+</inset>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index c39ea57..814e7ea 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -1315,4 +1315,22 @@
<!-- SysUI Tuner: Switch to control volume up behavior [CHAR LIMIT=60] -->
<string name="volume_up_silent">Exit do not disturb on volume up</string>
+ <!-- Name of the battery icon in status bar [CHAR LIMIT=30] -->
+ <string name="battery">Battery</string>
+
+ <!-- Name of the clock in status bar [CHAR LIMIT=30] -->
+ <string name="clock">Clock</string>
+
+ <!-- Name of the headset in status bar [CHAR LIMIT=30] -->
+ <string name="headset">Headset</string>
+
+ <!-- Accessibility description of headphones icon [CHAR LIMIT=NONE] -->
+ <string name="accessibility_status_bar_headphones">Headphones connected</string>
+
+ <!-- Accessibility description of headset icon [CHAR LIMIT=NONE] -->
+ <string name="accessibility_status_bar_headset">Headset connected</string>
+
+ <!-- Explanation of the status bar section of the tuner [CHAR LIMIT=NONE] -->
+ <string name="tuner_status_bar_explanation">Enable or disable icons from being shown in the status bar.</string>
+
</resources>
diff --git a/packages/SystemUI/res/xml/tuner_prefs.xml b/packages/SystemUI/res/xml/tuner_prefs.xml
index 483f367..9193754 100644
--- a/packages/SystemUI/res/xml/tuner_prefs.xml
+++ b/packages/SystemUI/res/xml/tuner_prefs.xml
@@ -27,6 +27,26 @@
android:key="status_bar"
android:title="@string/status_bar" >
+ <Preference
+ android:selectable="false"
+ android:summary="@string/tuner_status_bar_explanation" />
+
+ <com.android.systemui.tuner.StatusBarSwitch
+ android:key="rotate"
+ android:title="@string/status_bar_settings_auto_rotation" />
+
+ <com.android.systemui.tuner.StatusBarSwitch
+ android:key="headset"
+ android:title="@string/headset" />
+
+ <com.android.systemui.tuner.StatusBarSwitch
+ android:key="managed_profile"
+ android:title="@string/status_bar_work" />
+
+ <!-- ime -->
+ <!-- sync_failing -->
+ <!-- sync_active -->
+
<com.android.systemui.tuner.StatusBarSwitch
android:key="cast"
android:title="@string/quick_settings_cast_title" />
@@ -39,17 +59,19 @@
android:key="bluetooth"
android:title="@string/quick_settings_bluetooth_label" />
+ <!-- nfc -->
+ <!-- tty -->
+ <!-- speakerphone -->
+
<com.android.systemui.tuner.StatusBarSwitch
android:key="zen"
android:title="@string/quick_settings_dnd_label" />
- <com.android.systemui.tuner.StatusBarSwitch
- android:key="alarm_clock"
- android:title="@string/status_bar_alarm" />
+ <!-- mute -->
<com.android.systemui.tuner.StatusBarSwitch
- android:key="managed_profile"
- android:title="@string/status_bar_work" />
+ android:key="volume"
+ android:title="@*android:string/volume_unknown" />
<com.android.systemui.tuner.StatusBarSwitch
android:key="wifi"
@@ -67,6 +89,22 @@
android:key="airplane"
android:title="@string/status_bar_airplane" />
+ <!-- other weird signal stuff -->
+
+ <com.android.systemui.tuner.StatusBarSwitch
+ android:key="battery"
+ android:title="@string/battery" />
+
+ <com.android.systemui.tuner.StatusBarSwitch
+ android:key="alarm_clock"
+ android:title="@string/status_bar_alarm" />
+
+ <!-- secure -->
+
+ <com.android.systemui.tuner.StatusBarSwitch
+ android:key="clock"
+ android:title="@string/clock" />
+
</PreferenceScreen>
diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
index cdbdc22..b4f63eb 100644
--- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
+++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
@@ -18,13 +18,19 @@
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Handler;
+import android.util.ArraySet;
import android.util.AttributeSet;
+import android.view.View;
import android.widget.ImageView;
+import com.android.systemui.statusbar.phone.StatusBarIconController;
import com.android.systemui.statusbar.policy.BatteryController;
+import com.android.systemui.tuner.TunerService;
-public class BatteryMeterView extends ImageView implements BatteryController.BatteryStateChangeCallback {
+public class BatteryMeterView extends ImageView implements
+ BatteryController.BatteryStateChangeCallback, TunerService.Tunable {
private final BatteryMeterDrawable mDrawable;
+ private final String mSlotBattery;
private BatteryController mBatteryController;
public BatteryMeterView(Context context) {
@@ -45,6 +51,8 @@
mDrawable = new BatteryMeterDrawable(context, new Handler(), frameColor);
atts.recycle();
+ mSlotBattery = context.getString(
+ com.android.internal.R.string.status_bar_battery);
setImageDrawable(mDrawable);
}
@@ -54,10 +62,19 @@
}
@Override
+ public void onTuningChanged(String key, String newValue) {
+ if (StatusBarIconController.ICON_BLACKLIST.equals(key)) {
+ ArraySet<String> icons = StatusBarIconController.getIconBlacklist(newValue);
+ setVisibility(icons.contains(mSlotBattery) ? View.GONE : View.VISIBLE);
+ }
+ }
+
+ @Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
mBatteryController.addStateChangedCallback(this);
mDrawable.startListening();
+ TunerService.get(getContext()).addTunable(this, StatusBarIconController.ICON_BLACKLIST);
}
@Override
@@ -65,6 +82,7 @@
super.onDetachedFromWindow();
mBatteryController.removeStateChangedCallback(this);
mDrawable.stopListening();
+ TunerService.get(getContext()).removeTunable(this);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
index 7bce54b..79155b2 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
@@ -16,8 +16,8 @@
package com.android.systemui.qs.tiles;
+import android.content.Context;
import android.content.res.Configuration;
-
import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
@@ -78,7 +78,7 @@
return;
}
state.value = rotationLocked;
- final boolean portrait = isCurrentOrientationLockPortrait();
+ final boolean portrait = isCurrentOrientationLockPortrait(mController, mContext);
if (rotationLocked) {
final int label = portrait ? R.string.quick_settings_rotation_locked_portrait_label
: R.string.quick_settings_rotation_locked_landscape_label;
@@ -94,11 +94,12 @@
R.string.accessibility_rotation_lock_off);
}
- private boolean isCurrentOrientationLockPortrait() {
- int lockOrientation = mController.getRotationLockOrientation();
+ public static boolean isCurrentOrientationLockPortrait(RotationLockController controller,
+ Context context) {
+ int lockOrientation = controller.getRotationLockOrientation();
if (lockOrientation == Configuration.ORIENTATION_UNDEFINED) {
// Freely rotating device; use current rotation
- return mContext.getResources().getConfiguration().orientation
+ return context.getResources().getConfiguration().orientation
!= Configuration.ORIENTATION_LANDSCAPE;
} else {
return lockOrientation != Configuration.ORIENTATION_LANDSCAPE;
@@ -123,7 +124,8 @@
int idWhenOff) {
int stringID;
if (locked) {
- stringID = isCurrentOrientationLockPortrait() ? idWhenPortrait: idWhenLandscape;
+ stringID = isCurrentOrientationLockPortrait(mController, mContext) ? idWhenPortrait
+ : idWhenLandscape;
} else {
stringID = idWhenOff;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
index 4f57906..a444934 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DemoStatusIcons.java
@@ -83,7 +83,7 @@
if (location != null) {
int iconId = location.equals("show") ? LocationControllerImpl.LOCATION_STATUS_ICON_ID
: 0;
- updateSlot(LocationControllerImpl.LOCATION_STATUS_ICON_PLACEHOLDER, null, iconId);
+ updateSlot("location", null, iconId);
}
String alarm = args.getString("alarm");
if (alarm != null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index c853fb4..bc869b5 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -633,7 +633,8 @@
// Lastly, call to the icon policy to install/update all the icons.
mIconPolicy = new PhoneStatusBarPolicy(mContext, mIconController, mCastController,
- mHotspotController, mUserInfoController, mBluetoothController);
+ mHotspotController, mUserInfoController, mBluetoothController,
+ mRotationLockController);
mIconPolicy.setCurrentUserSetup(mUserSetup);
mSettingsObserver.onChange(false); // set up
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
index 59d831c..37d61b9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicy.java
@@ -38,11 +38,13 @@
import com.android.internal.telephony.TelephonyIntents;
import com.android.systemui.R;
import com.android.systemui.qs.tiles.DndTile;
+import com.android.systemui.qs.tiles.RotationLockTile;
import com.android.systemui.statusbar.policy.BluetoothController;
import com.android.systemui.statusbar.policy.BluetoothController.Callback;
import com.android.systemui.statusbar.policy.CastController;
import com.android.systemui.statusbar.policy.CastController.CastDevice;
import com.android.systemui.statusbar.policy.HotspotController;
+import com.android.systemui.statusbar.policy.RotationLockController;
import com.android.systemui.statusbar.policy.UserInfoController;
/**
@@ -50,18 +52,20 @@
* bar at boot time. It goes through the normal API for icons, even though it probably
* strictly doesn't need to.
*/
-public class PhoneStatusBarPolicy implements Callback {
+public class PhoneStatusBarPolicy implements Callback, RotationLockController.RotationLockControllerCallback {
private static final String TAG = "PhoneStatusBarPolicy";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
- private static final String SLOT_CAST = "cast";
- private static final String SLOT_HOTSPOT = "hotspot";
- private static final String SLOT_BLUETOOTH = "bluetooth";
- private static final String SLOT_TTY = "tty";
- private static final String SLOT_ZEN = "zen";
- private static final String SLOT_VOLUME = "volume";
- private static final String SLOT_ALARM_CLOCK = "alarm_clock";
- private static final String SLOT_MANAGED_PROFILE = "managed_profile";
+ private final String mSlotCast;
+ private final String mSlotHotspot;
+ private final String mSlotBluetooth;
+ private final String mSlotTty;
+ private final String mSlotZen;
+ private final String mSlotVolume;
+ private final String mSlotAlarmClock;
+ private final String mSlotManagedProfile;
+ private final String mSlotRotate;
+ private final String mSlotHeadset;
private final Context mContext;
private final Handler mHandler = new Handler();
@@ -71,6 +75,7 @@
private final UserInfoController mUserInfoController;
private final UserManager mUserManager;
private final StatusBarIconController mIconController;
+ private final RotationLockController mRotationLockController;
// Assume it's all good unless we hear otherwise. We don't always seem
// to get broadcasts that it *is* there.
@@ -89,37 +94,9 @@
private boolean mKeyguardVisible = true;
private BluetoothController mBluetooth;
- private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- if (action.equals(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED)) {
- updateAlarm();
- } else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION) ||
- action.equals(AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION)) {
- updateVolumeZen();
- } else if (action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) {
- updateSimState(intent);
- } else if (action.equals(TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED)) {
- updateTTY(intent);
- } else if (action.equals(Intent.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED)) {
- updateQuietState();
- updateManagedProfile();
- }
- }
- };
-
- private Runnable mRemoveCastIconRunnable = new Runnable() {
- @Override
- public void run() {
- if (DEBUG) Log.v(TAG, "updateCast: hiding icon NOW");
- mIconController.setIconVisibility(SLOT_CAST, false);
- }
- };
-
public PhoneStatusBarPolicy(Context context, StatusBarIconController iconController,
CastController cast, HotspotController hotspot, UserInfoController userInfoController,
- BluetoothController bluetooth) {
+ BluetoothController bluetooth, RotationLockController rotationLockController) {
mContext = context;
mIconController = iconController;
mCast = cast;
@@ -129,12 +106,28 @@
mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
mUserInfoController = userInfoController;
mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
+ mRotationLockController = rotationLockController;
+
+ mSlotCast = context.getString(com.android.internal.R.string.status_bar_cast);
+ mSlotHotspot = context.getString(com.android.internal.R.string.status_bar_hotspot);
+ mSlotBluetooth = context.getString(com.android.internal.R.string.status_bar_bluetooth);
+ mSlotTty = context.getString(com.android.internal.R.string.status_bar_tty);
+ mSlotZen = context.getString(com.android.internal.R.string.status_bar_zen);
+ mSlotVolume = context.getString(com.android.internal.R.string.status_bar_volume);
+ mSlotAlarmClock = context.getString(com.android.internal.R.string.status_bar_alarm_clock);
+ mSlotManagedProfile = context.getString(
+ com.android.internal.R.string.status_bar_managed_profile);
+ mSlotRotate = context.getString(com.android.internal.R.string.status_bar_rotate);
+ mSlotHeadset = context.getString(com.android.internal.R.string.status_bar_headset);
+
+ mRotationLockController.addRotationLockControllerCallback(this);
// listen for broadcasts
IntentFilter filter = new IntentFilter();
filter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
filter.addAction(AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION);
+ filter.addAction(AudioManager.ACTION_HEADSET_PLUG);
filter.addAction(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
filter.addAction(TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED);
filter.addAction(Intent.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED);
@@ -148,40 +141,40 @@
}
// TTY status
- mIconController.setIcon(SLOT_TTY, R.drawable.stat_sys_tty_mode, null);
- mIconController.setIconVisibility(SLOT_TTY, false);
+ mIconController.setIcon(mSlotTty, R.drawable.stat_sys_tty_mode, null);
+ mIconController.setIconVisibility(mSlotTty, false);
// bluetooth status
updateBluetooth();
// Alarm clock
- mIconController.setIcon(SLOT_ALARM_CLOCK, R.drawable.stat_sys_alarm, null);
- mIconController.setIconVisibility(SLOT_ALARM_CLOCK, false);
+ mIconController.setIcon(mSlotAlarmClock, R.drawable.stat_sys_alarm, null);
+ mIconController.setIconVisibility(mSlotAlarmClock, false);
// zen
- mIconController.setIcon(SLOT_ZEN, R.drawable.stat_sys_zen_important, null);
- mIconController.setIconVisibility(SLOT_ZEN, false);
+ mIconController.setIcon(mSlotZen, R.drawable.stat_sys_zen_important, null);
+ mIconController.setIconVisibility(mSlotZen, false);
// volume
- mIconController.setIcon(SLOT_VOLUME, R.drawable.stat_sys_ringer_vibrate, null);
- mIconController.setIconVisibility(SLOT_VOLUME, false);
+ mIconController.setIcon(mSlotVolume, R.drawable.stat_sys_ringer_vibrate, null);
+ mIconController.setIconVisibility(mSlotVolume, false);
updateVolumeZen();
// cast
- mIconController.setIcon(SLOT_CAST, R.drawable.stat_sys_cast, null);
- mIconController.setIconVisibility(SLOT_CAST, false);
+ mIconController.setIcon(mSlotCast, R.drawable.stat_sys_cast, null);
+ mIconController.setIconVisibility(mSlotCast, false);
mCast.addCallback(mCastCallback);
// hotspot
- mIconController.setIcon(SLOT_HOTSPOT, R.drawable.stat_sys_hotspot,
+ mIconController.setIcon(mSlotHotspot, R.drawable.stat_sys_hotspot,
mContext.getString(R.string.accessibility_status_bar_hotspot));
- mIconController.setIconVisibility(SLOT_HOTSPOT, mHotspot.isHotspotEnabled());
+ mIconController.setIconVisibility(mSlotHotspot, mHotspot.isHotspotEnabled());
mHotspot.addCallback(mHotspotCallback);
// managed profile
- mIconController.setIcon(SLOT_MANAGED_PROFILE, R.drawable.stat_sys_managed_profile_status,
+ mIconController.setIcon(mSlotManagedProfile, R.drawable.stat_sys_managed_profile_status,
mContext.getString(R.string.accessibility_managed_profile));
- mIconController.setIconVisibility(SLOT_MANAGED_PROFILE, mManagedProfileIconVisible);
+ mIconController.setIconVisibility(mSlotManagedProfile, mManagedProfileIconVisible);
}
public void setZenMode(int zen) {
@@ -193,9 +186,9 @@
final AlarmClockInfo alarm = mAlarmManager.getNextAlarmClock(UserHandle.USER_CURRENT);
final boolean hasAlarm = alarm != null && alarm.getTriggerTime() > 0;
final boolean zenNone = mZen == Global.ZEN_MODE_NO_INTERRUPTIONS;
- mIconController.setIcon(SLOT_ALARM_CLOCK, zenNone ? R.drawable.stat_sys_alarm_dim
+ mIconController.setIcon(mSlotAlarmClock, zenNone ? R.drawable.stat_sys_alarm_dim
: R.drawable.stat_sys_alarm, null);
- mIconController.setIconVisibility(SLOT_ALARM_CLOCK, mCurrentUserSetup && hasAlarm);
+ mIconController.setIconVisibility(mSlotAlarmClock, mCurrentUserSetup && hasAlarm);
}
private final void updateSimState(Intent intent) {
@@ -260,18 +253,18 @@
}
if (zenVisible) {
- mIconController.setIcon(SLOT_ZEN, zenIconId, zenDescription);
+ mIconController.setIcon(mSlotZen, zenIconId, zenDescription);
}
if (zenVisible != mZenVisible) {
- mIconController.setIconVisibility(SLOT_ZEN, zenVisible);
+ mIconController.setIconVisibility(mSlotZen, zenVisible);
mZenVisible = zenVisible;
}
if (volumeVisible) {
- mIconController.setIcon(SLOT_VOLUME, volumeIconId, volumeDescription);
+ mIconController.setIcon(mSlotVolume, volumeIconId, volumeDescription);
}
if (volumeVisible != mVolumeVisible) {
- mIconController.setIconVisibility(SLOT_VOLUME, volumeVisible);
+ mIconController.setIconVisibility(mSlotVolume, volumeVisible);
mVolumeVisible = volumeVisible;
}
updateAlarm();
@@ -300,8 +293,8 @@
}
}
- mIconController.setIcon(SLOT_BLUETOOTH, iconId, contentDescription);
- mIconController.setIconVisibility(SLOT_BLUETOOTH, bluetoothEnabled);
+ mIconController.setIcon(mSlotBluetooth, iconId, contentDescription);
+ mIconController.setIconVisibility(mSlotBluetooth, bluetoothEnabled);
}
private final void updateTTY(Intent intent) {
@@ -314,13 +307,13 @@
if (enabled) {
// TTY is on
if (DEBUG) Log.v(TAG, "updateTTY: set TTY on");
- mIconController.setIcon(SLOT_TTY, R.drawable.stat_sys_tty_mode,
+ mIconController.setIcon(mSlotTty, R.drawable.stat_sys_tty_mode,
mContext.getString(R.string.accessibility_tty_enabled));
- mIconController.setIconVisibility(SLOT_TTY, true);
+ mIconController.setIconVisibility(mSlotTty, true);
} else {
// TTY is off
if (DEBUG) Log.v(TAG, "updateTTY: set TTY off");
- mIconController.setIconVisibility(SLOT_TTY, false);
+ mIconController.setIconVisibility(mSlotTty, false);
}
}
@@ -336,9 +329,9 @@
if (DEBUG) Log.v(TAG, "updateCast: isCasting: " + isCasting);
mHandler.removeCallbacks(mRemoveCastIconRunnable);
if (isCasting) {
- mIconController.setIcon(SLOT_CAST, R.drawable.stat_sys_cast,
+ mIconController.setIcon(mSlotCast, R.drawable.stat_sys_cast,
mContext.getString(R.string.accessibility_casting));
- mIconController.setIconVisibility(SLOT_CAST, true);
+ mIconController.setIconVisibility(mSlotCast, true);
} else {
// don't turn off the screen-record icon for a few seconds, just to make sure the user
// has seen it
@@ -382,19 +375,19 @@
final boolean showIcon;
if (mManagedProfileFocused && !mKeyguardVisible) {
showIcon = true;
- mIconController.setIcon(SLOT_MANAGED_PROFILE,
+ mIconController.setIcon(mSlotManagedProfile,
R.drawable.stat_sys_managed_profile_status,
mContext.getString(R.string.accessibility_managed_profile));
} else if (mManagedProfileInQuietMode) {
showIcon = true;
- mIconController.setIcon(SLOT_MANAGED_PROFILE,
+ mIconController.setIcon(mSlotManagedProfile,
R.drawable.stat_sys_managed_profile_status_off,
mContext.getString(R.string.accessibility_managed_profile));
} else {
showIcon = false;
}
if (mManagedProfileIconVisible != showIcon) {
- mIconController.setIconVisibility(SLOT_MANAGED_PROFILE, showIcon);
+ mIconController.setIconVisibility(mSlotManagedProfile, showIcon);
mManagedProfileIconVisible = showIcon;
}
}
@@ -423,7 +416,7 @@
private final HotspotController.Callback mHotspotCallback = new HotspotController.Callback() {
@Override
public void onHotspotChanged(boolean enabled) {
- mIconController.setIconVisibility(SLOT_HOTSPOT, enabled);
+ mIconController.setIconVisibility(mSlotHotspot, enabled);
}
};
@@ -449,4 +442,69 @@
updateAlarm();
updateQuietState();
}
+
+ @Override
+ public void onRotationLockStateChanged(boolean rotationLocked, boolean affordanceVisible) {
+ boolean portrait = RotationLockTile.isCurrentOrientationLockPortrait(
+ mRotationLockController, mContext);
+ if (rotationLocked) {
+ if (portrait) {
+ mIconController.setIcon(mSlotRotate, R.drawable.stat_sys_rotate_portrait,
+ mContext.getString(R.string.accessibility_rotation_lock_on_portrait));
+ } else {
+ mIconController.setIcon(mSlotRotate, R.drawable.stat_sys_rotate_landscape,
+ mContext.getString(R.string.accessibility_rotation_lock_on_landscape));
+ }
+ } else {
+ mIconController.setIcon(mSlotRotate, portrait
+ ? R.drawable.stat_sys_auto_rotate_portrait
+ : R.drawable.stat_sys_auto_rotate_landscape,
+ mContext.getString(R.string.accessibility_rotation_lock_off));
+ }
+ }
+
+ private void updateHeadsetPlug(Intent intent) {
+ boolean connected = intent.getIntExtra("state", 0) != 0;
+ boolean hasMic = intent.getIntExtra("microphone", 0) != 0;
+ if (connected) {
+ String contentDescription = mContext.getString(hasMic
+ ? R.string.accessibility_status_bar_headset
+ : R.string.accessibility_status_bar_headphones);
+ mIconController.setIcon(mSlotHeadset, hasMic ? R.drawable.ic_headset_mic
+ : R.drawable.ic_headset, contentDescription);
+ mIconController.setIconVisibility(mSlotHeadset, true);
+ } else {
+ mIconController.setIconVisibility(mSlotHeadset, false);
+ }
+ }
+
+ private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (action.equals(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED)) {
+ updateAlarm();
+ } else if (action.equals(AudioManager.RINGER_MODE_CHANGED_ACTION) ||
+ action.equals(AudioManager.INTERNAL_RINGER_MODE_CHANGED_ACTION)) {
+ updateVolumeZen();
+ } else if (action.equals(TelephonyIntents.ACTION_SIM_STATE_CHANGED)) {
+ updateSimState(intent);
+ } else if (action.equals(TelecomManager.ACTION_CURRENT_TTY_MODE_CHANGED)) {
+ updateTTY(intent);
+ } else if (action.equals(Intent.ACTION_MANAGED_PROFILE_AVAILABILITY_CHANGED)) {
+ updateQuietState();
+ updateManagedProfile();
+ } else if (action.equals(AudioManager.ACTION_HEADSET_PLUG)) {
+ updateHeadsetPlug(intent);
+ }
+ }
+ };
+
+ private Runnable mRemoveCastIconRunnable = new Runnable() {
+ @Override
+ public void run() {
+ if (DEBUG) Log.v(TAG, "updateCast: hiding icon NOW");
+ mIconController.setIconVisibility(mSlotCast, false);
+ }
+ };
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
index 0eb0bf89..b16c98e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarIconController.java
@@ -450,12 +450,13 @@
public static ArraySet<String> getIconBlacklist(String blackListStr) {
ArraySet<String> ret = new ArraySet<String>();
- if (blackListStr != null) {
- String[] blacklist = blackListStr.split(",");
- for (String slot : blacklist) {
- if (!TextUtils.isEmpty(slot)) {
- ret.add(slot);
- }
+ if (blackListStr == null) {
+ blackListStr = "rotate,headset";
+ }
+ String[] blacklist = blackListStr.split(",");
+ for (String slot : blacklist) {
+ if (!TextUtils.isEmpty(slot)) {
+ ret.add(slot);
}
}
return ret;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
index 896bd62..7054bb8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
@@ -31,15 +31,16 @@
import android.text.format.DateFormat;
import android.text.style.CharacterStyle;
import android.text.style.RelativeSizeSpan;
+import android.util.ArraySet;
import android.util.AttributeSet;
import android.view.Display;
+import android.view.View;
import android.widget.TextView;
-
import com.android.systemui.DemoMode;
import com.android.systemui.R;
+import com.android.systemui.statusbar.phone.StatusBarIconController;
import com.android.systemui.tuner.TunerService;
import com.android.systemui.tuner.TunerService.Tunable;
-
import libcore.icu.LocaleData;
import java.text.SimpleDateFormat;
@@ -87,7 +88,6 @@
} finally {
a.recycle();
}
- TunerService.get(context).addTunable(this, CLOCK_SECONDS);
}
@Override
@@ -106,6 +106,8 @@
getContext().registerReceiverAsUser(mIntentReceiver, UserHandle.ALL, filter,
null, getHandler());
+ TunerService.get(getContext()).addTunable(this, CLOCK_SECONDS,
+ StatusBarIconController.ICON_BLACKLIST);
}
// NOTE: It's safe to do these after registering the receiver since the receiver always runs
@@ -125,6 +127,7 @@
if (mAttached) {
getContext().unregisterReceiver(mIntentReceiver);
mAttached = false;
+ TunerService.get(getContext()).removeTunable(this);
}
}
@@ -157,8 +160,13 @@
@Override
public void onTuningChanged(String key, String newValue) {
- mShowSeconds = newValue != null && Integer.parseInt(newValue) != 0;
- updateShowSeconds();
+ if (CLOCK_SECONDS.equals(key)) {
+ mShowSeconds = newValue != null && Integer.parseInt(newValue) != 0;
+ updateShowSeconds();
+ } else if (StatusBarIconController.ICON_BLACKLIST.equals(key)) {
+ ArraySet<String> list = StatusBarIconController.getIconBlacklist(newValue);
+ setVisibility(list.contains("clock") ? View.GONE : View.VISIBLE);
+ }
}
private void updateShowSeconds() {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
index 0917528..7517f97 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/LocationControllerImpl.java
@@ -43,7 +43,6 @@
public class LocationControllerImpl extends BroadcastReceiver implements LocationController {
// The name of the placeholder corresponding to the location request status icon.
// This string corresponds to config_statusBarIcons in core/res/res/values/config.xml.
- public static final String LOCATION_STATUS_ICON_PLACEHOLDER = "location";
public static final int LOCATION_STATUS_ICON_ID = R.drawable.stat_sys_location;
private static final int[] mHighPowerRequestAppOpArray
@@ -59,9 +58,11 @@
private ArrayList<LocationSettingsChangeCallback> mSettingsChangeCallbacks =
new ArrayList<LocationSettingsChangeCallback>();
private final H mHandler = new H();
+ public final String mSlotLocation;
public LocationControllerImpl(Context context, Looper bgLooper) {
mContext = context;
+ mSlotLocation = mContext.getString(com.android.internal.R.string.status_bar_location);
// Register to listen for changes in location settings.
IntentFilter filter = new IntentFilter();
@@ -173,10 +174,10 @@
// Updates the status view based on the current state of location requests.
private void refreshViews() {
if (mAreActiveLocationRequests) {
- mStatusBarManager.setIcon(LOCATION_STATUS_ICON_PLACEHOLDER, LOCATION_STATUS_ICON_ID,
+ mStatusBarManager.setIcon(mSlotLocation, LOCATION_STATUS_ICON_ID,
0, mContext.getString(R.string.accessibility_location_active));
} else {
- mStatusBarManager.removeIcon(LOCATION_STATUS_ICON_PLACEHOLDER);
+ mStatusBarManager.removeIcon(mSlotLocation);
}
}