diff options
author | Altaf-Mahdi <altaf.mahdi@gmail.com> | 2015-10-16 09:45:18 +0100 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2015-11-07 13:35:30 -0800 |
commit | 127e2e8390ba31afe280ea77869be768a9b78eeb (patch) | |
tree | c406d3af124345c36b433bc2912686fe9b44cf82 | |
parent | da6e5f9100aca5c698e1a3f56a182bbd5d5fd699 (diff) | |
download | packages_apps_Settings-127e2e8390ba31afe280ea77869be768a9b78eeb.zip packages_apps_Settings-127e2e8390ba31afe280ea77869be768a9b78eeb.tar.gz packages_apps_Settings-127e2e8390ba31afe280ea77869be768a9b78eeb.tar.bz2 |
Settings: set a notification when forcing LED on
Fixes
AndroidRuntime: java.lang.IllegalArgumentException:
Invalid notification (no valid small icon):
Change-Id: I1375ed394762eaf820d21ad79a22c01c0ae88e31
-rw-r--r-- | res/values/cm_strings.xml | 4 | ||||
-rw-r--r-- | src/com/android/settings/notificationlight/LightSettingsDialog.java | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index cb40b7d..cd86275 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -309,6 +309,10 @@ <string name="notification_light_missed_call_title">Missed call</string> <string name="notification_light_voicemail_title">Voicemail</string> + <!-- Lights settings, LED notification --> + <string name="led_notification_title">Light settings</string> + <string name="led_notification_text">LED light enabled by settings</string> + <!-- Setting checkbox title for Whether to enable Android debugging support on the phone. --> <string name="enable_adb_cm">Android debugging</string> <!-- Setting checkbox summary for Whether to enable Android debugging support on the phone --> diff --git a/src/com/android/settings/notificationlight/LightSettingsDialog.java b/src/com/android/settings/notificationlight/LightSettingsDialog.java index ad3b7eb..faecf62 100644 --- a/src/com/android/settings/notificationlight/LightSettingsDialog.java +++ b/src/com/android/settings/notificationlight/LightSettingsDialog.java @@ -294,6 +294,12 @@ public class LightSettingsDialog extends AlertDialog implements builder.setLights(color, speedOn, speedOff); builder.setExtras(b); + // Set a notification + builder.setSmallIcon(R.drawable.ic_settings_24dp); + builder.setContentTitle(getContext().getString(R.string.led_notification_title)); + builder.setContentText(getContext().getString(R.string.led_notification_text)); + builder.setOngoing(true); + mNotificationManager.notify(1, builder.build()); } |