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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值