private int mLockscreenSelectedValue;
private ComponentName mSuppressor;
private int mRingerMode = -1;
-
+ private SwitchPreference mVolumeLinkNotificationSwitch;
private UserManager mUserManager;
@Override
mRingPreference =
initVolumePreference(KEY_RING_VOLUME, AudioManager.STREAM_RING,
com.android.internal.R.drawable.ic_audio_ring_notif_mute);
+ mVolumeLinkNotificationSwitch = (SwitchPreference)
+ volumes.findPreference(KEY_VOLUME_LINK_NOTIFICATION);
} else {
volumes.removePreference(volumes.findPreference(KEY_RING_VOLUME));
volumes.removePreference(volumes.findPreference(KEY_VOLUME_LINK_NOTIFICATION));
}
private void updateNotificationPreferenceState() {
- mNotificationPreference = initVolumePreference(KEY_NOTIFICATION_VOLUME,
- AudioManager.STREAM_NOTIFICATION,
- com.android.internal.R.drawable.ic_audio_ring_notif_mute);
+ if (mNotificationPreference == null) {
+ mNotificationPreference = initVolumePreference(KEY_NOTIFICATION_VOLUME,
+ AudioManager.STREAM_NOTIFICATION,
+ com.android.internal.R.drawable.ic_audio_ring_notif_mute);
+ }
if (mVoiceCapable) {
- final boolean enabled = Settings.System.getInt(getContentResolver(),
+ final boolean enabled = Settings.Secure.getInt(getContentResolver(),
Settings.Secure.VOLUME_LINK_NOTIFICATION, 1) == 1;
-
- if (mNotificationPreference != null) {
- boolean show = !enabled;
- mNotificationPreference.setEnabled(show);
+ if (mVolumeLinkNotificationSwitch != null){
+ mVolumeLinkNotificationSwitch.setChecked(enabled);
}
}
}