From aea68994431560d8c8a36d025cd4cb2fa09cc929 Mon Sep 17 00:00:00 2001 From: Adithya R Date: Sat, 4 Nov 2023 21:36:46 +0530 Subject: [PATCH] ParanoidSystemUI: SoundTile: Add speaker icons Show it when ringer and notification volumes are separated, according to rest of the UI. Change-Id: I9428f62df667c846c5d643c027923806880ebe52 --- res/drawable/ic_qs_speaker_audible.xml | 24 +++++++++++++++++++ res/drawable/ic_qs_speaker_silent.xml | 24 +++++++++++++++++++ src/co/aospa/systemui/qs/tiles/SoundTile.java | 11 +++++++-- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 res/drawable/ic_qs_speaker_audible.xml create mode 100644 res/drawable/ic_qs_speaker_silent.xml diff --git a/res/drawable/ic_qs_speaker_audible.xml b/res/drawable/ic_qs_speaker_audible.xml new file mode 100644 index 0000000..5d5e2ab --- /dev/null +++ b/res/drawable/ic_qs_speaker_audible.xml @@ -0,0 +1,24 @@ + + + + diff --git a/res/drawable/ic_qs_speaker_silent.xml b/res/drawable/ic_qs_speaker_silent.xml new file mode 100644 index 0000000..da475f4 --- /dev/null +++ b/res/drawable/ic_qs_speaker_silent.xml @@ -0,0 +1,24 @@ + + + + diff --git a/src/co/aospa/systemui/qs/tiles/SoundTile.java b/src/co/aospa/systemui/qs/tiles/SoundTile.java index 8032ef5..f079ebd 100644 --- a/src/co/aospa/systemui/qs/tiles/SoundTile.java +++ b/src/co/aospa/systemui/qs/tiles/SoundTile.java @@ -133,7 +133,8 @@ public class SoundTile extends QSTileImpl { } switch (mAudioManager.getRingerModeInternal()) { case AudioManager.RINGER_MODE_NORMAL: - state.icon = ResourceIcon.get(R.drawable.ic_qs_ringer_audible); + state.icon = ResourceIcon.get(isSeparateNotification() + ? R.drawable.ic_qs_speaker_audible : R.drawable.ic_qs_ringer_audible); state.secondaryLabel = mContext.getString(R.string.quick_settings_sound_ring); state.state = Tile.STATE_ACTIVE; break; @@ -143,7 +144,8 @@ public class SoundTile extends QSTileImpl { state.state = Tile.STATE_INACTIVE; break; case AudioManager.RINGER_MODE_SILENT: - state.icon = ResourceIcon.get(R.drawable.ic_qs_ringer_silent); + state.icon = ResourceIcon.get(isSeparateNotification() + ? R.drawable.ic_qs_speaker_silent : R.drawable.ic_qs_ringer_silent); state.secondaryLabel = mContext.getString(R.string.quick_settings_sound_silent); state.state = Tile.STATE_INACTIVE; break; @@ -154,4 +156,9 @@ public class SoundTile extends QSTileImpl { public int getMetricsCategory() { return -1; } + + private boolean isSeparateNotification() { + return Settings.System.getInt(mContext.getContentResolver(), + Settings.System.VOLUME_SEPARATE_NOTIFICATION, 0) == 1; + } }