Loading res/values/strings.xml +12 −0 Original line number Diff line number Diff line Loading @@ -1062,6 +1062,18 @@ <string name="notification_pulse_title">Pulse notification light</string> <!-- Sound settings screen, notification light repeat pulsing summary --> <string name="notification_pulse_summary">Pulse trackball light repeatedly for new notifications</string> <!-- Display settings screen, notification light repeat blinking title --> <string name="notification_blink_title">Blink notification light</string> <!-- Display settings screen, notification light repeat blinking summary --> <string name="notification_blink_summary">Blink the green notifications repeatedly</string> <!-- Display settings screen, notification light always on title --> <string name="notification_always_on_title">Always enable notification light</string> <!-- Display settings screen, notification light always on summary --> <string name="notification_always_on_summary">Enable notification light while screen is on</string> <!-- Display settings screen, notification light while charging title --> <string name="notification_charging_title">Charging light</string> <!-- Display settings screen, notification light while charging summary --> <string name="notification_charging_summary">Enable the amber light while charging</string> <!-- Sound settings screen, the title of the volume bar to adjust the incoming call volume --> <string name="incoming_call_volume_title">Ringtone</string> <!-- Sound settings screen, the title of the volume bar to adjust the notification volume --> Loading res/xml/sound_settings.xml +18 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,24 @@ android:summary="@string/notification_pulse_summary" android:persistent="false" /> <CheckBoxPreference android:key="notification_blink" android:title="@string/notification_blink_title" android:summary="@string/notification_blink_summary" android:persistent="false" /> <CheckBoxPreference android:key="notification_always_on" android:title="@string/notification_always_on_title" android:summary="@string/notification_always_on_summary" android:persistent="false" /> <CheckBoxPreference android:key="notification_charging" android:title="@string/notification_charging_title" android:summary="@string/notification_charging_summary" android:persistent="false" /> <PreferenceCategory android:title="@string/sound_category_feedback_title"/> Loading src/com/android/settings/SoundSettings.java +60 −9 Original line number Diff line number Diff line Loading @@ -55,6 +55,9 @@ public class SoundSettings extends PreferenceActivity implements private static final String KEY_EMERGENCY_TONE = "emergency_tone"; private static final String KEY_SOUND_SETTINGS = "sound_settings"; private static final String KEY_NOTIFICATION_PULSE = "notification_pulse"; private static final String KEY_NOTIFICATION_BLINK = "notification_blink"; private static final String KEY_NOTIFICATION_ALWAYS_ON = "notification_always_on"; private static final String KEY_NOTIFICATION_CHARGING = "notification_charging"; private static final String KEY_LOCK_SOUNDS = "lock_sounds"; private static final String VALUE_VIBRATE_NEVER = "never"; Loading @@ -76,6 +79,9 @@ public class SoundSettings extends PreferenceActivity implements private CheckBoxPreference mSoundEffects; private CheckBoxPreference mHapticFeedback; private CheckBoxPreference mNotificationPulse; private CheckBoxPreference mNotificationBlink; private CheckBoxPreference mNotificationAlwaysOn; private CheckBoxPreference mNotificationCharging; private CheckBoxPreference mLockSounds; private AudioManager mAudioManager; Loading Loading @@ -139,6 +145,36 @@ public class SoundSettings extends PreferenceActivity implements mSoundSettings = (PreferenceGroup) findPreference(KEY_SOUND_SETTINGS); mNotificationPulse = (CheckBoxPreference) mSoundSettings.findPreference(KEY_NOTIFICATION_PULSE); mNotificationBlink = (CheckBoxPreference) mSoundSettings.findPreference(KEY_NOTIFICATION_BLINK); mNotificationAlwaysOn = (CheckBoxPreference) mSoundSettings.findPreference(KEY_NOTIFICATION_ALWAYS_ON); mNotificationCharging = (CheckBoxPreference) mSoundSettings.findPreference(KEY_NOTIFICATION_CHARGING); boolean amberGreenLight = getResources().getBoolean( com.android.internal.R.bool.config_amber_green_light); if (amberGreenLight) { mSoundSettings.removePreference(mNotificationPulse); mNotificationBlink.setChecked(Settings.System.getInt(resolver, Settings.System.NOTIFICATION_LIGHT_BLINK, 1) == 1); mNotificationBlink.setOnPreferenceChangeListener(this); mNotificationAlwaysOn.setChecked(Settings.System.getInt(resolver, Settings.System.NOTIFICATION_LIGHT_ALWAYS_ON, 1) == 1); mNotificationAlwaysOn.setOnPreferenceChangeListener(this); mNotificationCharging.setChecked(Settings.System.getInt(resolver, Settings.System.NOTIFICATION_LIGHT_CHARGING, 1) == 1); mNotificationCharging.setOnPreferenceChangeListener(this); } else { mSoundSettings.removePreference(mNotificationBlink); mSoundSettings.removePreference(mNotificationAlwaysOn); mSoundSettings.removePreference(mNotificationCharging); if (mNotificationPulse != null && getResources().getBoolean(R.bool.has_intrusive_led) == false) { mSoundSettings.removePreference(mNotificationPulse); Loading @@ -151,6 +187,7 @@ public class SoundSettings extends PreferenceActivity implements Log.e(TAG, Settings.System.NOTIFICATION_LIGHT_PULSE + " not found"); } } } } Loading Loading @@ -312,8 +349,22 @@ public class SoundSettings extends PreferenceActivity implements boolean value = mNotificationPulse.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_PULSE, value ? 1 : 0); } } else if (preference == mNotificationBlink) { boolean value = mNotificationBlink.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_BLINK, value ? 1 : 0); } else if (preference == mNotificationAlwaysOn) { boolean value = mNotificationAlwaysOn.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_ALWAYS_ON, value ? 1 : 0); } else if (preference == mNotificationCharging) { boolean value = mNotificationCharging.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_CHARGING, value ? 1 : 0); } return true; } Loading Loading
res/values/strings.xml +12 −0 Original line number Diff line number Diff line Loading @@ -1062,6 +1062,18 @@ <string name="notification_pulse_title">Pulse notification light</string> <!-- Sound settings screen, notification light repeat pulsing summary --> <string name="notification_pulse_summary">Pulse trackball light repeatedly for new notifications</string> <!-- Display settings screen, notification light repeat blinking title --> <string name="notification_blink_title">Blink notification light</string> <!-- Display settings screen, notification light repeat blinking summary --> <string name="notification_blink_summary">Blink the green notifications repeatedly</string> <!-- Display settings screen, notification light always on title --> <string name="notification_always_on_title">Always enable notification light</string> <!-- Display settings screen, notification light always on summary --> <string name="notification_always_on_summary">Enable notification light while screen is on</string> <!-- Display settings screen, notification light while charging title --> <string name="notification_charging_title">Charging light</string> <!-- Display settings screen, notification light while charging summary --> <string name="notification_charging_summary">Enable the amber light while charging</string> <!-- Sound settings screen, the title of the volume bar to adjust the incoming call volume --> <string name="incoming_call_volume_title">Ringtone</string> <!-- Sound settings screen, the title of the volume bar to adjust the notification volume --> Loading
res/xml/sound_settings.xml +18 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,24 @@ android:summary="@string/notification_pulse_summary" android:persistent="false" /> <CheckBoxPreference android:key="notification_blink" android:title="@string/notification_blink_title" android:summary="@string/notification_blink_summary" android:persistent="false" /> <CheckBoxPreference android:key="notification_always_on" android:title="@string/notification_always_on_title" android:summary="@string/notification_always_on_summary" android:persistent="false" /> <CheckBoxPreference android:key="notification_charging" android:title="@string/notification_charging_title" android:summary="@string/notification_charging_summary" android:persistent="false" /> <PreferenceCategory android:title="@string/sound_category_feedback_title"/> Loading
src/com/android/settings/SoundSettings.java +60 −9 Original line number Diff line number Diff line Loading @@ -55,6 +55,9 @@ public class SoundSettings extends PreferenceActivity implements private static final String KEY_EMERGENCY_TONE = "emergency_tone"; private static final String KEY_SOUND_SETTINGS = "sound_settings"; private static final String KEY_NOTIFICATION_PULSE = "notification_pulse"; private static final String KEY_NOTIFICATION_BLINK = "notification_blink"; private static final String KEY_NOTIFICATION_ALWAYS_ON = "notification_always_on"; private static final String KEY_NOTIFICATION_CHARGING = "notification_charging"; private static final String KEY_LOCK_SOUNDS = "lock_sounds"; private static final String VALUE_VIBRATE_NEVER = "never"; Loading @@ -76,6 +79,9 @@ public class SoundSettings extends PreferenceActivity implements private CheckBoxPreference mSoundEffects; private CheckBoxPreference mHapticFeedback; private CheckBoxPreference mNotificationPulse; private CheckBoxPreference mNotificationBlink; private CheckBoxPreference mNotificationAlwaysOn; private CheckBoxPreference mNotificationCharging; private CheckBoxPreference mLockSounds; private AudioManager mAudioManager; Loading Loading @@ -139,6 +145,36 @@ public class SoundSettings extends PreferenceActivity implements mSoundSettings = (PreferenceGroup) findPreference(KEY_SOUND_SETTINGS); mNotificationPulse = (CheckBoxPreference) mSoundSettings.findPreference(KEY_NOTIFICATION_PULSE); mNotificationBlink = (CheckBoxPreference) mSoundSettings.findPreference(KEY_NOTIFICATION_BLINK); mNotificationAlwaysOn = (CheckBoxPreference) mSoundSettings.findPreference(KEY_NOTIFICATION_ALWAYS_ON); mNotificationCharging = (CheckBoxPreference) mSoundSettings.findPreference(KEY_NOTIFICATION_CHARGING); boolean amberGreenLight = getResources().getBoolean( com.android.internal.R.bool.config_amber_green_light); if (amberGreenLight) { mSoundSettings.removePreference(mNotificationPulse); mNotificationBlink.setChecked(Settings.System.getInt(resolver, Settings.System.NOTIFICATION_LIGHT_BLINK, 1) == 1); mNotificationBlink.setOnPreferenceChangeListener(this); mNotificationAlwaysOn.setChecked(Settings.System.getInt(resolver, Settings.System.NOTIFICATION_LIGHT_ALWAYS_ON, 1) == 1); mNotificationAlwaysOn.setOnPreferenceChangeListener(this); mNotificationCharging.setChecked(Settings.System.getInt(resolver, Settings.System.NOTIFICATION_LIGHT_CHARGING, 1) == 1); mNotificationCharging.setOnPreferenceChangeListener(this); } else { mSoundSettings.removePreference(mNotificationBlink); mSoundSettings.removePreference(mNotificationAlwaysOn); mSoundSettings.removePreference(mNotificationCharging); if (mNotificationPulse != null && getResources().getBoolean(R.bool.has_intrusive_led) == false) { mSoundSettings.removePreference(mNotificationPulse); Loading @@ -151,6 +187,7 @@ public class SoundSettings extends PreferenceActivity implements Log.e(TAG, Settings.System.NOTIFICATION_LIGHT_PULSE + " not found"); } } } } Loading Loading @@ -312,8 +349,22 @@ public class SoundSettings extends PreferenceActivity implements boolean value = mNotificationPulse.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_PULSE, value ? 1 : 0); } } else if (preference == mNotificationBlink) { boolean value = mNotificationBlink.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_BLINK, value ? 1 : 0); } else if (preference == mNotificationAlwaysOn) { boolean value = mNotificationAlwaysOn.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_ALWAYS_ON, value ? 1 : 0); } else if (preference == mNotificationCharging) { boolean value = mNotificationCharging.isChecked(); Settings.System.putInt(getContentResolver(), Settings.System.NOTIFICATION_LIGHT_CHARGING, value ? 1 : 0); } return true; } Loading