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

Commit 231d57de authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Decrease radios poll interval

Polling with wait() calls is OK, but sleep-based should be as short as
possible.

Test: manual
Bug: 65174075
Change-Id: I6ce3bb46b6f6fb932fd4b9500a5854df2ebf8058
parent 2c5291e2
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -68,7 +68,8 @@ import java.nio.charset.StandardCharsets;
public final class ShutdownThread extends Thread {
    // constants
    private static final String TAG = "ShutdownThread";
    private static final int PHONE_STATE_POLL_SLEEP_MSEC = 500;
    private static final int ACTION_DONE_POLL_WAIT_MS = 500;
    private static final int RADIOS_STATE_POLL_SLEEP_MS = 100;
    // maximum time we wait for the shutdown broadcast before going on.
    private static final int MAX_BROADCAST_TIME = 10*1000;
    private static final int MAX_SHUTDOWN_WAIT_TIME = 20*1000;
@@ -471,7 +472,7 @@ public final class ShutdownThread extends Thread {
                    sInstance.setRebootProgress(status, null);
                }
                try {
                    mActionDoneSync.wait(Math.min(delay, PHONE_STATE_POLL_SLEEP_MSEC));
                    mActionDoneSync.wait(Math.min(delay, ACTION_DONE_POLL_WAIT_MS));
                } catch (InterruptedException e) {
                }
            }
@@ -565,7 +566,7 @@ public final class ShutdownThread extends Thread {
                    sInstance.setRebootProgress(status, null);
                }
                try {
                    mActionDoneSync.wait(Math.min(delay, PHONE_STATE_POLL_SLEEP_MSEC));
                    mActionDoneSync.wait(Math.min(delay, ACTION_DONE_POLL_WAIT_MS));
                } catch (InterruptedException e) {
                }
            }
@@ -710,8 +711,7 @@ public final class ShutdownThread extends Thread {
                        done[0] = true;
                        break;
                    }
                    SystemClock.sleep(PHONE_STATE_POLL_SLEEP_MSEC);

                    SystemClock.sleep(RADIOS_STATE_POLL_SLEEP_MS);
                    delay = endTime - SystemClock.elapsedRealtime();
                }
            }