搜索

451

主题

663

帖子

5245

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
5245
QQ
发表于 2022-1-10 09:33:56 1773 浏览 0 回复

SDM450 Android9.0 1.永不休眠、禁止锁屏、禁止弹USB权限框



  1. From 5cd735b80119b5f38bd0a3d04b75d0a74749bc1a Mon Sep 17 00:00:00 2001
  2. From: sct-tb-git01-user <miles.zhang@smart-core.com.cn>
  3. Date: Mon, 10 Jan 2022 09:04:40 +0800
  4. Subject: [PATCH 1/2] H21 : 1.never sleep 2.disable lockscreen 3.disable
  5. usbpermissondialogs

  6. ---
  7. frameworks/base/core/res/res/values/config.xml                        | 2 +-
  8. frameworks/base/packages/SettingsProvider/res/values/defaults.xml     | 4 ++--
  9. .../core/java/com/android/server/power/PowerManagerService.java       | 4 ++++
  10. packages/apps/Settings/res/values-zh-rCN/arrays.xml                   | 1 +
  11. packages/apps/Settings/res/values/arrays.xml                          | 2 ++
  12. 5 files changed, 10 insertions(+), 3 deletions(-)
  13. mode change 100644 => 100755 frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
  14. mode change 100644 => 100755 packages/apps/Settings/res/values-zh-rCN/arrays.xml
  15. mode change 100644 => 100755 packages/apps/Settings/res/values/arrays.xml

  16. diff --git a/frameworks/base/core/res/res/values/config.xml b/frameworks/base/core/res/res/values/config.xml
  17. index 2e68963..c57ce09 100755
  18. --- a/frameworks/base/core/res/res/values/config.xml
  19. +++ b/frameworks/base/core/res/res/values/config.xml
  20. @@ -2319,7 +2319,7 @@

  21.      <!-- If true, then we do not ask user for permission for apps to connect to USB devices.
  22.           Do not set this to true for production devices. Doing so will cause you to fail CTS. -->
  23. -    <bool name="config_disableUsbPermissionDialogs">false</bool>
  24. +    <bool name="config_disableUsbPermissionDialogs">true</bool>

  25.      <!-- Activity to handle Usb Device connection in USB Host side. Keeping it to null value will
  26.           lead into handling it inside system using Intent resolution. Non-null contents will have
  27. diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
  28. index ab0b10d..be8f043 100755
  29. --- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
  30. +++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
  31. @@ -18,7 +18,7 @@
  32. -->
  33. <resources>
  34.      <bool name="def_dim_screen">true</bool>
  35. -    <integer name="def_screen_off_timeout">60000</integer>
  36. +    <integer name="def_screen_off_timeout">0</integer>
  37.      <integer name="def_sleep_timeout">-1</integer>
  38.      <bool name="def_airplane_mode_on">false</bool>
  39.      <bool name="def_theater_mode_on">false</bool>
  40. @@ -86,7 +86,7 @@
  41.      <integer name="def_max_sound_trigger_detection_service_ops_per_day" translatable="false">1000</integer>
  42.      <integer name="def_sound_trigger_detection_service_op_timeout" translatable="false">15000</integer>

  43. -    <bool name="def_lockscreen_disabled">false</bool>
  44. +    <bool name="def_lockscreen_disabled">true</bool>
  45.      <bool name="def_device_provisioned">false</bool>
  46.      <integer name="def_dock_audio_media_enabled">1</integer>

  47. 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
  48. old mode 100644
  49. new mode 100755
  50. index 8249722..e5aecf9
  51. --- a/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
  52. +++ b/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
  53. @@ -2102,6 +2102,10 @@ public final class PowerManagerService extends SystemService
  54.          if (sleepTimeout >= 0) {
  55.              timeout = Math.min(timeout, sleepTimeout);
  56.          }
  57. +               
  58. +                if(timeout < 1){
  59. +            timeout = Integer.MAX_VALUE;
  60. +        }
  61.          return Math.max(timeout, mMinimumScreenOffTimeoutConfig);
  62.      }

  63. diff --git a/packages/apps/Settings/res/values-zh-rCN/arrays.xml b/packages/apps/Settings/res/values-zh-rCN/arrays.xml
  64. old mode 100644
  65. new mode 100755
  66. index 4b07acd..8e8bdbf
  67. --- a/packages/apps/Settings/res/values-zh-rCN/arrays.xml
  68. +++ b/packages/apps/Settings/res/values-zh-rCN/arrays.xml
  69. @@ -37,6 +37,7 @@
  70.      <item msgid="7489864775127957179">"5分钟"</item>
  71.      <item msgid="2314124409517439288">"10分钟"</item>
  72.      <item msgid="6864027152847611413">"30分钟"</item>
  73. +        <item msgid="3149294732238283185">"永不"</item>
  74.    </string-array>
  75.    <string-array name="dream_timeout_entries">
  76.      <item msgid="3149294732238283185">"永不"</item>
  77. diff --git a/packages/apps/Settings/res/values/arrays.xml b/packages/apps/Settings/res/values/arrays.xml
  78. old mode 100644
  79. new mode 100755
  80. index 67dff69..42c157e
  81. --- a/packages/apps/Settings/res/values/arrays.xml
  82. +++ b/packages/apps/Settings/res/values/arrays.xml
  83. @@ -48,6 +48,7 @@
  84.          <item>5 minutes</item>
  85.          <item>10 minutes</item>
  86.          <item>30 minutes</item>
  87. +                <item>Never</item>
  88.      </string-array>

  89.      <!-- Do not translate. -->
  90. @@ -66,6 +67,7 @@
  91.          <item>600000</item>
  92.          <!-- Do not translate. -->
  93.          <item>1800000</item>
  94. +                <item>0</item>
  95.      </string-array>

  96.      <!-- Display settings.  The delay in inactivity before the dream is shown. These are shown in a list dialog. -->
  97. --
  98. 1.9.1

复制代码




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
手机微信同号:13682654092
回复

使用道具 举报

返回列表
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则


登录或注册
快速回复 返回顶部 返回列表