diff options
author | Luis Vidal <lvidal@cyngn.com> | 2016-05-11 16:58:54 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-05-13 13:49:54 -0700 |
commit | fe6c6f31fc807aa221fa6f46d12d303dfe411d24 (patch) | |
tree | c108d687ba371f25a88aaa68a9d359715a82bb6e /src/com/android/settings/profiles | |
parent | c15b40696b535c39615a34017f648f601573b0e0 (diff) | |
download | packages_apps_Settings-fe6c6f31fc807aa221fa6f46d12d303dfe411d24.zip packages_apps_Settings-fe6c6f31fc807aa221fa6f46d12d303dfe411d24.tar.gz packages_apps_Settings-fe6c6f31fc807aa221fa6f46d12d303dfe411d24.tar.bz2 |
Profiles: Disable notification item if ringtone & notification volumes are linked
The notification item will be disabled if the notification and
ringtone volumes are linked. This is to keep consistency with the
sound settings
Change-Id: Ibbe7612eae5e9b7b18d63450ab8331f02becf5ca
TICKET: CYNGNOS-958
Diffstat (limited to 'src/com/android/settings/profiles')
-rw-r--r-- | src/com/android/settings/profiles/actions/item/VolumeStreamItem.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/settings/profiles/actions/item/VolumeStreamItem.java b/src/com/android/settings/profiles/actions/item/VolumeStreamItem.java index 9bcf2ef..f4d76c7 100644 --- a/src/com/android/settings/profiles/actions/item/VolumeStreamItem.java +++ b/src/com/android/settings/profiles/actions/item/VolumeStreamItem.java @@ -17,6 +17,7 @@ package com.android.settings.profiles.actions.item; import android.content.Context; import android.media.AudioManager; +import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -30,6 +31,7 @@ import com.android.settings.profiles.actions.ItemListAdapter; public class VolumeStreamItem implements Item { private int mStreamId; private StreamSettings mStreamSettings; + private boolean mEnabled; public VolumeStreamItem(int streamId, StreamSettings streamSettings) { mStreamId = streamId; @@ -43,7 +45,7 @@ public class VolumeStreamItem implements Item { @Override public boolean isEnabled() { - return true; + return mEnabled; } @Override @@ -72,6 +74,15 @@ public class VolumeStreamItem implements Item { desc.setText(context.getString(R.string.profile_action_none)); } + final boolean volumeLinkNotification = Settings.Secure.getInt(context + .getContentResolver(), Settings.Secure.VOLUME_LINK_NOTIFICATION, 1) == 1; + mEnabled = true; + if (mStreamId == AudioManager.STREAM_NOTIFICATION && volumeLinkNotification) { + mEnabled = false; + text.setEnabled(false); + desc.setEnabled(false); + } + return view; } |