void StopCountUpTimer(void);
int GetCountUpValue() const;
+ // 常亮屏刷新定时器(用于压测模式,每50分钟刷新一次,避免1小时超时)
+ void StartAlwaysOnRefreshTimer();
+ void StopAlwaysOnRefreshTimer();
+
// 故事模式超时定时器(1分钟无文本切换则退出)
void StartStoryModeTimeoutTimer(void);
void StopStoryModeTimeoutTimer(void);
bool m_countUpActive; // 计数定时器是否激活
int m_countUpValue; // 当前计数值
int m_countUpTarget; // 计数目标值
+ bool m_alwaysOnRefreshActive; // 常亮屏刷新定时器是否激活
+ uint32_t m_alwaysOnRefreshTime; // 常亮屏刷新剩余时间(秒)
uint32_t m_currentFps; // 当前帧率
// IMEI状态管理
m_reminderHideActive(false), m_reminderHideTime(0),
m_otaCountdownActive(false), m_otaCountdownValue(0),
m_countUpActive(false), m_countUpValue(0), m_countUpTarget(0),
+ m_alwaysOnRefreshActive(false), m_alwaysOnRefreshTime(0),
m_currentFps(60),
m_simStatus(0), m_cat1PowerStatus(0), m_signalStrength(0),
m_networkStatus(0), m_networkType(0),
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "TimeDisplayCallback: %s", currentTime.c_str());
}
+ // 处理常亮屏刷新定时器(每50分钟刷新一次,避免1小时超时)
+ if (m_alwaysOnRefreshActive) {
+ m_alwaysOnRefreshTime++;
+ // 50分钟 = 3000秒
+ if (m_alwaysOnRefreshTime >= 3000) {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "TimeDisplayCallback: Refreshing screen always-on (50 minutes elapsed)");
+ ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);
+ m_alwaysOnRefreshTime = 0; // 重置计数器
+ }
+ }
+
// 处理提醒隐藏定时器
if (m_reminderHideActive) {
if (m_reminderHideTime > 0) {
ThunderBirdMainView::GetInstance()->ChangeView(currentView, THUNDERBIRD_DIALOGUEVIEW, ThunderBirdDialogueView::THUNDERBIRD_DIALOGUEVIEW_SPEAKING);
}
- // 3. 设置常亮屏
+ // 3. 设置常亮屏(在ChangeView之后设置,确保不会被视图切换逻辑覆盖)
ScreenAlwaysOnCtr(OPEN_SCREEN_ALWAYS_ON);
- // 4. 循环播放 FactoryMode.mp3(使用 ln_audio_simple_play_loop,支持循环播放,无需线程)
- // 音量由按键直接控制(AUDIO_STREAM_VOICE_ASSISTANT),无需手动设置
+ StartAlwaysOnRefreshTimer();
+
const char *factory_mode_file = "/user/res/music/FactoryMode.mp3";
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleJumpDialogueSpeaking: Playing file: %s (will loop)", factory_mode_file);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "ThunderBirdModel::HandleJumpDialogueSpeaking: Successfully started loop playback");
}
}
+
+ void ThunderBirdModel::StartAlwaysOnRefreshTimer()
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StartAlwaysOnRefreshTimer: Starting periodic refresh (every 50 minutes)");
+ m_alwaysOnRefreshActive = true;
+ m_alwaysOnRefreshTime = 0; // 从0开始计数,每50分钟(3000秒)刷新一次
+
+ // 确保时间显示定时器正在运行(用于定期检查)
+ if (m_timeDisplayTimer == nullptr) {
+ StartTimeDisplayTimer(1000); // 1秒间隔
+ }
+ }
+
+ void ThunderBirdModel::StopAlwaysOnRefreshTimer()
+ {
+ WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "StopAlwaysOnRefreshTimer");
+ m_alwaysOnRefreshActive = false;
+ m_alwaysOnRefreshTime = 0;
+ }
+
void ThunderBirdModel::HandleBluetoothConnect(const char *bluetoothAddress)
{
auto* mainView = ThunderBirdMainView::GetInstance();