<?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>topic Re: How to auto shut down Android during long sleep in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-to-auto-shut-down-Android-during-long-sleep/m-p/1557180#M197773</link>
    <description>&lt;P&gt;Thanks &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/151788"&gt;@Zhiming_Liu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like that may be a solution if we create a system app or modify an Android library.&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/55486249/why-cant-i-find-action-request-shutdown-in-the-android-developers" target="_blank"&gt;https://stackoverflow.com/questions/55486249/why-cant-i-find-action-request-shutdown-in-the-android-developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As near as I can tell however, the Android layer of the OS never comes out of sleep unless the system is supposed to wake all the way back up.&amp;nbsp; (Example the power button pressed).&amp;nbsp; Instead, the system suspend library is in a state of executing a loop that always puts the device right back to sleep on any wake event unless there is some wakelock managed by android.&lt;/P&gt;&lt;P&gt;So I've done a temporary workaround to modify the suspend library directly to have a timer and shutdown if our timeout passes.&amp;nbsp; But it seems there might be some more standard way to do this.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 12:52:27 GMT</pubDate>
    <dc:creator>dennis3</dc:creator>
    <dc:date>2022-11-21T12:52:27Z</dc:date>
    <item>
      <title>How to auto shut down Android during long sleep</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-auto-shut-down-Android-during-long-sleep/m-p/1552663#M197484</link>
      <description>&lt;P&gt;This is less of an imx8 issue and more of a generic Android/Linux issue, but were using the imx8m so I'll ask here and see if someone perhaps has dealt with this issue.&lt;/P&gt;&lt;P&gt;Our device is battery powered.&amp;nbsp; We are using Android.&amp;nbsp; After the screen timeout for inactivity occurs, the kernel will go into a sleep state.&amp;nbsp; Battery load during this time is pretty minimal but it is enough to drain the battery over a couple days.&amp;nbsp; It would be desirable if the user does not wake the device after an hour or so, to go ahead and shut down.&lt;/P&gt;&lt;P&gt;I haven't found any luck finding hooks in Android to do this.&amp;nbsp; The PowerManagerService has some callbacks to set the wakefulness state, but it seems those are only called if the device actually wakes up from sleep.&amp;nbsp; At the Linux level though, the device does come out of sleep periodically due to the RTC interrupt.&amp;nbsp; I see the battery health is checked and then the device immediately goes back to sleep and no powermanager service hooks are called.&lt;/P&gt;&lt;P&gt;Can anyone suggest where I might put a hook to detect this state so that I might a check the time since the device was awake and just shut down if it's been longer than the desired timeout?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Nov 2022 15:33:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-auto-shut-down-Android-during-long-sleep/m-p/1552663#M197484</guid>
      <dc:creator>dennis3</dc:creator>
      <dc:date>2022-11-11T15:33:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to auto shut down Android during long sleep</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-auto-shut-down-Android-during-long-sleep/m-p/1553642#M197546</link>
      <description>&lt;P&gt;Maybe you can request&amp;nbsp;&lt;SPAN&gt;ACTION_REQUEST_SHUTDOWN after screen timeout for inactivity occurs:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://developer.tomtom.com/bridge/documentation/develop/suspend-shutdown-hooks" target="_blank"&gt;https://developer.tomtom.com/bridge/documentation/develop/suspend-shutdown-hooks&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2022 03:30:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-auto-shut-down-Android-during-long-sleep/m-p/1553642#M197546</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2022-11-15T03:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to auto shut down Android during long sleep</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-to-auto-shut-down-Android-during-long-sleep/m-p/1557180#M197773</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/151788"&gt;@Zhiming_Liu&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like that may be a solution if we create a system app or modify an Android library.&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/55486249/why-cant-i-find-action-request-shutdown-in-the-android-developers" target="_blank"&gt;https://stackoverflow.com/questions/55486249/why-cant-i-find-action-request-shutdown-in-the-android-developers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As near as I can tell however, the Android layer of the OS never comes out of sleep unless the system is supposed to wake all the way back up.&amp;nbsp; (Example the power button pressed).&amp;nbsp; Instead, the system suspend library is in a state of executing a loop that always puts the device right back to sleep on any wake event unless there is some wakelock managed by android.&lt;/P&gt;&lt;P&gt;So I've done a temporary workaround to modify the suspend library directly to have a timer and shutdown if our timeout passes.&amp;nbsp; But it seems there might be some more standard way to do this.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 12:52:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-to-auto-shut-down-Android-during-long-sleep/m-p/1557180#M197773</guid>
      <dc:creator>dennis3</dc:creator>
      <dc:date>2022-11-21T12:52:27Z</dc:date>
    </item>
  </channel>
</rss>

