Volumes panel shouldn't depend on Silent mode setting.

Otherwise it wont be possible to adjust alarm and music volumes.
Also fixes an inconsistent state when screen is turned off and on.

Bug: 5128528
Bug: 5128850

Change-Id: I3bfae44956de291b086905b9f43ca4ff5c7b9bbf
diff --git a/res/xml/sound_settings.xml b/res/xml/sound_settings.xml
index d5f0e6b..a13d6fc 100644
--- a/res/xml/sound_settings.xml
+++ b/res/xml/sound_settings.xml
@@ -21,7 +21,6 @@
 
     <com.android.settings.RingerVolumePreference
             android:key="ring_volume"
-            android:dependency="silent"
             android:title="@string/all_volume_title"
             android:dialogTitle="@string/all_volume_title"
             android:persistent="false"
@@ -37,7 +36,7 @@
             android:key="silent"
             android:title="@string/silent_mode_title"
             android:persistent="false"
-            android:disableDependentsState="true" />
+            />
 
     <Preference
             android:key="musicfx"
diff --git a/src/com/android/settings/RingerVolumePreference.java b/src/com/android/settings/RingerVolumePreference.java
index 129edee..eceb594 100644
--- a/src/com/android/settings/RingerVolumePreference.java
+++ b/src/com/android/settings/RingerVolumePreference.java
@@ -182,8 +182,8 @@
                 public void onReceive(Context context, Intent intent) {
                     final String action = intent.getAction();
                     if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) {
-                        mHandler.sendMessage(mHandler.obtainMessage(MSG_RINGER_MODE_CHANGED,
-                                intent.getIntExtra(AudioManager.EXTRA_RINGER_MODE, -1), 0));
+                        mHandler.sendMessage(mHandler.obtainMessage(MSG_RINGER_MODE_CHANGED, intent
+                                .getIntExtra(AudioManager.EXTRA_RINGER_MODE, -1), 0));
                     }
                 }
             };
@@ -222,7 +222,10 @@
     @Override
     public void onActivityStop() {
         super.onActivityStop();
-        cleanup();
+
+        for (SeekBarVolumizer vol : mSeekBarVolumizer) {
+            if (vol != null) vol.stopSample();
+        }
     }
 
     @Override