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

Commit 2c06fad5 authored by Rambo Wang's avatar Rambo Wang
Browse files

Introduce EVENT_POLL_SIGNAL_STRENGTH_DONE in SignalStrengthController

EVENT_POLL_SIGNAL_STRENGTH_DONE is just a suger event type which
fall through to EVENT_GET_SIGNAL_STRENGTH which was used to
handle the finishing of signal strength polling. This is helpful
for readability with almost no cost.

Bug: 178429976
Test: atest SignalStrengthControllerTest
Change-Id: I56639a66ce82d40f137cd212e8b2c4d8f7806f2e
parent eddd69f2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -78,6 +78,7 @@ public class SignalStrengthController extends Handler {
    private static final int EVENT_GET_SIGNAL_STRENGTH                      = 6;
    private static final int EVENT_POLL_SIGNAL_STRENGTH                     = 7;
    private static final int EVENT_SIGNAL_STRENGTH_UPDATE                   = 8;
    private static final int EVENT_POLL_SIGNAL_STRENGTH_DONE                = 9;

    private final Phone mPhone;
    private final CommandsInterface mCi;
@@ -195,6 +196,7 @@ public class SignalStrengthController extends Handler {
                break;
            }

            case EVENT_POLL_SIGNAL_STRENGTH_DONE: // fall through
            case EVENT_GET_SIGNAL_STRENGTH: {
                // This callback is called when signal strength is polled
                // all by itself
@@ -211,7 +213,7 @@ public class SignalStrengthController extends Handler {
            case EVENT_POLL_SIGNAL_STRENGTH: {
                // Just poll signal strength...not part of pollState()

                mCi.getSignalStrength(obtainMessage(EVENT_GET_SIGNAL_STRENGTH));
                mCi.getSignalStrength(obtainMessage(EVENT_POLL_SIGNAL_STRENGTH_DONE));
                break;
            }