OSDN Git Service

Do not display volume settings if volume is fixed
authorEric Laurent <elaurent@google.com>
Wed, 20 Mar 2013 01:24:47 +0000 (18:24 -0700)
committerEric Laurent <elaurent@google.com>
Fri, 22 Mar 2013 00:40:20 +0000 (17:40 -0700)
When the configuration option config_useFixedVolume is true
indicating that stream volumes cannot be modified, the volume
settings submenu is not available.

Bug 8161458

Change-Id: I6d76a2f85c642778ae8c4caa7347b50f659c1def

src/com/android/settings/SoundSettings.java

index 931858c..28d93f1 100644 (file)
@@ -145,6 +145,11 @@ public class SoundSettings extends SettingsPreferenceFragment implements
             findPreference(KEY_RING_VOLUME).setDependency(null);
         }
 
+        if (getResources().getBoolean(com.android.internal.R.bool.config_useFixedVolume)) {
+            // device with fixed volume policy, do not display volumes submenu
+            getPreferenceScreen().removePreference(findPreference(KEY_RING_VOLUME));
+        }
+
         mVibrateWhenRinging = (CheckBoxPreference) findPreference(KEY_VIBRATE);
         mVibrateWhenRinging.setPersistent(false);
         mVibrateWhenRinging.setChecked(Settings.System.getInt(resolver,