<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: Enable screen timeout in Android 11</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1632123#M204080</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201315"&gt;@abhiroopnray&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope you are doing well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To adjust the screen timeout please use the given below command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;adb shell settings put system screen_off_timeout &amp;lt;time_in_ms&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After setting the value please check via the below-given command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;adb shell settings get system screen_off_timeout&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 12 Apr 2023 12:07:10 GMT</pubDate>
    <dc:creator>Dhruvit</dc:creator>
    <dc:date>2023-04-12T12:07:10Z</dc:date>
    <item>
      <title>Enable screen timeout in Android 11</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1630967#M203981</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am using Android 11.2.6 in a CUSTOM IMX8MPlus board. I want to implement screen timeout after 10 seconds and again screen turn on on double tap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I write in Settings.System for the value SCREEN_OFF_TIMEOUT nothing is happening.&lt;/P&gt;&lt;P&gt;But if I change in&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;integer name="config_attentiveTimeout"&amp;gt;10000&amp;lt;/integer&amp;gt;, after 10 seconds the screen is going black.&lt;/P&gt;&lt;P&gt;Is this the correct approach?&lt;/P&gt;&lt;P&gt;But then on double tap the screen is not getting enabled on double-tap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know the correct way to implement Scree-off timeout in Android.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiroop Nandi Ray&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 06:10:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1630967#M203981</guid>
      <dc:creator>abhiroopnray</dc:creator>
      <dc:date>2023-04-11T06:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Enable screen timeout in Android 11</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1632123#M204080</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201315"&gt;@abhiroopnray&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope you are doing well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To adjust the screen timeout please use the given below command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;adb shell settings put system screen_off_timeout &amp;lt;time_in_ms&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After setting the value please check via the below-given command.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;adb shell settings get system screen_off_timeout&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 12:07:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1632123#M204080</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-04-12T12:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Enable screen timeout in Android 11</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1640312#M204842</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201299"&gt;@Dhruvit&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;From my application I want to disable and enable the screen_time_off. If enabled, time off will be in 20 seconds.&lt;/P&gt;&lt;P&gt;But by default it should be disabled.&lt;BR /&gt;&lt;BR /&gt;Changes I have made is shown below.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;diff --git a/frameworks/base/core/res/res/values/config.xml b/frameworks/base/core/res/res/values/config.xml&lt;BR /&gt;index 5f02eb6a6a..ea6d533c39 100644&lt;BR /&gt;--- a/frameworks/base/core/res/res/values/config.xml&lt;BR /&gt;+++ b/frameworks/base/core/res/res/values/config.xml&lt;BR /&gt;@@ -1291,8 +1291,8 @@&lt;BR /&gt;&amp;lt;!-- Screen brightness used to dim the screen when the user activity&lt;BR /&gt;timeout expires. May be less than the minimum allowed brightness setting&lt;BR /&gt;that can be set by the user. --&amp;gt;&lt;BR /&gt;- &amp;lt;integer name="config_screenBrightnessDim"&amp;gt;10&amp;lt;/integer&amp;gt;&lt;BR /&gt;- &amp;lt;item name="config_screenBrightnessDimFloat" format="float" type="dimen"&amp;gt;0.05&amp;lt;/item&amp;gt;&lt;BR /&gt;+ &amp;lt;integer name="config_screenBrightnessDim"&amp;gt;0&amp;lt;/integer&amp;gt;&lt;BR /&gt;+ &amp;lt;item name="config_screenBrightnessDimFloat" format="float" type="dimen"&amp;gt;0.0&amp;lt;/item&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Minimum allowable screen brightness to use in a very dark room.&lt;BR /&gt;This value sets the floor for the darkest possible auto-brightness&lt;BR /&gt;@@ -2196,7 +2196,7 @@&lt;BR /&gt;This value must be greater than zero, otherwise the device will immediately&lt;BR /&gt;fall asleep again as soon as it is awoken.&lt;BR /&gt;--&amp;gt;&lt;BR /&gt;- &amp;lt;integer name="config_minimumScreenOffTimeout"&amp;gt;10000&amp;lt;/integer&amp;gt;&lt;BR /&gt;+ &amp;lt;integer name="config_minimumScreenOffTimeout"&amp;gt;300000&amp;lt;/integer&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- User activity timeout: Maximum screen dim duration in milliseconds.&lt;/P&gt;&lt;P&gt;@@ -2212,7 +2212,7 @@&lt;BR /&gt;This value may be zero in which case the screen will not dim before the&lt;BR /&gt;device goes to sleep.&lt;BR /&gt;--&amp;gt;&lt;BR /&gt;- &amp;lt;integer name="config_maximumScreenDimDuration"&amp;gt;7000&amp;lt;/integer&amp;gt;&lt;BR /&gt;+ &amp;lt;integer name="config_maximumScreenDimDuration"&amp;gt;0&amp;lt;/integer&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- User activity timeout: Maximum screen dim duration as a percentage of screen off timeout.&lt;/P&gt;&lt;P&gt;@@ -3096,7 +3096,7 @@&lt;BR /&gt;&amp;lt;bool name="config_allowAnimationsInLowPowerMode"&amp;gt;false&amp;lt;/bool&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- Whether device supports double tap to wake --&amp;gt;&lt;BR /&gt;- &amp;lt;bool name="config_supportDoubleTapWake"&amp;gt;false&amp;lt;/bool&amp;gt;&lt;BR /&gt;+ &amp;lt;bool name="config_supportDoubleTapWake"&amp;gt;true&amp;lt;/bool&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!-- The RadioAccessFamilies supported by the device.&lt;BR /&gt;Empty is viewed as "all". Only used on devices which&lt;/P&gt;&lt;P&gt;diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml&lt;BR /&gt;index 2ffad473e1..e1b0d91207 100644&lt;BR /&gt;--- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml&lt;BR /&gt;+++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml&lt;BR /&gt;@@ -18,7 +18,7 @@&lt;BR /&gt;--&amp;gt;&lt;BR /&gt;&amp;lt;resources&amp;gt;&lt;BR /&gt;&amp;lt;bool name="def_dim_screen"&amp;gt;true&amp;lt;/bool&amp;gt;&lt;BR /&gt;- &amp;lt;integer name="def_screen_off_timeout"&amp;gt;60000&amp;lt;/integer&amp;gt;&lt;BR /&gt;+ &amp;lt;integer name="def_screen_off_timeout"&amp;gt;-1&amp;lt;/integer&amp;gt;&lt;BR /&gt;&amp;lt;integer name="def_sleep_timeout"&amp;gt;-1&amp;lt;/integer&amp;gt;&lt;BR /&gt;&amp;lt;bool name="def_airplane_mode_on"&amp;gt;false&amp;lt;/bool&amp;gt;&lt;BR /&gt;&amp;lt;bool name="def_theater_mode_on"&amp;gt;false&amp;lt;/bool&amp;gt;&lt;BR /&gt;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&lt;BR /&gt;index dee604a3a5..f187b64cee 100644&lt;BR /&gt;--- a/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java&lt;BR /&gt;+++ b/frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java&lt;BR /&gt;@@ -189,7 +189,7 @@ public final class PowerManagerService extends SystemService&lt;/P&gt;&lt;P&gt;// Default timeout in milliseconds. This is only used until the settings&lt;BR /&gt;// provider populates the actual default value (R.integer.def_screen_off_timeout).&lt;BR /&gt;- private static final int DEFAULT_SCREEN_OFF_TIMEOUT = 15 * 1000;&lt;BR /&gt;+ private static final int DEFAULT_SCREEN_OFF_TIMEOUT = -1;&lt;BR /&gt;private static final int DEFAULT_SLEEP_TIMEOUT = -1;&lt;/P&gt;&lt;P&gt;// Screen brightness boost timeout.&lt;BR /&gt;&lt;BR /&gt;Query 1: By default the screen time off is not getting disabled. How to disable it?&lt;/P&gt;&lt;P&gt;Query 2: When I am executing the code :&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;fun &lt;/SPAN&gt;&lt;SPAN&gt;setAutoDim&lt;/SPAN&gt;(timeOut: Int): Boolean {&lt;BR /&gt;    &lt;SPAN&gt;return try &lt;/SPAN&gt;{&lt;BR /&gt;        Settings.System.putString(&lt;BR /&gt;            &lt;SPAN&gt;context&lt;/SPAN&gt;.&lt;SPAN&gt;contentResolver&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;            Settings.System.&lt;SPAN&gt;SCREEN_OFF_TIMEOUT&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;            timeOut.toString()&lt;BR /&gt;        )&lt;BR /&gt;    } &lt;SPAN&gt;catch &lt;/SPAN&gt;(e: SecurityException) {&lt;BR /&gt;        &lt;SPAN&gt;pdsLogger&lt;/SPAN&gt;.e(&lt;SPAN&gt;TAG&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;e.&lt;SPAN&gt;message&lt;/SPAN&gt;!!)&lt;BR /&gt;        &lt;SPAN&gt;return false&lt;BR /&gt;&lt;/SPAN&gt;    }&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I am getting the following exception:&lt;BR /&gt;04-25 19:59:10.400 1783 1986 D GlobalExceptionHandler: insert: java.lang.IllegalArgumentException: Invalid value: -1 for setting: screen_off_timeout.&lt;/P&gt;&lt;P&gt;I have WRITE_SECURE_SETTING permission and using it as a System applcation.&lt;BR /&gt;I have tried with putInt, putLong and putString.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Let me know how I can enable screen time off for particular period of time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Abhiroop Nandi Ray&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 07:37:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1640312#M204842</guid>
      <dc:creator>abhiroopnray</dc:creator>
      <dc:date>2023-04-26T07:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Enable screen timeout in Android 11</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1642236#M205047</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/201315"&gt;@abhiroopnray&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="im"&gt;I hope you are doing well.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;-&amp;gt;If one wants to keep the display on all the time or disable the screen time off please kindly refer to the link.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/Android-LL-disable-screen-lock-and-suspend/m-p/447561" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://community.nxp.com/t5/i-MX-Processors/Android-LL-disable-screen-lock-and-suspend/m-p/447561&amp;amp;source=gmail&amp;amp;ust=1682766167721000&amp;amp;usg=AOvVaw1NRflcqA3l684KsO7GPI5A"&gt;https://community.nxp.com/t5/&lt;WBR /&gt;i-MX-Processors/Android-LL-&lt;WBR /&gt;disable-screen-lock-and-&lt;WBR /&gt;suspend/m-p/447561&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt;One can use the below-given links to enable the screen time off for reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/1114270/android-screen-timeout" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://stackoverflow.com/questions/1114270/android-screen-timeout&amp;amp;source=gmail&amp;amp;ust=1682766167721000&amp;amp;usg=AOvVaw2IKEKkdx9uG70xHcuCIfTA"&gt;https://stackoverflow.com/&lt;WBR /&gt;questions/1114270/android-&lt;WBR /&gt;screen-timeout&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/10748861/how-to-change-screen-timeout-programmatically" target="_blank" rel="noopener" data-saferedirecturl="https://www.google.com/url?q=https://stackoverflow.com/questions/10748861/how-to-change-screen-timeout-programmatically&amp;amp;source=gmail&amp;amp;ust=1682766167721000&amp;amp;usg=AOvVaw3aF4od7buFLcF4ROmN8_Kw"&gt;https://stackoverflow.com/&lt;WBR /&gt;questions/10748861/how-to-&lt;WBR /&gt;change-screen-timeout-&lt;WBR /&gt;programmatically&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;public static final String SCREEN_OFF_TIMEOUT&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;-&amp;gt;The amount of time in milliseconds before the device goes to sleep or begins to dream after a period of inactivity. This value is also known as the user activity timeout period since the screen isn't necessarily turned off when it expires.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-&amp;gt;This value is bounded by the maximum timeout set by&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;DevicePolicyManager.&lt;WBR /&gt;setMaximumTimeToLock(&lt;WBR /&gt;ComponentName, long)&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this information helps you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Dhruvit Vasavada&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 11:18:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Enable-screen-timeout-in-Android-11/m-p/1642236#M205047</guid>
      <dc:creator>Dhruvit</dc:creator>
      <dc:date>2023-04-28T11:18:37Z</dc:date>
    </item>
  </channel>
</rss>

