diff options
author | Rashed Abdel-Tawab <rashed@linux.com> | 2017-10-18 20:33:08 -0400 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-06-02 00:30:40 +0800 |
commit | 9fce1af240d23734aa6a3c4787b810a5e0477790 (patch) | |
tree | 2df93550e420f5aa80dcf90b2f19aba657de962c | |
parent | a688b70a66ad6e858d1ffd2f75f7492fbffbf83a (diff) |
SystemUI: Bringup tuner statusbar changes
Based on the following changes:
Author: Steve Kondik <steve@cyngn.com>
Date: Mon Sep 12 12:49:59 2016 -0700
systemui: Enable navbar tuner
* And add an action for it.
Change-Id: I23a51cc8e33f3498deec9ed60281423c66bbc4ca
Author: Steve Kondik <steve@cyngn.com>
Date: Wed Sep 14 05:08:02 2016 -0700
systemui: Fix a few issues with Tuner
* Allow launching PreferenceScreens directly by setting the
"tuner" extra to a valid key.
* Remove the silly warning. There are no dragons here.
* Move CM stuff to CM manifest.
* Fix the ActionBar title when navigating.
Change-Id: Ideac31dbfd71d7c0aa7fc3c20395c24128c598fc
Author: Joey Rizzoli <joey@cyanogenmoditalia.it>
Date: Tue Nov 8 15:44:25 2016 +0100
Tuner: allow power notif controls to be launched externally
Change-Id: I8a9e1a2080640938c99125ab04986dfc99e004bf
Signed-off-by: Joey Rizzoli <joey@cyanogenmoditalia.it>
Author: Gabriele M <moto.falcon.git@gmail.com>
Date: Sat Sep 16 19:35:28 2017 +0200
SystemUI: Revert some Tuner changes
These changes were done to start the status bar tuner directly without
showing the main Tuner screen. However, they negatively affect the
management of the fragments. Revert them so that a different solution
can be implemented in a follow-up change.
This reverts the following commits:
- 338de6728d8910d450f8962a44bbe69feba1ced4
"Handle onOptionsItemSelected for TunerActivity"
- b3eba6af8e3253efc1332b55821fd08e4fbf77b0
"SystemUI: Remove nav bar and status bar options from SystemUI Tuner"
- 82b9f95f761e7b5cc94ea2542b30460e48f8fb02 (partially)
"systemui: Fix a few issues with Tuner"
BUGBASH-661
Change-Id: I35182248566ff31ed08d2836d66d5bd3f947ee9a
Author: Gabriele M <moto.falcon.git@gmail.com>
Date: Sat Sep 16 19:35:38 2017 +0200
SystemUI: Add separate pref screen for the status bar tuner
Keep the status bar preferences separate and allow to start them
directly without loading the main tuner fragment.
Change-Id: Ie1a0d9395b7bc01d585616a1976adeda3c457a0d
Author: althafvly <althafvly@gmail.com>
Date: Tue Apr 19 07:33:15 2022 +0000
SystemUI: Split status bar icon controls for vibrate and mute
- Give users the option to disable the Mute icon too as
Volume icons got split in https://github.com/LineageOS/android_frameworks_base/commit/ca7ceb8aef3e3fb7a899c137efe0c00003499f6d
- Change Volume string to Vibrate to better reflect
which icon is being disabled.
Change-Id: I1f8a0370f748cf40fc99584188c42bb2a0aa9856
Author: althafvly <althafvly@gmail.com>
Date: Thu Apr 21 11:40:04 2022 +0530
SystemUI: Bring in drawables for statusbar icon toggles
- Icons from aosp base and settings
- Minor edits for width, height, tint and color
From 'core/res/res/drawable' dir:
- ic_statusbar_auto_rotate - ic_qs_auto_rotate
- ic_statusbar_camera - ic_camera
- ic_statusbar_mute - ic_audio_ring_notif_mute
- ic_statusbar_wifi - ic_wifi_signal_4
- ic_statusbar_vibrate - ic_audio_ring_notif_vibrate
- ic_statusbar_alarm - ic_audio_alarm
From 'packages/SystemUI/res/drawable' dir:
- ic_statusbar_headset - ic_headset
- ic_statusbar_cast - ic_cast
From 'packages/apps/Settings/res/drawable' dir:
- ic_statusbar_work - ic_enterprise
- ic_statusbar_hotspot - ic_hotspot
- ic_statusbar_do_not_disturb - ic_do_not_disturb_on_24dp
- ic_statusbar_ethernet - ic_settings_ethernet
- ic_statusbar_mobile_network - ic_network_cell
- ic_statusbar_airplanemode - ic_airplanemode_active
- ic_statusbar_clock - ic_settings_date_time
- ic_statusbar_priority - ic_important_outline
Change-Id: Id30e5039e73068d0c73dd5fc7d0305865af1d791
Author: SagarMakhar <sagarmakhar@gmail.com>
Date: Thu Oct 21 10:31:56 2021 +0000
Adapt tuner prefs to S settings style & cleanup
Co-authored-by: Michael Bestas <mkbestas@lineageos.org>
Change-Id: Icadd13a00e4d3e649b50f405ed0c8c76081be200
Change-Id: I4ab0b4d18dcf0080dea665b63137c19a0e57aa07
27 files changed, 660 insertions, 201 deletions
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp index 35b5797c8097..0c410c3ad6d2 100644 --- a/packages/SystemUI/Android.bp +++ b/packages/SystemUI/Android.bp @@ -180,6 +180,7 @@ android_library { "motion_tool_lib", ], manifest: "AndroidManifest.xml", + additional_manifests: ["IceManifest.xml"], libs: [ "android.car", "ims-common", diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index b7aab5b69280..e434d6e798c7 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -436,7 +436,7 @@ <activity android:name=".tuner.TunerActivity" android:enabled="false" android:icon="@drawable/tuner" - android:theme="@style/TunerSettings" + android:theme="@style/Theme.SubSettingsBase" android:label="@string/system_ui_tuner" android:process=":tuner" android:exported="true"> @@ -453,7 +453,7 @@ <activity-alias android:name=".DemoMode" android:targetActivity=".tuner.TunerActivity" android:icon="@drawable/tuner" - android:theme="@style/TunerSettings" + android:theme="@style/Theme.SubSettingsBase" android:label="@string/demo_mode" android:process=":tuner" android:exported="true"> diff --git a/packages/SystemUI/IceManifest.xml b/packages/SystemUI/IceManifest.xml new file mode 100644 index 000000000000..74638926a7e6 --- /dev/null +++ b/packages/SystemUI/IceManifest.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* + * Copyright (c) 2017 The LineageOS 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. + */ +--> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" + package="com.android.systemui"> + + <!-- SystemUI Tuner --> + <application> + <activity-alias + android:name=".tuner.StatusBarTuner" + android:targetActivity=".tuner.TunerActivity" + android:icon="@drawable/tuner" + android:theme="@style/Theme.SubSettingsBase" + android:label="@string/status_bar_icons_title" + android:process=":tuner" + android:exported="true"> + <intent-filter> + <action android:name="com.android.settings.action.STATUS_BAR_TUNER" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity-alias> + </application> + +</manifest> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_airplanemode.xml b/packages/SystemUI/res/drawable/ic_statusbar_airplanemode.xml new file mode 100644 index 000000000000..7ade8b215590 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_airplanemode.xml @@ -0,0 +1,25 @@ +<!-- + Copyright (C) 2017 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:pathData="M21,16v-2l-8,-5V3.5C13,2.67 12.33,2 11.5,2S10,2.67 10,3.5V9l-8,5v2l8,-2.5V19l-2,1.5V22l3.5,-1l3.5,1v-1.5L13,19v-5.5L21,16z" + android:fillColor="#FFFFFFFF"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_alarm.xml b/packages/SystemUI/res/drawable/ic_statusbar_alarm.xml new file mode 100644 index 000000000000..4d0a5f8c7346 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_alarm.xml @@ -0,0 +1,25 @@ +<!-- +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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="48.0" + android:viewportHeight="48.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M44.0,11.44l-9.19,-7.71 -2.57,3.06 9.19,7.71 2.57,-3.06zm-28.24,-4.66l-2.57,-3.06 -9.19,7.71 2.57,3.06 9.19,-7.71zm9.24,9.22l-3.0,0.0l0.0,12.0l9.49,5.71 1.51,-2.47 -8.0,-4.74l0.0,-10.5zm-1.01,-8.0c-9.95,0.0 -17.99,8.06 -17.99,18.0s8.04,18.0 17.99,18.0 18.01,-8.06 18.01,-18.0 -8.06,-18.0 -18.01,-18.0zm0.01,32.0c-7.73,0.0 -14.0,-6.27 -14.0,-14.0s6.27,-14.0 14.0,-14.0 14.0,6.27 14.0,14.0 -6.26,14.0 -14.0,14.0z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_auto_rotate.xml b/packages/SystemUI/res/drawable/ic_statusbar_auto_rotate.xml new file mode 100644 index 000000000000..9a2cb496d282 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_auto_rotate.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2018 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" + android:height="24dp" + android:width="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M7.4,10.94H2.45V5.99l2,0.01v1.53l4.61,-4.61c0.64,-0.64 1.67,-0.66 2.29,-0.04l8.18,8.18h-2.83l-6.48,-6.48L5.86,8.95H7.4V10.94zM16.6,13.06l0.01,2h1.53l-4.36,4.36l-6.48,-6.48H4.46l8.19,8.19c0.62,0.62 1.65,0.6 2.29,-0.04l4.61,-4.61l0.01,0.01v1.53h1.99v-4.95H16.6z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_camera.xml b/packages/SystemUI/res/drawable/ic_statusbar_camera.xml new file mode 100644 index 000000000000..32d6b5326ffc --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_camera.xml @@ -0,0 +1,25 @@ +<!-- +Copyright (C) 2018 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M20,5h-3.17L15,3H9L7.17,5H4C2.9,5 2,5.9 2,7v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V7C22,5.9 21.1,5 20,5zM20,19H4V7h16V19zM12,9c-2.21,0 -4,1.79 -4,4c0,2.21 1.79,4 4,4s4,-1.79 4,-4C16,10.79 14.21,9 12,9z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_cast.xml b/packages/SystemUI/res/drawable/ic_statusbar_cast.xml new file mode 100644 index 000000000000..5413c77215df --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_cast.xml @@ -0,0 +1,25 @@ +<!-- +Copyright (C) 2017 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M21,3L3,3c-1.1,0 -2,0.9 -2,2v3h2L3,5h18v14h-7v2h7c1.1,0 2,-0.9 2,-2L23,5c0,-1.1 -0.9,-2 -2,-2zM1,18v3h3c0,-1.66 -1.34,-3 -3,-3zM1,14v2c2.76,0 5,2.24 5,5h2c0,-3.87 -3.13,-7 -7,-7zM1,10v2c4.97,0 9,4.03 9,9h2c0,-6.08 -4.93,-11 -11,-11z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_clock.xml b/packages/SystemUI/res/drawable/ic_statusbar_clock.xml new file mode 100644 index 000000000000..4b91508d2eb1 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_clock.xml @@ -0,0 +1,28 @@ +<!-- + Copyright (C) 2015 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M11.99,2.0C6.47,2.0 2.0,6.48 2.0,12.0s4.47,10.0 9.99,10.0C17.52,22.0 22.0,17.52 22.0,12.0S17.52,2.0 11.99,2.0zM12.0,20.0c-4.42,0.0 -8.0,-3.58 -8.0,-8.0s3.58,-8.0 8.0,-8.0 8.0,3.58 8.0,8.0 -3.58,8.0 -8.0,8.0z"/> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M12.5,7.0L11.0,7.0l0.0,6.0l5.25,3.1 0.75,-1.23 -4.5,-2.67z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_do_not_disturb.xml b/packages/SystemUI/res/drawable/ic_statusbar_do_not_disturb.xml new file mode 100644 index 000000000000..cace8d4433f5 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_do_not_disturb.xml @@ -0,0 +1,28 @@ +<!-- + Copyright (C) 2018 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M12,2C6.48,2 2,6.48 2,12c0,5.52 4.48,10 10,10c5.52,0 10,-4.48 10,-10C22,6.48 17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8c0,-4.41 3.59,-8 8,-8c4.41,0 8,3.59 8,8C20,16.41 16.41,20 12,20z"/> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M7,11h10v2h-10z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_ethernet.xml b/packages/SystemUI/res/drawable/ic_statusbar_ethernet.xml new file mode 100644 index 000000000000..46e753fd7eb8 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_ethernet.xml @@ -0,0 +1,34 @@ + <!-- + ~ Copyright (C) 2021 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M17,6l-1.41,1.41L20.17,12l-4.58,4.59L17,18l6,-6zM8.41,7.41L7,6l-6,6 6,6 1.41,-1.41L3.83,12z"/> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M8,12m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0"/> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M12,12m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0"/> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M16,12m-1,0a1,1 0,1 1,2 0a1,1 0,1 1,-2 0"/> + </vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_headset.xml b/packages/SystemUI/res/drawable/ic_statusbar_headset.xml new file mode 100644 index 000000000000..ad9a55fcc5e2 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_headset.xml @@ -0,0 +1,25 @@ +<!-- + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M19,15v3c0,0.55 -0.45,1 -1,1h-1v-4h2M7,15v4H6c-0.55,0 -1,-0.45 -1,-1v-3h2m5,-13c-4.97,0 -9,4.03 -9,9v7c0,1.66 1.34,3 3,3h3v-8H5v-2c0,-3.87 3.13,-7 7,-7s7,3.13 7,7v2h-4v8h3c1.66,0 3,-1.34 3,-3v-7c0,-4.97 -4.03,-9 -9,-9z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_hotspot.xml b/packages/SystemUI/res/drawable/ic_statusbar_hotspot.xml new file mode 100644 index 000000000000..37f5ea9075ae --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_hotspot.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2015 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M12,7c-3.31,0-6,2.69-6,6c0,1.66,0.68,3.15,1.76,4.24l1.42-1.42C8.45,15.1,8,14.11,8,13c0-2.21,1.79-4,4-4s4,1.79,4,4 c0,1.11-0.45,2.1-1.18,2.82l1.42,1.42C17.32,16.15,18,14.66,18,13C18,9.69,15.31,7,12,7z" /> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M12,3C6.48,3,2,7.48,2,13c0,2.76,1.12,5.26,2.93,7.07l1.41-1.41C4.9,17.21,4,15.21,4,13c0-4.42,3.58-8,8-8s8,3.58,8,8 c0,2.21-0.9,4.2-2.35,5.65l1.41,1.41C20.88,18.26,22,15.76,22,13C22,7.48,17.52,3,12,3z" /> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M12,11c-1.1,0-2,0.9-2,2c0,0.55,0.23,1.05,0.59,1.41C10.95,14.77,11.45,15,12,15s1.05-0.23,1.41-0.59 C13.77,14.05,14,13.55,14,13C14,11.9,13.1,11,12,11z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_mobile_network.xml b/packages/SystemUI/res/drawable/ic_statusbar_mobile_network.xml new file mode 100644 index 000000000000..1f24717a1512 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_mobile_network.xml @@ -0,0 +1,26 @@ +<!-- + Copyright (C) 2017 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" + android:autoMirrored="true" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:pathData="m3.8,22l17.19,0c0.55,0 1.01,-0.45 1.01,-1.01l0,-17.19c0,-0.71 -0.87,-1.08 -1.38,-0.57l-17.38,17.39c-0.51,0.51 -0.15,1.38 0.56,1.38z" + android:fillColor="#FFFFFFFF"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_mute.xml b/packages/SystemUI/res/drawable/ic_statusbar_mute.xml new file mode 100644 index 000000000000..c63aeea9489e --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_mute.xml @@ -0,0 +1,26 @@ +<!-- +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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + + <path + android:fillColor="#FFFFFFFF" + android:pathData="M11.5,22.0c1.1,0.0 2.0,-0.9 2.0,-2.0l-4.0,0.0C9.5,21.1 10.4,22.0 11.5,22.0zM18.0,10.5c0.0,-3.1 -2.1,-5.6 -5.0,-6.3L13.0,3.5C13.0,2.7 12.3,2.0 11.5,2.0C10.7,2.0 10.0,2.7 10.0,3.5l0.0,0.7C9.5,4.3 9.0,4.5 8.6,4.7l9.4,9.4L18.0,10.5zM17.7,19.0l2.0,2.0l1.3,-1.3L4.3,3.0L3.0,4.3l2.9,2.9C5.3,8.2 5.0,9.3 5.0,10.5L5.0,16.0l-2.0,2.0l0.0,1.0L17.7,19.0z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_priority.xml b/packages/SystemUI/res/drawable/ic_statusbar_priority.xml new file mode 100644 index 000000000000..adcbbe932ec6 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_priority.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2020 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M15,19L3,19l4.5,-7L3,5h12c0.65,0 1.26,0.31 1.63,0.84L21,12l-4.37,6.16c-0.37,0.52 -0.98,0.84 -1.63,0.84zM6.5,17L15,17l3.5,-5L15,7L6.5,7l3.5,5 -3.5,5z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_vibrate.xml b/packages/SystemUI/res/drawable/ic_statusbar_vibrate.xml new file mode 100644 index 000000000000..dfa60992ba51 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_vibrate.xml @@ -0,0 +1,26 @@ +<!-- +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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + + <path + android:fillColor="#FFFFFFFF" + android:pathData="M0.0,15.0l2.0,0.0L2.0,9.0L0.0,9.0L0.0,15.0zM3.0,17.0l2.0,0.0L5.0,7.0L3.0,7.0L3.0,17.0zM22.0,9.0l0.0,6.0l2.0,0.0L24.0,9.0L22.0,9.0zM19.0,17.0l2.0,0.0L21.0,7.0l-2.0,0.0L19.0,17.0zM16.5,3.0l-9.0,0.0C6.7,3.0 6.0,3.7 6.0,4.5l0.0,15.0C6.0,20.3 6.7,21.0 7.5,21.0l9.0,0.0c0.8,0.0 1.5,-0.7 1.5,-1.5l0.0,-15.0C18.0,3.7 17.3,3.0 16.5,3.0zM16.0,19.0L8.0,19.0L8.0,5.0l8.0,0.0L16.0,19.0z"/> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_wifi.xml b/packages/SystemUI/res/drawable/ic_statusbar_wifi.xml new file mode 100644 index 000000000000..e56e9512c9b5 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_wifi.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2015 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:fillColor="#FFFFFFFF" + android:pathData="M24,7.39L12,22L0,7.39C2.97,4.08,7.25,2,12,2S21.03,4.08,24,7.39z" /> +</vector> diff --git a/packages/SystemUI/res/drawable/ic_statusbar_work.xml b/packages/SystemUI/res/drawable/ic_statusbar_work.xml new file mode 100644 index 000000000000..ea8918b1ca12 --- /dev/null +++ b/packages/SystemUI/res/drawable/ic_statusbar_work.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +~ Copyright (C) 2019 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" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0" + android:tint="?android:attr/colorControlNormal"> + <path + android:pathData="M20,6h-4L16,4c0,-1.11 -0.89,-2 -2,-2h-4c-1.11,0 -2,0.89 -2,2v2L4,6c-1.11,0 -1.99,0.89 -1.99,2L2,19c0,1.11 0.89,2 2,2h16c1.11,0 2,-0.89 2,-2L22,8c0,-1.11 -0.89,-2 -2,-2zM12,15c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM14,6h-4L10,4h4v2z" + android:fillColor="#FFFFFFFF"/> +</vector> diff --git a/packages/SystemUI/res/layout/tuner_activity.xml b/packages/SystemUI/res/layout/tuner_activity.xml index 83cbf14edd39..7e91267d7ae6 100644 --- a/packages/SystemUI/res/layout/tuner_activity.xml +++ b/packages/SystemUI/res/layout/tuner_activity.xml @@ -20,13 +20,6 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> - <Toolbar - android:id="@+id/action_bar" - style="?android:attr/actionBarStyle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:theme="?android:attr/actionBarTheme" - android:navigationContentDescription="@*android:string/action_bar_up_description" /> <FrameLayout android:id="@+id/content_frame" android:layout_width="match_parent" diff --git a/packages/SystemUI/res/values/ice_strings.xml b/packages/SystemUI/res/values/ice_strings.xml index 71c70b9ca36b..4e6c6518dcbf 100644 --- a/packages/SystemUI/res/values/ice_strings.xml +++ b/packages/SystemUI/res/values/ice_strings.xml @@ -15,6 +15,9 @@ limitations under the License. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + <!-- Status bar - icons --> + <string name="status_bar_icons_title">Status bar icons</string> + <!-- Custom QS tiles --> <!-- AOD QS tile --> <string name="quick_settings_aod_label">AOD</string> diff --git a/packages/SystemUI/res/xml/status_bar_prefs.xml b/packages/SystemUI/res/xml/status_bar_prefs.xml new file mode 100644 index 000000000000..49edfe7d1782 --- /dev/null +++ b/packages/SystemUI/res/xml/status_bar_prefs.xml @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 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. +--> +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:sysui="http://schemas.android.com/apk/res-auto" + android:key="status_bar" + android:title="@string/status_bar"> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_auto_rotate" + android:key="rotate" + android:title="@string/status_bar_settings_auto_rotation" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_headset" + android:key="headset" + android:title="@string/headset" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_work" + android:key="managed_profile" + android:title="@string/status_bar_work" /> + + <!-- ime --> + <!-- sync_failing --> + <!-- sync_active --> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_cast" + android:key="cast" + android:title="@string/quick_settings_cast_title" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_hotspot" + android:key="hotspot" + android:title="@string/quick_settings_hotspot_label" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@*android:drawable/ic_qs_bluetooth" + android:key="bluetooth" + android:title="@string/quick_settings_bluetooth_label" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_camera" + android:key="cameratoggle" + android:title="@string/quick_settings_camera_label" /> + + <!-- nfc --> + <!-- tty --> + <!-- speakerphone --> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_do_not_disturb" + android:key="zen" + android:title="@string/quick_settings_dnd_label" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_mute" + android:key="mute" + android:title="@string/volume_ringer_status_silent" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_vibrate" + android:key="volume" + android:title="@string/volume_ringer_status_vibrate" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_wifi" + android:key="wifi" + android:title="@string/quick_settings_wifi_label" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_ethernet" + android:key="ethernet" + android:title="@string/status_bar_ethernet" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_mobile_network" + android:key="mobile" + android:title="@string/quick_settings_cellular_detail_title" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_airplanemode" + android:key="airplane" + android:title="@string/status_bar_airplane" /> + + <!-- other weird signal stuff --> + + <com.android.systemui.tuner.BatteryPreference + android:icon="@*android:drawable/ic_battery" + android:title="@string/battery" + android:summary="%s" + android:entries="@array/battery_options" /> + + <com.android.systemui.tuner.StatusBarSwitch + android:icon="@drawable/ic_statusbar_alarm" + android:key="alarm_clock" + android:title="@string/status_bar_alarm" /> + + <!-- secure --> + + <com.android.systemui.tuner.ClockPreference + android:icon="@drawable/ic_statusbar_clock" + android:title="@string/tuner_time" + android:summary="%s" + android:entries="@array/clock_options" /> + + <com.android.systemui.tuner.TunerSwitch + android:icon="@drawable/ic_statusbar_priority" + android:key="low_priority" + android:title="@string/tuner_low_priority" + sysui:defValue="false" /> + +</PreferenceScreen> diff --git a/packages/SystemUI/res/xml/tuner_prefs.xml b/packages/SystemUI/res/xml/tuner_prefs.xml index 902de23a9e2a..aab0b1e8ab51 100644 --- a/packages/SystemUI/res/xml/tuner_prefs.xml +++ b/packages/SystemUI/res/xml/tuner_prefs.xml @@ -20,94 +20,8 @@ <PreferenceScreen android:key="status_bar" - android:title="@string/status_bar" > - - <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" /> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="hotspot" - android:title="@string/quick_settings_hotspot_label" /> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="bluetooth" - android:title="@string/quick_settings_bluetooth_label" /> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="cameratoggle" - android:title="@string/quick_settings_camera_label" /> - - <!-- nfc --> - <!-- tty --> - <!-- speakerphone --> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="zen" - android:title="@string/quick_settings_dnd_label" /> - - <!-- mute --> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="volume" - android:title="@*android:string/volume_unknown" /> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="wifi" - android:title="@string/quick_settings_wifi_label" /> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="ethernet" - android:title="@string/status_bar_ethernet" /> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="mobile" - android:title="@string/quick_settings_cellular_detail_title" /> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="airplane" - android:title="@string/status_bar_airplane" /> - - <!-- other weird signal stuff --> - - <com.android.systemui.tuner.BatteryPreference - android:title="@string/battery" - android:summary="%s" - android:entries="@array/battery_options" /> - - <com.android.systemui.tuner.StatusBarSwitch - android:key="alarm_clock" - android:title="@string/status_bar_alarm" /> - - <!-- secure --> - - <com.android.systemui.tuner.ClockPreference - android:title="@string/tuner_time" - android:summary="%s" - android:entries="@array/clock_options" /> - - <com.android.systemui.tuner.TunerSwitch - android:key="low_priority" - android:title="@string/tuner_low_priority" - sysui:defValue="false" /> - - </PreferenceScreen> + android:title="@string/status_bar" + android:fragment="com.android.systemui.tuner.StatusBarTuner" /> <PreferenceScreen android:key="volume_and_do_not_disturb" diff --git a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java index 246488600eef..fc05d9b5ef02 100644 --- a/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java +++ b/packages/SystemUI/src/com/android/systemui/tuner/DemoModeFragment.java @@ -19,7 +19,6 @@ import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.os.Bundle; -import android.view.MenuItem; import androidx.preference.Preference; import androidx.preference.Preference.OnPreferenceChangeListener; @@ -87,18 +86,6 @@ public class DemoModeFragment extends PreferenceFragment implements OnPreference mDemoModeTracker.startTracking(); updateDemoModeEnabled(); updateDemoModeOn(); - - setHasOptionsMenu(true); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - getFragmentManager().popBackStack(); - break; - } - return super.onOptionsItemSelected(item); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/tuner/StatusBarTuner.java b/packages/SystemUI/src/com/android/systemui/tuner/StatusBarTuner.java new file mode 100644 index 000000000000..c1447e6c7ab4 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/tuner/StatusBarTuner.java @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2017 The LineageOS 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. + */ +package com.android.systemui.tuner; + +import android.os.Bundle; + +import androidx.preference.PreferenceFragment; + +import com.android.internal.logging.MetricsLogger; +import com.android.internal.logging.nano.MetricsProto.MetricsEvent; +import com.android.systemui.R; + +public class StatusBarTuner extends PreferenceFragment { + + @Override + public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { + addPreferencesFromResource(R.xml.status_bar_prefs); + } + + @Override + public void onResume() { + super.onResume(); + MetricsLogger.visibility(getContext(), MetricsEvent.TUNER, true); + } + + @Override + public void onPause() { + super.onPause(); + MetricsLogger.visibility(getContext(), MetricsEvent.TUNER, false); + } +} diff --git a/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java b/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java index 32ecb6786a51..fc91ff129c06 100644 --- a/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java +++ b/packages/SystemUI/src/com/android/systemui/tuner/TunerActivity.java @@ -15,20 +15,17 @@ */ package com.android.systemui.tuner; -import android.app.Activity; import android.app.Fragment; import android.app.FragmentTransaction; import android.os.Bundle; import android.util.Log; -import android.view.MenuItem; -import android.view.Window; -import android.view.WindowManager; -import android.widget.Toolbar; import androidx.preference.Preference; import androidx.preference.PreferenceFragment; import androidx.preference.PreferenceScreen; +import com.android.settingslib.collapsingtoolbar.CollapsingToolbarBaseActivity; + import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.demomode.DemoModeController; @@ -37,7 +34,7 @@ import com.android.systemui.util.settings.GlobalSettings; import javax.inject.Inject; -public class TunerActivity extends Activity implements +public class TunerActivity extends CollapsingToolbarBaseActivity implements PreferenceFragment.OnPreferenceStartFragmentCallback, PreferenceFragment.OnPreferenceStartScreenCallback { @@ -61,23 +58,19 @@ public class TunerActivity extends Activity implements protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setTheme(R.style.Theme_AppCompat_DayNight); - - getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); - requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.tuner_activity); - Toolbar toolbar = findViewById(R.id.action_bar); - if (toolbar != null) { - setActionBar(toolbar); - } if (getFragmentManager().findFragmentByTag(TAG_TUNER) == null) { final String action = getIntent().getAction(); - boolean showDemoMode = action != null && action.equals( - "com.android.settings.action.DEMO_MODE"); - final PreferenceFragment fragment = showDemoMode - ? new DemoModeFragment(mDemoModeController, mGlobalSettings) - : new TunerFragment(mTunerService); + final Fragment fragment; + if ("com.android.settings.action.DEMO_MODE".equals(action)) { + fragment = new DemoModeFragment(mDemoModeController, mGlobalSettings); + } else if ("com.android.settings.action.STATUS_BAR_TUNER".equals(action)) { + fragment = new StatusBarTuner(); + } else { + fragment = new TunerFragment(mTunerService); + } + getFragmentManager().beginTransaction().replace(R.id.content_frame, fragment, TAG_TUNER).commit(); } @@ -90,15 +83,6 @@ public class TunerActivity extends Activity implements } @Override - public boolean onMenuItemSelected(int featureId, MenuItem item) { - if (item.getItemId() == android.R.id.home) { - onBackPressed(); - return true; - } - return super.onMenuItemSelected(featureId, item); - } - - @Override public void onBackPressed() { if (!getFragmentManager().popBackStackImmediate()) { super.onBackPressed(); diff --git a/packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java b/packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java index 989462a9fd34..c1bb0ea68ec7 100644 --- a/packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java +++ b/packages/SystemUI/src/com/android/systemui/tuner/TunerFragment.java @@ -16,17 +16,9 @@ package com.android.systemui.tuner; import android.annotation.SuppressLint; -import android.app.AlertDialog; -import android.app.Dialog; -import android.app.DialogFragment; -import android.content.DialogInterface; import android.hardware.display.AmbientDisplayConfiguration; import android.os.Build; import android.os.Bundle; -import android.provider.Settings; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; import androidx.preference.Preference; import androidx.preference.PreferenceFragment; @@ -53,8 +45,6 @@ public class TunerFragment extends PreferenceFragment { "picture_in_picture", }; - private static final int MENU_REMOVE = Menu.FIRST + 1; - private final TunerService mTunerService; // We are the only ones who ever call this constructor, so don't worry about the warning @@ -67,14 +57,6 @@ public class TunerFragment extends PreferenceFragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - - setHasOptionsMenu(true); - } - - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - getActivity().getActionBar().setDisplayHomeAsUpEnabled(true); } @Override @@ -92,13 +74,6 @@ public class TunerFragment extends PreferenceFragment { if (preference != null) getPreferenceScreen().removePreference(preference); } } - - if (Settings.Secure.getInt(getContext().getContentResolver(), SETTING_SEEN_TUNER_WARNING, - 0) == 0) { - if (getFragmentManager().findFragmentByTag(WARNING_TAG) == null) { - new TunerWarningFragment().show(getFragmentManager(), WARNING_TAG); - } - } } private boolean alwaysOnAvailable() { @@ -119,42 +94,4 @@ public class TunerFragment extends PreferenceFragment { MetricsLogger.visibility(getContext(), MetricsEvent.TUNER, false); } - - @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - menu.add(Menu.NONE, MENU_REMOVE, Menu.NONE, R.string.remove_from_settings); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case android.R.id.home: - getActivity().finish(); - return true; - case MENU_REMOVE: - mTunerService.showResetRequest(() -> { - if (getActivity() != null) { - getActivity().finish(); - } - }); - return true; - } - return super.onOptionsItemSelected(item); - } - - public static class TunerWarningFragment extends DialogFragment { - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - return new AlertDialog.Builder(getContext()) - .setTitle(R.string.tuner_warning_title) - .setMessage(R.string.tuner_warning) - .setPositiveButton(R.string.got_it, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - Settings.Secure.putInt(getContext().getContentResolver(), - SETTING_SEEN_TUNER_WARNING, 1); - } - }).show(); - } - } } |