|
发表于 2022-1-10 09:33:56
1965 浏览 0 回复
SDM450 Android9.0 1.永不休眠、禁止锁屏、禁止弹USB权限框
- From 5cd735b80119b5f38bd0a3d04b75d0a74749bc1a Mon Sep 17 00:00:00 2001
- From: sct-tb-git01-user <miles.zhang@smart-core.com.cn>
- Date: Mon, 10 Jan 2022 09:04:40 +0800
- Subject: [PATCH 1/2] H21 : 1.never sleep 2.disable lockscreen 3.disable
- usbpermissondialogs
- ---
- frameworks/base/core/res/res/values/config.xml | 2 +-
- frameworks/base/packages/SettingsProvider/res/values/defaults.xml | 4 ++--
- .../core/java/com/android/server/power/PowerManagerService.java | 4 ++++
- packages/apps/Settings/res/values-zh-rCN/arrays.xml | 1 +
- packages/apps/Settings/res/values/arrays.xml | 2 ++
- 5 files changed, 10 insertions(+), 3 deletions(-)
- mode change 100644 => 100755 frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
- mode change 100644 => 100755 packages/apps/Settings/res/values-zh-rCN/arrays.xml
- mode change 100644 => 100755 packages/apps/Settings/res/values/arrays.xml
- diff --git a/frameworks/base/core/res/res/values/config.xml b/frameworks/base/core/res/res/values/config.xml
- index 2e68963..c57ce09 100755
- --- a/frameworks/base/core/res/res/values/config.xml
- +++ b/frameworks/base/core/res/res/values/config.xml
- @@ -2319,7 +2319,7 @@
-
- <!-- If true, then we do not ask user for permission for apps to connect to USB devices.
- Do not set this to true for production devices. Doing so will cause you to fail CTS. -->
- - <bool name="config_disableUsbPermissionDialogs">false</bool>
- + <bool name="config_disableUsbPermissionDialogs">true</bool>
-
- <!-- Activity to handle Usb Device connection in USB Host side. Keeping it to null value will
- lead into handling it inside system using Intent resolution. Non-null contents will have
- diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
- index ab0b10d..be8f043 100755
- --- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
- +++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
- @@ -18,7 +18,7 @@
- -->
- <resources>
- <bool name="def_dim_screen">true</bool>
- - <integer name="def_screen_off_timeout">60000</integer>
- + <integer name="def_screen_off_timeout">0</integer>
- <integer name="def_sleep_timeout">-1</integer>
- <bool name="def_airplane_mode_on">false</bool>
- <bool name="def_theater_mode_on">false</bool>
- @@ -86,7 +86,7 @@
- <integer name="def_max_sound_trigger_detection_service_ops_per_day" translatable="false">1000</integer>
- <integer name="def_sound_trigger_detection_service_op_timeout" translatable="false">15000</integer>
-
- - <bool name="def_lockscreen_disabled">false</bool>
- + <bool name="def_lockscreen_disabled">true</bool>
- <bool name="def_device_provisioned">false</bool>
- <integer name="def_dock_audio_media_enabled">1</integer>
-
- diff --git a/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java b/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
- old mode 100644
- new mode 100755
- index 8249722..e5aecf9
- --- a/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
- +++ b/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
- @@ -2102,6 +2102,10 @@ public final class PowerManagerService extends SystemService
- if (sleepTimeout >= 0) {
- timeout = Math.min(timeout, sleepTimeout);
- }
- +
- + if(timeout < 1){
- + timeout = Integer.MAX_VALUE;
- + }
- return Math.max(timeout, mMinimumScreenOffTimeoutConfig);
- }
-
- diff --git a/packages/apps/Settings/res/values-zh-rCN/arrays.xml b/packages/apps/Settings/res/values-zh-rCN/arrays.xml
- old mode 100644
- new mode 100755
- index 4b07acd..8e8bdbf
- --- a/packages/apps/Settings/res/values-zh-rCN/arrays.xml
- +++ b/packages/apps/Settings/res/values-zh-rCN/arrays.xml
- @@ -37,6 +37,7 @@
- <item msgid="7489864775127957179">"5分钟"</item>
- <item msgid="2314124409517439288">"10分钟"</item>
- <item msgid="6864027152847611413">"30分钟"</item>
- + <item msgid="3149294732238283185">"永不"</item>
- </string-array>
- <string-array name="dream_timeout_entries">
- <item msgid="3149294732238283185">"永不"</item>
- diff --git a/packages/apps/Settings/res/values/arrays.xml b/packages/apps/Settings/res/values/arrays.xml
- old mode 100644
- new mode 100755
- index 67dff69..42c157e
- --- a/packages/apps/Settings/res/values/arrays.xml
- +++ b/packages/apps/Settings/res/values/arrays.xml
- @@ -48,6 +48,7 @@
- <item>5 minutes</item>
- <item>10 minutes</item>
- <item>30 minutes</item>
- + <item>Never</item>
- </string-array>
-
- <!-- Do not translate. -->
- @@ -66,6 +67,7 @@
- <item>600000</item>
- <!-- Do not translate. -->
- <item>1800000</item>
- + <item>0</item>
- </string-array>
-
- <!-- Display settings. The delay in inactivity before the dream is shown. These are shown in a list dialog. -->
- --
- 1.9.1
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|
手机微信同号:13682654092
|
|
|
|
|
登录或注册
|