From 9fce1af240d23734aa6a3c4787b810a5e0477790 Mon Sep 17 00:00:00 2001 From: Rashed Abdel-Tawab Date: Wed, 18 Oct 2017 20:33:08 -0400 Subject: SystemUI: Bringup tuner statusbar changes Based on the following changes: Author: Steve Kondik 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 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 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 Author: Gabriele M 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 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 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 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 Date: Thu Oct 21 10:31:56 2021 +0000 Adapt tuner prefs to S settings style & cleanup Co-authored-by: Michael Bestas Change-Id: Icadd13a00e4d3e649b50f405ed0c8c76081be200 Change-Id: I4ab0b4d18dcf0080dea665b63137c19a0e57aa07 --- packages/SystemUI/Android.bp | 1 + packages/SystemUI/AndroidManifest.xml | 4 +- packages/SystemUI/IceManifest.xml | 39 +++++++ .../res/drawable/ic_statusbar_airplanemode.xml | 25 ++++ .../SystemUI/res/drawable/ic_statusbar_alarm.xml | 25 ++++ .../res/drawable/ic_statusbar_auto_rotate.xml | 27 +++++ .../SystemUI/res/drawable/ic_statusbar_camera.xml | 25 ++++ .../SystemUI/res/drawable/ic_statusbar_cast.xml | 25 ++++ .../SystemUI/res/drawable/ic_statusbar_clock.xml | 28 +++++ .../res/drawable/ic_statusbar_do_not_disturb.xml | 28 +++++ .../res/drawable/ic_statusbar_ethernet.xml | 34 ++++++ .../SystemUI/res/drawable/ic_statusbar_headset.xml | 25 ++++ .../SystemUI/res/drawable/ic_statusbar_hotspot.xml | 32 ++++++ .../res/drawable/ic_statusbar_mobile_network.xml | 26 +++++ .../SystemUI/res/drawable/ic_statusbar_mute.xml | 26 +++++ .../res/drawable/ic_statusbar_priority.xml | 27 +++++ .../SystemUI/res/drawable/ic_statusbar_vibrate.xml | 26 +++++ .../SystemUI/res/drawable/ic_statusbar_wifi.xml | 26 +++++ .../SystemUI/res/drawable/ic_statusbar_work.xml | 26 +++++ packages/SystemUI/res/layout/tuner_activity.xml | 7 -- packages/SystemUI/res/values/ice_strings.xml | 3 + packages/SystemUI/res/xml/status_bar_prefs.xml | 126 +++++++++++++++++++++ packages/SystemUI/res/xml/tuner_prefs.xml | 90 +-------------- .../android/systemui/tuner/DemoModeFragment.java | 13 --- .../com/android/systemui/tuner/StatusBarTuner.java | 44 +++++++ .../com/android/systemui/tuner/TunerActivity.java | 40 ++----- .../com/android/systemui/tuner/TunerFragment.java | 63 ----------- 27 files changed, 660 insertions(+), 201 deletions(-) create mode 100644 packages/SystemUI/IceManifest.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_airplanemode.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_alarm.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_auto_rotate.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_camera.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_cast.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_clock.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_do_not_disturb.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_ethernet.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_headset.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_hotspot.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_mobile_network.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_mute.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_priority.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_vibrate.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_wifi.xml create mode 100644 packages/SystemUI/res/drawable/ic_statusbar_work.xml create mode 100644 packages/SystemUI/res/xml/status_bar_prefs.xml create mode 100644 packages/SystemUI/src/com/android/systemui/tuner/StatusBarTuner.java 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 @@ @@ -453,7 +453,7 @@ 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 @@ + + + + + + + + + + + + + + + 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 @@ + + + + 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 @@ + + + + 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 @@ + + + + + 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 @@ + + + + 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 @@ + + + + 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 @@ + + + + + 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 @@ + + + + + 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 @@ + + + + + + + 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 @@ + + + + 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 @@ + + + + + + + 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 @@ + + + + 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 @@ + + + + + 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 @@ + + + + + + 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 @@ + + + + + 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 @@ + + + + + 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 @@ + + + + + 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"> - + + Status bar icons + AOD 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + android:title="@string/status_bar" + android:fragment="com.android.systemui.tuner.StatusBarTuner" /> s.destroyAll()); } - @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()) { 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(); - } - } } -- cgit v1.2.3