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

Commit 520f73c7 authored by David van Tonder's avatar David van Tonder
Browse files

Settings: Fix Notification light 'Always on' test

This commits allows for a Notification light setting with an onTime
of 'Always on' to be tested.  A value of 180ms is used for the onTime
and 1ms for offTime to ensure the light actually shows.

Change-Id: I8960e2177f80345d060c283b63714373fdd0ceee
parent e8f0caa1
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -213,7 +213,16 @@ public class ApplicationLightPreference extends Preference implements
        d.findViewById(android.R.id.button3).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                showTestDialog(d.getColor() - 0xFF000000, d.getPulseSpeedOn(), d.getPulseSpeedOff());
                int onTime = d.getPulseSpeedOn();
                int offTime = d.getPulseSpeedOff();

                if (onTime == 0) {
                    // 'Always on' is selected, display the test with a long timeout as
                    // an onTime of 0 does not turn the light on at all
                    showTestDialog(d.getColor() - 0xFF000000, 180000, 1);
                } else {
                    showTestDialog(d.getColor() - 0xFF000000, onTime, offTime);
                }
            }
        });