Android STR研究之四

前言:

在前三篇中初步介绍了开机流程和STR流程,这里讲唤醒

Android STR研究之一-CSDN博客

Android STR研究之二-CSDN博客

Android STR研究之三-CSDN博客

唤醒

如上文所述,当唤醒的时候代码会继续往下执行

复制代码
    private void doHandleDeepSleep(boolean simulatedMode) {
        // keep holding partial wakelock to prevent entering sleep before enterDeepSleep call
        // enterDeepSleep should force sleep entry even if wake lock is kept.
        mSystemInterface.switchToPartialWakeLock();
        mHandler.cancelProcessingComplete();
        synchronized (mLock) {
            mLastSleepEntryTime = SystemClock.elapsedRealtime();
        }
        int nextListenerState;
        if (simulatedMode) {
            simulateSleepByWaiting();
            nextListenerState = CarPowerStateListener.SHUTDOWN_CANCELLED;
        } else {
            boolean sleepSucceeded = suspendWithRetries();
            if (!sleepSucceeded) {
                // Suspend failed and we shut down instead.
                // We either won't get here at all or we will power off very soon.
                return;
            }
            // We suspended and have now resumed
            nextListenerState = CarPowerStateListener.SUSPEND_EXIT;
        }
        synchronized (mLock) {
            mIsResuming = true;
            // Any wakeup time from before is no longer valid.
            mNextWakeupSec = 0;
        }
        Slog.i(TAG, "Resuming after suspending");
        //恢复屏幕亮度
        mSystemInterface.refreshDisplayBrightness();
        //发送状态给vhal
        onApPowerStateChange(CpmsState.WAIT_FOR_VHAL, nextListenerState);
    }

此时给vhal发送的信号状态是(信号:VehicleProperty.AP_POWER_STATE_REPORT,信号值CarPowerStateListener.SUSPEND_EXIT)

Vhal会上报ON状态,正常使用

相关推荐
liang_jy20 小时前
Android 事件分发机制(一)—— 全流程源码解析
android·面试·源码
峥嵘life21 小时前
2026 Android EDLA 认证相关资源网址汇总(持续更新)
android·java·学习
kkk_皮蛋21 小时前
在移动端使用 WebRTC (Android/iOS)
android·ios·webrtc
aqi001 天前
FFmpeg开发笔记(九十六)采用Kotlin+Compose的视频编辑器OpenVideoEditor
android·ffmpeg·kotlin·音视频·流媒体
诸神黄昏EX1 天前
Android Safety 系列专题【篇一:系统签名】
android
ll_god1 天前
android gradle中如何引用 libs.versions.toml中定义的版本变量添加compose引用
android
行稳方能走远1 天前
Android C++ 学习笔记
android·c++
2501_946230981 天前
Cordova&OpenHarmony用户账户管理
android·javascript
x66ccff1 天前
Claude Code 安装方法
android·java·数据库
码农搬砖_20201 天前
【一站式学会compose】 Android UI体系之 Image的使用和介绍
android·image·compose·content·contentscale·scaletype