Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34a780de authored by Alberto97's avatar Alberto97 Committed by Zhao Wei Liew
Browse files

Settings: Hide Reset action if Battery LED is not multicolor

Change-Id: Icb3c7d640cb540d69efa7186c84a92e4e780968d
parent bbd02a64
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -147,10 +147,14 @@ public class BatteryLightSettings extends SettingsPreferenceFragment implements

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        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);
                    .setShowAsActionFlags(
                            MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
        }
    }

    @Override