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状态,正常使用

相关推荐
移动开发者1号1 小时前
ReLinker优化So库加载指南
android·kotlin
山野万里__1 小时前
C++与Java内存共享技术:跨平台与跨语言实现指南
android·java·c++·笔记
Huckings1 小时前
Android 性能问题
android
移动开发者1号2 小时前
剖析 Systrace:定位 UI 线程阻塞的终极指南
android·kotlin
移动开发者1号2 小时前
深入解析内存抖动:定位与修复实战(Kotlin版)
android·kotlin
whysqwhw2 小时前
OkHttp深度架构缺陷分析与革命性演进方案
android
Digitally4 小时前
如何将文件从 iPhone 传输到 Android(新指南)
android·ios·iphone
whysqwhw5 小时前
OkHttp深度架构缺陷分析与演进规划
android
用户7093722538515 小时前
Android14 SystemUI NotificationShadeWindowView 加载显示过程
android
木叶丸5 小时前
跨平台方案该如何选择?
android·前端·ios