Bootstrap

20241004给荣品RD-RK3588-AHD开发板刷Rockchip原厂的Android12时永不休眠的步骤

20241004给荣品RD-RK3588-AHD开发板刷Rockchip原厂的Android12时永不休眠的步骤
2024/10/4 19:22


1、
Z:\rk3588s4_3588a12\device\rockchip\common\device.mk
ifeq ($(strip $(BOARD_HAVE_BLUETOOTH_RTK)), true)
include hardware/realtek/rtkbt/rtkbt.mk
endif

ifeq ($(strip $(TARGET_BOARD_PLATFORM_PRODUCT)), box)
    #include device/rockchip/common/samba/rk31_samba.mk
    PRODUCT_COPY_FILES += \
      $(LOCAL_PATH)/init.box.samba.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.box.samba.rc \
      device/rockchip/common/cifsmanager.sh:system/bin/cifsmanager.sh

    PRODUCT_PROPERTY_OVERRIDES += \
      ro.rk.screenoff_time=2147483647
else
PRODUCT_PROPERTY_OVERRIDES += \
    ro.rk.screenoff_time=60000
endif

# incrementalfs config
$(call inherit-product-if-exists, vendor/rockchip/common/modular_kernel/4.19/incrementalfs.mk)

修改为:
ifeq ($(strip $(BOARD_HAVE_BLUETOOTH_RTK)), true)
include hardware/realtek/rtkbt/rtkbt.mk
endif

ifeq ($(strip $(TARGET_BOARD_PLATFORM_PRODUCT)), box)
    #include device/rockchip/common/samba/rk31_samba.mk
    PRODUCT_COPY_FILES += \
      $(LOCAL_PATH)/init.box.samba.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.box.samba.rc \
      device/rockchip/common/cifsmanager.sh:system/bin/cifsmanager.sh

    PRODUCT_PROPERTY_OVERRIDES += \
      ro.rk.screenoff_time=2147483647
else
PRODUCT_PROPERTY_OVERRIDES += \
    ro.rk.screenoff_time=2147483647
endif

# incrementalfs config
$(call inherit-product-if-exists, vendor/rockchip/common/modular_kernel/4.19/incrementalfs.mk)


2、
Z:\rk3588s4_3588a12\device\rockchip\rk3588\overlay\frameworks\base\packages\SettingsProvider\res\values\defaults.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
 * Copyright (c) 2009, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-->
<resources>
    <integer name="def_screen_off_timeout">60000</integer>
   <!-- Initial value for the Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS setting,
         which is a comma separated list of packages that no longer need confirmation
         for immersive mode.
         Override to disable immersive mode confirmation for certain packages. -->
    <string name="def_immersive_mode_confirmations" translatable="false">confirmed</string>
    <bool name="def_bluetooth_on">false</bool>
    <bool name="def_accelerometer_rotation">false</bool>

    <!-- 0 == Always sleep
     1 == Do not sleep when plugged in
     2 == Never sleep
    When the screen is off, it will enter the sleep policy.
    You can configure persist.wifi.sleep.delay.ms to delay closing wifi.
    The default is 15 minutes, 0 means that the wifi is turned off
    immediately after the screen is off. -->
    <integer name="def_wifi_sleep_policy">2</integer>

    <!-- Decrease animation duration. -->
    <fraction name="def_window_animation_scale">50%</fraction>
    <fraction name="def_window_transition_scale">50%</fraction>
</resources>

修改为:
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
 * Copyright (c) 2009, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-->
<resources>
    <integer name="def_screen_off_timeout">2147483647</integer>
   <!-- Initial value for the Settings.Secure.IMMERSIVE_MODE_CONFIRMATIONS setting,
         which is a comma separated list of packages that no longer need confirmation
         for immersive mode.
         Override to disable immersive mode confirmation for certain packages. -->
    <string name="def_immersive_mode_confirmations" translatable="false">confirmed</string>
    <bool name="def_bluetooth_on">false</bool>
    <bool name="def_accelerometer_rotation">false</bool>

    <!-- 0 == Always sleep
     1 == Do not sleep when plugged in
     2 == Never sleep
    When the screen is off, it will enter the sleep policy.
    You can configure persist.wifi.sleep.delay.ms to delay closing wifi.
    The default is 15 minutes, 0 means that the wifi is turned off
    immediately after the screen is off. -->
    <integer name="def_wifi_sleep_policy">2</integer>

    <!-- Decrease animation duration. -->
    <fraction name="def_window_animation_scale">50%</fraction>
    <fraction name="def_window_transition_scale">50%</fraction>
</resources>

3、【改两个地方,但是只修改这里无效!】
Z:\rk3588s4_3588a12\frameworks\base\packages\SettingsProvider\res\values\defaults.xml
    <bool name="def_dim_screen">true</bool>
    <integer name="def_screen_off_timeout">6000</integer>
    <integer name="def_sleep_timeout">-1</integer>

修改为:
    <bool name="def_dim_screen">true</bool>
    <integer name="def_screen_off_timeout">2147483647</integer>
    <integer name="def_sleep_timeout">-1</integer>


    <bool name="def_lockscreen_disabled">false</bool>
    <bool name="def_device_provisioned">false</bool>
    <integer name="def_dock_audio_media_enabled">1</integer>

修改为:
    <bool name="def_lockscreen_disabled">true</bool>
    <bool name="def_device_provisioned">false</bool>
    <integer name="def_dock_audio_media_enabled">1</integer>


4、
Z:\rk3588s4_3588a12\packages\apps\Settings\res\values\arrays.xml
    <!-- Display settings.  The delay in inactivity before the screen is turned off. These are shown in a list dialog. -->
    <string-array name="screen_timeout_entries">
        <item>15 seconds</item>
        <item>30 seconds</item>
        <item>1 minute</item>
        <item>2 minutes</item>
        <item>5 minutes</item>
        <item>10 minutes</item>
        <item>30 minutes</item>
    </string-array>

    <!-- Do not translate. -->
    <string-array name="screen_timeout_values" translatable="false">
        <!-- Do not translate. -->
        <item>15000</item>
        <!-- Do not translate. -->
        <item>30000</item>
        <!-- Do not translate. -->
        <item>60000</item>
        <!-- Do not translate. -->
        <item>120000</item>
        <!-- Do not translate. -->
        <item>300000</item>
        <!-- Do not translate. -->
        <item>600000</item>
        <!-- Do not translate. -->
        <item>1800000</item>
    </string-array>

修改为:
    <!-- Display settings.  The delay in inactivity before the screen is turned off. These are shown in a list dialog. -->
    <string-array name="screen_timeout_entries">
        <item>15 seconds</item>
        <item>30 seconds</item>
        <item>1 minute</item>
        <item>2 minutes</item>
        <item>5 minutes</item>
        <item>10 minutes</item>
        <item>30 minutes</item>
        <item>Never</item>
    </string-array>

    <!-- Do not translate. -->
    <string-array name="screen_timeout_values" translatable="false">
        <!-- Do not translate. -->
        <item>15000</item>
        <!-- Do not translate. -->
        <item>30000</item>
        <!-- Do not translate. -->
        <item>60000</item>
        <!-- Do not translate. -->
        <item>120000</item>
        <!-- Do not translate. -->
        <item>300000</item>
        <!-- Do not translate. -->
        <item>600000</item>
        <!-- Do not translate. -->
        <item>1800000</item>
        <!-- Do not translate. -->
        <item>2147483647</item>

    </string-array>


参考资料:
【以本文为准】
https://blog.csdn.net/ewin2012/article/details/128302913
RK3588-ANDROID12-永不息屏,不锁屏


https://blog.csdn.net/longmin96/article/details/122555882
RK3568-ANDROID11-不息屏


【可以/可选尝试在DTS配置suspend的状态为:disabled】
https://blog.51cto.com/u_16099349/9740109
rk3588 android12 禁止休眠状态 rk860休眠


【不能用】
https://developer.aliyun.com/article/1502084
rk平台Android12屏幕永不休眠


https://blog.csdn.net/DKBDKBDKB/article/details/128853366?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-2-128853366-blog-122555882.235%5Ev43%5Epc_blog_bottom_relevance_base7&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-2-128853366-blog-122555882.235%5Ev43%5Epc_blog_bottom_relevance_base7&utm_relevant_index=5
Android11 设置菜单添加永不休眠选项
切换到dream_timeout资源,这里边有永不休眠的选项;
 

;