测试平台
Platform: RK3399 OS: industry-71
现象
测试反馈,测试过程中概率出现机器开机15s后会自动休眠,但是固件中设置的是永不休眠
分析
分析发现是由于SettingsProvider的设置项没有初始化,导致获取的是PowerManagerService默认的15s //PowerManagerService.java:162: private static final int DEFAULT_SCREEN_OFF_TIMEOUT = 15 * 1000; 怀疑是升级开机立刻断电或者其他原因造成SettingsProvider值没有报错
解决方案
系统原本SettingsProvider在升级初始化后,就不会再次初始化。现在改为在每次开机都会检测system、global和secure的部分必备值,若无则重新初始化》
From 1b6e990f4691f249330360a146690f16baad25fb Mon Sep 17 00:00:00 2001
From: sjf <sjf@t-chip.com.cn>
Date: Thu, 2 Dec 2021 17:33:28 +0800
Subject: [PATCH] =?UTF-8?q?Android->SettingsProvider:=E5=BC=80=E6=9C=BA?=
=?UTF-8?q?=E6=97=B6=E6=A3=80=E6=B5=8Bsystem=E3=80=81global=E5=92=8Csecure?=
=?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E5=BF=85=E5=A4=87=E5=80=BC,?=
=?UTF-8?q?=E8=8B=A5=E6=97=A0=E5=88=99=E9=87=8D=E6=96=B0=E5=88=9D=E5=A7=8B?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../providers/settings/SettingsProvider.java | 63 ++++++++++++++++++-
1 file changed, 60 insertions(+), 3 deletions(-)
diff --git a/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index fec33a2708..b3c5e2f1bc 100644
--- a/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -79,6 +79,8 @@ import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
+import android.util.Log;
+
|