zoukankan      html  css  js  c++  java
  • android修改系统时系统黑屏时不进入休眠状态

    android修改系统时系统黑屏时不进入休眠状态

    转 https://www.cnblogs.com/suxiaoqi/p/9260403.html

     

    基于android4.4修改,在frameworks/base/services/java/com/android/server/power/PowerManagerService.java里,查看休眠方法goToSleep方法,发现休眠最后是调用一下方法,

    private void updatePowerStateLocked() {
    if (!mSystemReady || mDirty == 0) {
    return;
    }

    // Phase 0: Basic state updates.
    updateIsPoweredLocked(mDirty);
    updateStayOnLocked(mDirty);

    // Phase 1: Update wakefulness.
    // Loop because the wake lock and user activity computations are influenced
    // by changes in wakefulness.
    final long now = SystemClock.uptimeMillis();
    int dirtyPhase2 = 0;
    for (;;) {
    int dirtyPhase1 = mDirty;
    dirtyPhase2 |= dirtyPhase1;
    mDirty = 0;

    updateWakeLockSummaryLocked(dirtyPhase1);
    updateUserActivitySummaryLocked(now, dirtyPhase1);
    if (!updateWakefulnessLocked(dirtyPhase1)) {
    break;
    }
    }

    // Phase 2: Update dreams and display power state.
    updateDreamLocked(dirtyPhase2);
    updateDisplayPowerStateLocked(dirtyPhase2);

    // Phase 3: Send notifications, if needed.
    if (mDisplayReady) {
    sendPendingNotificationsLocked();
    }

    // Phase 4: Update suspend blocker.
    // Because we might release the last suspend blocker here, we need to make sure
    // we finished everything else first!
    updateSuspendBlockerLocked();
    }

    红色部分注释掉以后,系统黑屏休眠时,就不会影响应用了,比如camera的使用。

     

  • 相关阅读:
    执行脚本,且以脚本名保存log
    循环读取寄存器(QSFP-DD)并且分别保存log
    shell脚本添加脚本执行时间和当前运行次数current running time
    软件后门种植
    IPC$管道的利用与远程控制
    古典密码-维吉尼亚密码实验
    古典密码之乘法密码
    古典密码之凯撒密码
    密码破解工具Brutus
    ASPack壳脱壳实验
  • 原文地址:https://www.cnblogs.com/it-tsz/p/14151665.html
Copyright © 2011-2022 走看看