Addressing review comments
This commit is contained in:
@@ -34,7 +34,13 @@ void SyncTimeActivity::onEnter() {
|
||||
}
|
||||
|
||||
startActivityForResult(std::make_unique<WifiSelectionActivity>(renderer, mappedInput),
|
||||
[this](const ActivityResult& result) { onWifiSelectionComplete(!result.isCancelled); });
|
||||
[this](const ActivityResult& result) {
|
||||
if (result.isCancelled) {
|
||||
onWifiSelectionCancelled();
|
||||
return;
|
||||
}
|
||||
onWifiSelectionComplete(true);
|
||||
});
|
||||
}
|
||||
|
||||
void SyncTimeActivity::onExit() {
|
||||
@@ -58,6 +64,8 @@ void SyncTimeActivity::onWifiSelectionComplete(bool success) {
|
||||
performSync();
|
||||
}
|
||||
|
||||
void SyncTimeActivity::onWifiSelectionCancelled() { finish(); }
|
||||
|
||||
void SyncTimeActivity::performSync() {
|
||||
bool ok = HalClock::syncNtp();
|
||||
wifiOff();
|
||||
|
||||
@@ -15,7 +15,7 @@ class SyncTimeActivity final : public Activity {
|
||||
private:
|
||||
enum State { CONNECTING, SYNCING, SUCCESS, FAILED };
|
||||
State state = CONNECTING;
|
||||
|
||||
void onWifiSelectionComplete(bool success);
|
||||
void onWifiSelectionCancelled();
|
||||
void performSync();
|
||||
};
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ void waitForPowerRelease() {
|
||||
void enterDeepSleep() {
|
||||
HalPowerManager::Lock powerLock; // Ensure we are at normal CPU frequency for sleep preparation
|
||||
APP_STATE.lastSleepFromReader = activityManager.isReaderActivity();
|
||||
HalClock::saveBeforeSleep();
|
||||
HalClock::saveBeforeSleep(SETTINGS.keepClockAlive);
|
||||
APP_STATE.saveToFile();
|
||||
|
||||
activityManager.goToSleep();
|
||||
|
||||
Reference in New Issue
Block a user