Move "Pulse notification light" to Display settings.
Bug: 5242350 Change-Id: I91cb23ca8f49c1c053710031b0316b10d55fbab4
This commit is contained in:
@@ -55,4 +55,9 @@
|
|||||||
android:entryValues="@array/entryvalues_font_size"
|
android:entryValues="@array/entryvalues_font_size"
|
||||||
android:dialogTitle="@string/dialog_title_font_size" />
|
android:dialogTitle="@string/dialog_title_font_size" />
|
||||||
|
|
||||||
|
<CheckBoxPreference
|
||||||
|
android:key="notification_pulse"
|
||||||
|
android:title="@string/notification_pulse_title"
|
||||||
|
android:persistent="false" />
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
@@ -89,11 +89,6 @@
|
|||||||
android:title="@string/haptic_feedback_enable_title"
|
android:title="@string/haptic_feedback_enable_title"
|
||||||
android:defaultValue="true" />
|
android:defaultValue="true" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:key="notification_pulse"
|
|
||||||
android:title="@string/notification_pulse_title"
|
|
||||||
android:persistent="false" />
|
|
||||||
|
|
||||||
<ListPreference
|
<ListPreference
|
||||||
android:key="emergency_tone"
|
android:key="emergency_tone"
|
||||||
android:title="@string/emergency_tone_title"
|
android:title="@string/emergency_tone_title"
|
||||||
|
@@ -33,6 +33,7 @@ import android.preference.ListPreference;
|
|||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.provider.Settings.SettingNotFoundException;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -47,9 +48,11 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
|
|||||||
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout";
|
private static final String KEY_SCREEN_TIMEOUT = "screen_timeout";
|
||||||
private static final String KEY_ACCELEROMETER = "accelerometer";
|
private static final String KEY_ACCELEROMETER = "accelerometer";
|
||||||
private static final String KEY_FONT_SIZE = "font_size";
|
private static final String KEY_FONT_SIZE = "font_size";
|
||||||
|
private static final String KEY_NOTIFICATION_PULSE = "notification_pulse";
|
||||||
|
|
||||||
private CheckBoxPreference mAccelerometer;
|
private CheckBoxPreference mAccelerometer;
|
||||||
private ListPreference mFontSizePref;
|
private ListPreference mFontSizePref;
|
||||||
|
private CheckBoxPreference mNotificationPulse;
|
||||||
|
|
||||||
private final Configuration mCurConfig = new Configuration();
|
private final Configuration mCurConfig = new Configuration();
|
||||||
|
|
||||||
@@ -82,6 +85,20 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
|
|||||||
|
|
||||||
mFontSizePref = (ListPreference) findPreference(KEY_FONT_SIZE);
|
mFontSizePref = (ListPreference) findPreference(KEY_FONT_SIZE);
|
||||||
mFontSizePref.setOnPreferenceChangeListener(this);
|
mFontSizePref.setOnPreferenceChangeListener(this);
|
||||||
|
mNotificationPulse = (CheckBoxPreference) findPreference(KEY_NOTIFICATION_PULSE);
|
||||||
|
if (mNotificationPulse != null
|
||||||
|
&& getResources().getBoolean(
|
||||||
|
com.android.internal.R.bool.config_intrusiveNotificationLed) == false) {
|
||||||
|
getPreferenceScreen().removePreference(mNotificationPulse);
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
mNotificationPulse.setChecked(Settings.System.getInt(resolver,
|
||||||
|
Settings.System.NOTIFICATION_LIGHT_PULSE) == 1);
|
||||||
|
mNotificationPulse.setOnPreferenceChangeListener(this);
|
||||||
|
} catch (SettingNotFoundException snfe) {
|
||||||
|
Log.e(TAG, Settings.System.NOTIFICATION_LIGHT_PULSE + " not found");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateTimeoutPreferenceDescription(long currentTimeout) {
|
private void updateTimeoutPreferenceDescription(long currentTimeout) {
|
||||||
@@ -216,6 +233,11 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
|
|||||||
Settings.System.putInt(getContentResolver(),
|
Settings.System.putInt(getContentResolver(),
|
||||||
Settings.System.ACCELEROMETER_ROTATION,
|
Settings.System.ACCELEROMETER_ROTATION,
|
||||||
mAccelerometer.isChecked() ? 1 : 0);
|
mAccelerometer.isChecked() ? 1 : 0);
|
||||||
|
} else if (preference == mNotificationPulse) {
|
||||||
|
boolean value = mNotificationPulse.isChecked();
|
||||||
|
Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_PULSE,
|
||||||
|
value ? 1 : 0);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return super.onPreferenceTreeClick(preferenceScreen, preference);
|
return super.onPreferenceTreeClick(preferenceScreen, preference);
|
||||||
}
|
}
|
||||||
|
@@ -64,7 +64,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
private static final String KEY_HAPTIC_FEEDBACK = "haptic_feedback";
|
private static final String KEY_HAPTIC_FEEDBACK = "haptic_feedback";
|
||||||
private static final String KEY_EMERGENCY_TONE = "emergency_tone";
|
private static final String KEY_EMERGENCY_TONE = "emergency_tone";
|
||||||
private static final String KEY_SOUND_SETTINGS = "sound_settings";
|
private static final String KEY_SOUND_SETTINGS = "sound_settings";
|
||||||
private static final String KEY_NOTIFICATION_PULSE = "notification_pulse";
|
|
||||||
private static final String KEY_LOCK_SOUNDS = "lock_sounds";
|
private static final String KEY_LOCK_SOUNDS = "lock_sounds";
|
||||||
private static final String KEY_RINGTONE = "ringtone";
|
private static final String KEY_RINGTONE = "ringtone";
|
||||||
private static final String KEY_NOTIFICATION_SOUND = "notification_sound";
|
private static final String KEY_NOTIFICATION_SOUND = "notification_sound";
|
||||||
@@ -96,7 +95,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
private CheckBoxPreference mDtmfTone;
|
private CheckBoxPreference mDtmfTone;
|
||||||
private CheckBoxPreference mSoundEffects;
|
private CheckBoxPreference mSoundEffects;
|
||||||
private CheckBoxPreference mHapticFeedback;
|
private CheckBoxPreference mHapticFeedback;
|
||||||
private CheckBoxPreference mNotificationPulse;
|
|
||||||
private Preference mMusicFx;
|
private Preference mMusicFx;
|
||||||
private CheckBoxPreference mLockSounds;
|
private CheckBoxPreference mLockSounds;
|
||||||
private Preference mRingtonePreference;
|
private Preference mRingtonePreference;
|
||||||
@@ -188,21 +186,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
mSoundSettings = (PreferenceGroup) findPreference(KEY_SOUND_SETTINGS);
|
mSoundSettings = (PreferenceGroup) findPreference(KEY_SOUND_SETTINGS);
|
||||||
mNotificationPulse = (CheckBoxPreference)
|
|
||||||
mSoundSettings.findPreference(KEY_NOTIFICATION_PULSE);
|
|
||||||
if (mNotificationPulse != null
|
|
||||||
&& getResources().getBoolean(
|
|
||||||
com.android.internal.R.bool.config_intrusiveNotificationLed) == false) {
|
|
||||||
mSoundSettings.removePreference(mNotificationPulse);
|
|
||||||
} else {
|
|
||||||
try {
|
|
||||||
mNotificationPulse.setChecked(Settings.System.getInt(resolver,
|
|
||||||
Settings.System.NOTIFICATION_LIGHT_PULSE) == 1);
|
|
||||||
mNotificationPulse.setOnPreferenceChangeListener(this);
|
|
||||||
} catch (SettingNotFoundException snfe) {
|
|
||||||
Log.e(TAG, Settings.System.NOTIFICATION_LIGHT_PULSE + " not found");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mMusicFx = mSoundSettings.findPreference(KEY_MUSICFX);
|
mMusicFx = mSoundSettings.findPreference(KEY_MUSICFX);
|
||||||
Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
|
Intent i = new Intent(AudioEffect.ACTION_DISPLAY_AUDIO_EFFECT_CONTROL_PANEL);
|
||||||
@@ -418,10 +401,6 @@ public class SoundSettings extends SettingsPreferenceFragment implements
|
|||||||
Settings.System.putInt(getContentResolver(), Settings.System.LOCKSCREEN_SOUNDS_ENABLED,
|
Settings.System.putInt(getContentResolver(), Settings.System.LOCKSCREEN_SOUNDS_ENABLED,
|
||||||
mLockSounds.isChecked() ? 1 : 0);
|
mLockSounds.isChecked() ? 1 : 0);
|
||||||
|
|
||||||
} else if (preference == mNotificationPulse) {
|
|
||||||
boolean value = mNotificationPulse.isChecked();
|
|
||||||
Settings.System.putInt(getContentResolver(),
|
|
||||||
Settings.System.NOTIFICATION_LIGHT_PULSE, value ? 1 : 0);
|
|
||||||
} else if (preference == mMusicFx) {
|
} else if (preference == mMusicFx) {
|
||||||
// let the framework fire off the intent
|
// let the framework fire off the intent
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user