diff options
author | Alberto97 <albertop2197@gmail.com> | 2016-11-19 16:08:15 +0100 |
---|---|---|
committer | Zhao Wei Liew <zhaoweiliew@gmail.com> | 2016-11-19 19:14:50 -0700 |
commit | 34a780de7ae8733d89dd110d527234e02e94f1cf (patch) | |
tree | abf534eec406c20de3dde3f054ad38930a7ec686 | |
parent | bbd02a64e0a4371de1858f90943d991863a41fe0 (diff) | |
download | packages_apps_Settings-34a780de7ae8733d89dd110d527234e02e94f1cf.zip packages_apps_Settings-34a780de7ae8733d89dd110d527234e02e94f1cf.tar.gz packages_apps_Settings-34a780de7ae8733d89dd110d527234e02e94f1cf.tar.bz2 |
Settings: Hide Reset action if Battery LED is not multicolor
Change-Id: Icb3c7d640cb540d69efa7186c84a92e4e780968d
-rw-r--r-- | src/com/android/settings/notificationlight/BatteryLightSettings.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/settings/notificationlight/BatteryLightSettings.java b/src/com/android/settings/notificationlight/BatteryLightSettings.java index 9efabc3..afdd756 100644 --- a/src/com/android/settings/notificationlight/BatteryLightSettings.java +++ b/src/com/android/settings/notificationlight/BatteryLightSettings.java @@ -147,10 +147,14 @@ public class BatteryLightSettings extends SettingsPreferenceFragment implements @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - menu.add(0, MENU_RESET, 0, R.string.profile_reset_title) - .setIcon(R.drawable.ic_settings_backup_restore) - .setAlphabeticShortcut('r') - .setShowAsActionFlags(MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); + final NotificationManager nm = getContext().getSystemService(NotificationManager.class); + if (nm.deviceLightsCan(NotificationManager.LIGHTS_RGB_BATTERY)) { + menu.add(0, MENU_RESET, 0, R.string.profile_reset_title) + .setIcon(R.drawable.ic_settings_backup_restore) + .setAlphabeticShortcut('r') + .setShowAsActionFlags( + MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT); + } } @Override |