History log of /frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7730cd2740a68ecd58fa2c0d2daf45b500d50fa1 23-Oct-2015 Dianne Hackborn <hackbod@google.com> DO NOT MERGE Fix issue #24118803: The screen doesn't turn off...

...after more than 60 minutes left

The sensing timeout alarm was being cancelled immediately after it
was scheduled it. Now only cancel it when we are done sensing or
have reset activity.

Change-Id: Id0440cda7dd1b81bf871f16dfb015df6284cf6af
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
1b79ad74ef392540ee6ba39348d041716f027be7 12-Oct-2015 Dianne Hackborn <hackbod@google.com> Fix issue #23581553: Ignore Battery Optimization not work for re-install app

Remove from whitelist as appropriate. Also be sure we can find whitelisted
apps even if they are not installed in the primary user.

Change-Id: I3ed13dca99b3ba177af8f7bd26a75258df9b6949
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
42df4fbe10b5a537fa93ea83f12716300ba0bcdc 15-Aug-2015 Dianne Hackborn <hackbod@google.com> Fix issue #23214751: Get a GPS fix before going in to doze

This introduces a new phase of device idle mode, immediately
before going idle (once we are sure the device is not moving),
try to collect a location for the device so that any later
requests for it will have a good chance of having an accurate
value.

We do this with two location requests: one a single-shot as
accurate as possible location, and a second longer-running
attempt to get an accurate location from the GPS. There is
a limit on how long we will try to collect the location (default
is 30 seconds), and we stop collection once we reach a desired
accuracy (default is 20 meters).

Also cleanup various transition paths out of the normal state
flow to clean up any active state we may have running.

Change-Id: Ibd3d2e9a720fbfd9640755baf5547180dd409f6a
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
4a503b1ece485d44c15eb02ec2bcd464b46e6f7f 07-Aug-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22989030: Separate battery whitelists

We now have a new whitelist you can put apps in, which
opts them out of the old battery saver mode and new app idle,
but doesn't keep them from going in to doze. This is for a few
special cases that we had previously whitelisted for battery saver,
and inherited to the new modes... ultimately we should figure out
how to get these apps out of the whitelist completely, but this
will help for now.

Apps in this new whitelist are not shown in the UI, because they
are still significantly restricted by not being able to operate
normally in doze. This also means they are still visible in the
list of all apps for the user to be able to put them on/off the
complete whitelist if that is what they really want.

In the course of doing this, I needed to clean up code in the
network policy manager to better separate management of the
two firewall rules that now have different whitelists applied
to them. This also hopefully just generally simplifies and cleans
up that code. Hopefully!

Change-Id: I92e15f2f85899571dd8b049b5e3eb1354f55f353
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
451c3468b9186790d5381334a736a35f9b1dab36 22-Jul-2015 Dianne Hackborn <hackbod@google.com> Fix issue #22612630: Ensure SMS/Call delivery during Doze

Add whitelist timeout for SMS.

Change-Id: I3392093000ad177a93b6ef36fb18f0398a671423
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
0b6134b511e0aae7b834fd30198d464f1e13a6fa 15-Jul-2015 Dianne Hackborn <hackbod@google.com> Bump mms whitelist time up to 1 minute.

Change-Id: I09074c440430580fcfb2581275defe61c63c8ae8
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
fd854ee58c5d56f84047007ead9f88a767ae956f 14-Jul-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21626564: MMS should be receivied while Dozing

We now place whoever is receiving the MMS on the temporary
whitelist while doing so, so they can get network access to
download it.

There was also an issue that needed to be fixed where we
were no longer updating the list of allowed uids while
dozing based on their proc states... we now do that.

Also did a bit of optimization of the temp white list update
path do the network policy manager, instead of going through
a broadcast we now directly call in to the network policy
manager. This also allows us to have a synchronous version
of updating the list, so we can know the app has network access
before we tell it to do anything.

Finally added battery stats events for things going on and off
the whitelist so we can diagnose the behavior there.

Change-Id: Ic7fe010af680034d9f8cb014bb135b2addef7455
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
1b1396870793574c651553e11b68337a7c128a09 07-Jul-2015 Dianne Hackborn <hackbod@google.com> Add easy way to get device idle whitelist.

Change-Id: I28b0df69e7fb16b5d7542b1eae626bbfdd9a4c1c
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
3b16cf4f47142a845bf0ede54ef8ef956506c6c3 02-Jul-2015 Dianne Hackborn <hackbod@google.com> Device idle fixes: issue #22209630 and issue #22225665

Issue #22209630: Only allow whitelisted apps to put apps on the temp whitelist

We now check whether the calling app is a system uid or in the whitelist
and, if not, throw an exception.

Issue #22225665: Alarm still goes off in idle mode (doze)

Fix a bug where we were not clearing the calling identity when coming
through the dump command to the service, and as a result when we would
eventually call out to the alarm manager it wouldn't do what we want.
This was only broken when being controlled by the shell.

Also adjust the network policy manager service's handling of device
idle transitions to only toggle the device idle state, which gets rid
of the long delay we have coming out of idle mode. And add in a bit
of logging around going in/out of idle mode to try to understand where
things may be slow in the future.

Change-Id: I4a41f790e9b0bb31330314b94111557d479f2ba5
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
92617036fcc9b25378c8448c923d6346a012346b 20-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21930140: Add config to turn off auto power features

Doze and app standby are now off in the default platform config.
The Google overlay turns them on. Other people can do that as
well, if they are feeling like it.

Change-Id: Ic8a87f696df94f2d8354fe0772d03b672f464e32
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
b6683c428698105f715985a96066192aa62e9f53 19-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #20494208: Go out of device idle when headset button is pressed

Rework how we record active transitions in battery stats to be
more general, and add an API that others can call in to
DeviceIdleController to request that we go out of idle mode.
use this for VOICE_SEARCH_HANDS_FREE.

Change-Id: Ie58de60e63036a4142881283835961fbcceec892
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
a750a63d639f6936af456df904fa6b9ba941885e 17-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21814207 and issue #21814212 (alarm manager)

Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks.

Introduce a whole new infrastructure for providing options when
sending broadcasts, much like ActivityOptions. There is a single
option right now, asking the activity manager to apply a tempory
whitelist to each receiver of the broadcast.

Issue #21814212: Need to allow configuration of alarm manager parameters

The various alarm manager timing configurations are not modifiable
through settings, much like DeviceIdleController. Also did a few
tweaks in the existing DeviceIdleController impl.

Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
1958e5e7870579337f1d1d3e6c6fae096ba3abb9 13-Jun-2015 Dianne Hackborn <hackbod@google.com> Fix issue #21813831: Need API for asking to be added to power whitelist

Add the API. Clean up a few related things.

Change-Id: I190adad1812f36f6095b98a1001fedb94874e8b5
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
31c05d13612205f6a48460d23135695b267e506c 10-Jun-2015 Adam Lesinski <adamlesinski@google.com> Doze: Use Settings.Global.DEVICE_IDLE_CONSTANTS instead of hardcoded constants

This will allow gservices to tweak the settings and experiment
with different values for various doze constants.

The values are encoded in a string as a key=value list. Ex:

inactive_to=5000,idle_factor=0.01

Bug:21640379
Change-Id: Ie98a0e4893f9b46a64d961d6c5c5169b8b8ad742
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
89ecf82f8ecfe328ef5b7ebf140580c8cad868ba 18-May-2015 Kevin Gabayan <gabayan@google.com> simple AnyMotionDetector

Change-Id: I9d49aab83a47c0667a1a059fcb8c7cfddedeb896
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
af575b9f8e1b59be9c8862b6a65c0dcb88145a23 30-May-2015 Amith Yamasani <yamasani@google.com> Temporarily whitelist an app for network during doze

API to allow an app to be whitelisted for network and wakelock
access for a short period. So even if the device is in idle
mode, such apps can be given a chance to download the payload
related to a high priority cloud-to-device message.

This API is meant for system apps only.

A new permission CHANGE_DEVICE_IDLE_TEMP_WHITELIST is required
to make this call.

Bug: 21525864
Change-Id: Id7a761a664f21af5d7ff55aa56e8df98d15511ca
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
9e9e2e73c6ec7bece20268196dc89ad0c8bafad4 08-May-2015 Wojciech Staszkiewicz <staszkiewicz@google.com> Pass charset to XmlPullParser.setInput instead of null

Passing null to XmlPullParser.setInput forces it to do additional
work, which can be easily avoided if we know the charset beforehand.

bug: b/20849543

Change-Id: Iaff97be9df2d0f99d7af8f19f65934439c9658e2
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
520d8f2ac6ad2c3cd244e1f710103b3a43a41725 09-May-2015 Amith Yamasani <yamasani@google.com> Allow exemption to idle apps at periodic intervals

Triggers are device idle mode changing as well as
internal delayed message handlers.

Bug: 20066058
Change-Id: I0627cfbcc16cfc2b8ac7d298fd2c681a5a6571dd
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
bb9d9278aa6fe3ba3d4c21b03d3e3da4543a974c 12-May-2015 Amith Yamasani <yamasani@google.com> Merge "Idle timebase" into mnc-dev
06bf824628c118fbd5ad6756913d7fd63a6f4ce5 09-May-2015 Amith Yamasani <yamasani@google.com> Idle timebase

Use screen on time as timebase for idling out apps
that have been inactive.

Store the time when an app was last active as an additional
package state in UsageStats. Compare it to screenOnTime to decide
if it's inactive.

Exclude device idle whitelist from apps that can go inactive.

Bug: 20066058

Change-Id: I709f9f31a9affa7ca6e1ae3e4c5729c5fb221669
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
8d66b3fbf5d8036e25d64a8472bcd2b6b7892a1a 09-May-2015 Dianne Hackborn <hackbod@google.com> Implement device idle in power manager.

When in device idle mode, we now prevent most apps
from being able to hold partial wake locks. The
device idle controller now pushes its white list of
app uids into the power manager, so it can apply this
policy correctly to only apps that are not whitelisted.

The implementation adds a new "disabled" flag to a wake
lock which is set when we want to apply this policy. When
set, we ensure that we tell battery stats that the wake lock
is not being held and ignore that wake lock when computing
the power state summary.

Also add new SDK APIs to schedule alarms that are allowed
to execute while in idle mode.

Finally add new dumpsys commands to the device idle controller
to completely disable and re-enable its operation, to use
for testing.

Change-Id: I1f16672c6ac06d03bb538f9854d5843db9aa6f27
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
0b4daca9ba54b7252ea8c159218391380eb00c8a 27-Apr-2015 Dianne Hackborn <hackbod@google.com> Implement user-settable power save whitelist.

The whitelist is now maintained by DeviceIdleController,
which is moving out into its own independent system service.
Network stats now queries it for the whitelist, instead of
collecting that itself.

Also did a few improvements in alarm manager -- made the
code for moving alarms out of the pending list more robust,
and fixed the debug output to always print the contents of
the pending list even if we aren't in a pending state. (That
would have helped me identify the problem much earlier.)

Change-Id: I0f7119d4c553c3af4d77b2f71246fa6e2c13c561
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
88e98dfa59e68a860d8c3b462ec03bc0b06d6b5c 23-Mar-2015 Dianne Hackborn <hackbod@google.com> More work on device idle mode.

- There is now an API for people to find out about
its state.
- Moved DeviceIdleController to be closer to the
power manager implementation, since they are
closely related.
- Job scheduler now knows about idle state and doesn't
run jobs while the device is idle.
- Battery stats now keeps track of "idling" vs "idle mode".
Idling is when we consider the device to be idle,
independent of whether we are actually in deep idle mode.
This allows us to keep track of longer-term changes
independently of cycling in and out of idle mode.
- Battery stats also now keeps track of package changes in
its daily stats.
- Small optimization to network policy manager service to
not touch uids that do not have the NETWORK permission.

Change-Id: I0b3304fb3722c78cdfdd0c1eada7369ece7cbcf9
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java
8ad2af7e5b28f71e7bdfc1bb097937c6c1d22b18 18-Mar-2015 Dianne Hackborn <hackbod@google.com> First stab at device idle mode.

Introduce a new device idle controller service that
monitor's the device state and determines when to go
in to idle mode. When in idle mode, all we do right
now is turn off network access the same as we do for
power save mode. Many more things should come in the
future -- stopping the alarm manager from scheduling
(most) alarms, telling GmsCore for it to stop doing
stuff, etc.

Battery stats now has state tracking for devie idle
mode, as well as events for the reasons we can come
out of idle mode (significant motion or the device
becoming active). Also added new events noting when
packages are installed.

Renamed the "low power" event in battery stats to
"power save" because the former was just way too
confusing.

Finally, fix buffer size reading kernel wake locks.
(Stupidly, just increasing the buffer size. Ideally
we should try to be smarter and grow our buffer to
fit the data available, but I'll leave that for
another time.)

Change-Id: I0be2062466c83ee9d890c6cf5a228d9cc4090eca
/frameworks/base/services/core/java/com/android/server/DeviceIdleController.java