History log of /frameworks/base/services/core/java/com/android/server/power/Notifier.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5ab5e1d9514bde75beaf87f46d45b6ffcaac9891 15-Apr-2017 Makoto Onuki <omakoto@google.com> Log screen-on latency with tron

Bug: 36776886
Test: manual test with "adb logcat -b all" and systrace.
Change-Id: I9e7188475a79899569046892e6f08c9005b84303
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
291df4fc0c3fc7a28bf0d89619b7e7bc0ea672e1 14-Mar-2017 Chad Brubaker <cbrubaker@google.com> Expose Intents to Instant Apps

This exposes Intents used by Android widgets to Instant Apps.

The following Intents are exposed:
Intent.ACTION_TIME_TICK
Intent.ACTION_DATE_CHANGED
Intent.ACTION_TIMEZONE_CHANGED
Intent.ACTION_TIME_CHANGED
Intent.ACTION_CONFIGURATION_CHANGED
Intent.ACTION_LOCALE_CHANGED
Intent.ACTION_SCREEN_OFF
Intent.ACTION_SCREEN_ON
Intent.ACTION_USER_PRESENT

Bug: 33350280
Test: Manually verified that broadcasts are received.
Change-Id: Ife94f594c1ff30f2625a57e1cc69f36cc00d1f34
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
5c38fc2b97cba8a275a24bdf201073d68b101e7a 25-Jan-2017 Alison Cichowlas <asc@google.com> Migrate Tron logs for power to multimetric format.

As best I can tell, values 3 & 4 (theoretically totalTouchDownTime &
touchCycles, per PowerScreenStateParser) were always set to 0; I
have not migrated these fields.

Test: Manually checked old vs new logs side by side in event log.

Change-Id: Ifbc32cd2006cc94327301bae7541ca25b14f0a40
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
dc589ac82b5fe2063f4cfd94c8ae26d43d5420a0 11-Nov-2016 Sudheer Shanka <sudheersai@google.com> Update usage of ActivityManagerNative.

- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
-w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
fc46e9b643881b7b2ab76854f3a0ac077e9def8d 22-Oct-2016 Sudheer Shanka <sudheersai@google.com> Move IActivityManager to aidl.

Bug: 30977067
Test: Existing tests are passing, dump commands still working.
Change-Id: I9cf81c4d381ebce14a6c701e409cbb269f2ff1fb
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
d0db6f00435b83c88f041ccf0cfcb9986ae8e6ef 18-Jul-2016 Dianne Hackborn <hackbod@google.com> Add reporting of long wake locks.

These appear as a new event in the battery stats history,
"longwake" in the long version and "Elw" in the checkin.

The power manager keeps track of which wake locks are held
for a long time and reports them to battery stats. Long
is currently considered 1 minute or more. Once it is long,
the start event will appear, and once if is released the
event will end.

In the case of a wake lock changing (typically its work
source changing), for purposes of this accounting this is
considering a pure release of the old state and start of
the new state... so the timer will reset back to one
minute until the wake lock is considered long. This is done
to prevent things that make lots of changes to wake lock
work sources from spamming the log.

Bug: 28753137

Change-Id: I33b6168c57a7ea6ea558273dec731704123124a5
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
6472501f2e7ba018d8aa43c61e55874d756cecb8 15-Jun-2016 Suprabh Shukla <suprabh@google.com> Resetting some settings on starting a new demo session

Muting ringer and media volume and turning off the flashlight
before starting a new session. Also, resetting the configuration of any
new demo user to the configuration of user 0 on the device. Moved
RetailDemoModeService and RetailDemoModeServiceInternal to more
appropriate new packages

Bug: 29519612
Change-Id: Ib65f89ce61afab2d2f1b2dd0c761f5d35a466181
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
5915d1b7567c07506651df2349eca0f6e35f7538 02-Jun-2016 Suprabh Shukla <suprabh@google.com> Adding an idle timeout to restart demo session

Tracking user activity from RetailModeManagerService to start and switch
to a new demo user when there has been no activity for a long time and
the demo video player has been disabled.

Bug: 27280140
Change-Id: Iebf37b5d04a659e4bfda0e4016111c7b9e5f4eb9
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
fa6e0a80e20a4917b403fd330e01a9edd021aabc 24-Jul-2015 Yohei Yukawa <yukawa@google.com> Don't rely on broadcast intent for waking up input method.

Basically this is a copy of Iabef96921dd554ce3768fb18619cefc
for InputMethodManagerService.

As described in JavaDoc of Intent#ACTION_SCREEN_OFF and
Intent#ACTION_SCREEN_ON, one can use those Intents to be
notified when the device becomes non-interactive and
interactive. IMMS has relied on them to enable and disable
InputConnection between the IME and the application so as not
to allow IMEs to update text when the user does not present.
This is actually our design goal as documented in JavaDoc of
InputMethodManager.

An IME can never interact with an InputConnection while
the screen is off. This is enforced by making all clients
inactive while the screen is off, and prevents bad IMEs from
driving the UI when the user can not be aware of its
behavior.

The goal of this CL is to improve the timeliness of above
mechianism by introducing a direct communication channel from
PowerManagerService to InputMethodManagerService via Notifier.
Actually this is what InputManager has been doing since
Iabef96921dd554ce3768fb18619cefc3230b5fb0.

Reasons behind this change are:

1. There are several bugreports that imply those Intents can
dispatch tens of seconds after it is enqueued. This is
indeed problematic because the user cannot type password
to unlock their devices until queued
Intent#ACTION_SCREEN_ON is dispatched. This CL addresses
such an issue without waiting for figuring out the root
cause of the delay.
2. Intent#ACTION_SCREEN_OFF and Intent#ACTION_SCREEN_ON are
sent as a ordered broadcast, which may not be suitable for
tasks that require a certain level of timeliness, and what
IMMS wants is to enable users to start typing immediately
after the system.

This CL was originally authored by Seigo Nonaka.

Bug: 22423200
Bug: 22555778
Change-Id: I747c37ff6dd8f233faef43f2b5713a4320e848eb
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
280a64e793d081847c5dcea23ed9be38aa5332d2 13-Jul-2015 Dianne Hackborn <hackbod@google.com> Improve tracking of screen on reasons.

- New screen on app op to record the last time each app has
caused the screen to be turned on.
- New battery stats event that tells us the reason the screen
has been asked to turn on.
- Propagate out power manager API to specify the reason a caller
is asking to have the screen turned on.

Note that currently the window flag to turn the screen on bypasses
much of this because it is being handled in the window manager by
just directly telling the power manager to turn the screen on. To
make this better we need a new API where it can specify who it is
calling the API for.

Change-Id: I667e56cb1f80508d054da004db667efbcc22e971
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
c4bd42c1eedefca4f15816e4e00af617dcfc8993 13-Jun-2015 Jeff Brown <jeffbrown@google.com> Fix reporting of wakelocks to battery stats.

Fixed certain wake lock types which were being incorrectly reported to
BatteryStats as WAKE_TYPE_FULL due to incomplete decoding of the wake
lock level.

Bug: 21949905
Change-Id: Ie3abfc9f473ce721ad042d228175592c7b8ede33
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
416c49c4049f572134273e228d7988904a51b990 27-May-2015 Jeff Brown <jeffbrown@google.com> Tell PhoneWindowManager when we start/finish interactive changes.

Added some new callbacks that can be used to more precisely trigger
certain behaviors that need to happen around the time the device
is put to sleep and locked.

Fixed an issue where the going to sleep signal might be sent too
early on devices that don't support ambient mode due to the extra
wakefulness change between DOZING and ASLEEP. We are now track
the early / late interactive change work separately from the rest.

Bug: 21375811
Change-Id: I95387195e216ae92a6e45485bd1bd362e41aa45a
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
51a871d48a9f4d912b2c12c29bbddcc5ec175825 06-May-2015 John Spurlock <jspurlock@google.com> Add setting to mute wireless charging sound.

Bug: 19538553
Change-Id: I1af971b35ae9eeb38d8ec38c57b22152095e2725
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
84d6c0fbf6e513d68330234503b809751d0e3564 17-Mar-2015 Bryce Lee <brycelee@google.com> Add isScreenBrightnessBoosted and a broadcast when underlying
value changes.

Bug: 18334219
Change-Id: I20051e97633017711574a063b8061f95c3b616c5
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
fbe96706bb9754f9ea3f6345f32e058a45ad10b4 20-Nov-2014 Jeff Brown <jeffbrown@google.com> Support keeping activities resumed while dozing.

If the lock screen is not shown, then let activities keep running
while dozing. This is important to support ambient mode on watches
since it allows the home app to keep running.

To make this possible, we need to inform the activity manager about
the exact wakefulness state, not just the overall boolean
interactive state.

Bug: 18284212
Change-Id: Ia35c99127ce51ffc178f3a2f51fca67d24061c71
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
3ee549ca2404067bb8b2fcbaa741ec118c76bf3e 23-Sep-2014 Jeff Brown <jeffbrown@google.com> Fix window manager policy state when waking from doze.

Once upon a time when the world was fresh and new, the heavens
had an easy rhythm. Day and night. Night and day. In the day,
the pixel fairies would cavort and play in the bright gardens
with narry a mark of shadow or gloom. In the night, they would
rest peacefully, dreaming no dreams and knowing no fear.

Then one night a fairy dreamed the first dream. At first
the dream was peaceful, full of colors and delight, hopes and
memories. Then all at once, jarringly, it awoke in bright
daylight. The pixel fairy knew fear, for the world had changed
and it was unprepared.

Time passed and the pixel fairies grew accustomed to their
fate, day and night, night and day, sometimes dreaming, until
there came a night when a fairy did not sleep. It roamed
the land in a dreamless doze, lost and afraid amid a grim haze
of grey and darkness. The fairy despaired. It wanted no
part of this place. It pretended for a time to be awake but
the bright daylight would not come. It pretended for a time to
be dreaming but the colors and memories would not come.
That is when the fairy wished for oblivion. Then just as
suddenly, it awoke in the daylight. It fell to the ground,
stunned as if it had forgotten how to walk in the too bright
daylight.

Though the world again grew softer and kinder in time, the pixel
fairies were never the same. For the night is dark and full
of terrors.

---

It used to be easy. Screen on and screen off could explain almost
everything about the state of the device but it's different now with
ambient display. We need to be able to wait for all windows to be
drawn even in the case where the device is still nominally asleep.
In truth, the window manager policy which drives a lot of these
interactions is a thicket of outdated assumptions.

Added a new method to tell the window manager policy when the screen
is being turned off so that it can correctly account for changes
to the interactive state (wakeUp and goingToSleep) and screen state
(screenTurningOn and screenTurnedOff). Now we can independently
poke keyguard during interactive state changes and we can apply
screen on blocking during screen state changes.

Moved the code which manages screen on blocking (which is what
ensures the UI has fully drawn before revealing screen contents)
from the power manager to the display manager since the display
manager is in a better position to accurately track the state of
the screen, particularly when the screen is being turned off.

Fixed a bunch of synchronization issues. Previously some work
had been moved to a handler without considering what might
happen if it became reordered relative to other work happening
elsewhere. Documented the desired behavior in the code to
prevent this from happening again.

There's still a bunch of stuff in here that isn't quite right,
particularly the assumption that there's only one screen, but
it's good enough for now. Hopefully there aren't too many bugs.

Bug: 17605802
Change-Id: Ic7319e09948c8a3cda014d7e169c964a3ad86f14
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
36c4db8bd3bd7dad4b6cb8abd9cdc1a627fe3bbc 19-Sep-2014 Jeff Brown <jeffbrown@google.com> Decouple turning screen on from waking up in policy.

This allows us to ensure windows are fully drawn before unblocking
screen on while dozing.

Bug: 17516245
Change-Id: Ibe63c212b8db855ce26a34a8169f33764b266ee6
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
3edf5272fb2185403dfe64b9722b9fc9b9de80f8 15-Aug-2014 Jeff Brown <jeffbrown@google.com> Add trace tag for power management.

Instrumented the basic power manager state transitions,
calling into the Power HAL, setting the display power mode,
and setting the backlight.

Bug: 17004602
Change-Id: I4e362162ddfd7292a7eea8b5d029ce3f6593c4a9
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
6714e86a545a38d8726e75fcd271947b4259c759 24-Jul-2014 Craig Mautner <cmautner@google.com> Refactor screen blocking logic.

Because of the call to turn on the screen introduced in ag/495255
is now made earlier we may not have sent the wakeup broadcast by
the time the windows have all drawn. In such a case onScreenOn()
did not release the wakelock and the screen stayed off.

This change ensures that no matter the timing of onScreenOn()
the wakelock will be released but only for the onScreenOn()
called in response to the most recent screen on transition.

Fixes bug 16404078.

Change-Id: Ic1e3e61e16c1fc34d4ec657e0e53ac49a05ca6a4
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
c522d1646ac353aec302252fa53976c1fa46ad3d 02-Jul-2014 Jim Miller <jaggies@google.com> Decouple critical policy power update from SCREEN_ON broadcast

This attempts to fix a bug where ordered broadcasts like
ACTION_SCREEN_ON are substantially delayed by misbehaving
receivers. Instead, we immediately send the state to mPolicy
so that it can wake/sleep the device without delay.

Fixes bug 14313639

Change-Id: I21a191f90e0a19f1ee75c160ecc4e63e8def709e
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
cbefd8dd2befcb768f911a63becc427ec4c13250 14-May-2014 Dianne Hackborn <hackbod@google.com> Battery stats more wake history, power save mode.

Add new option for battery stats to record the full wake
lock history, and recording the current power save mode.

Also add in some additional error constants when generating
Binder error exceptions.

And fix issue #14974572: Avoid repeating wakeup_reason at
the beginning of history

Change-Id: I7c1a2ab9569de216634f63d8ad69f1294ef1d235
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
e95c3cd89591ba586aa8a0f7a17660c6fb8770bc 03-May-2014 Jeff Brown <jeffbrown@google.com> Plumb display state and interactive information to BatteryStats.

Fixes an issue where dozing was treated the same as the screen
being fully on. Now dozing is treated the same as the screen
being fully off which is slightly better. The decision of how
to represent this state is now internal to the battery stats
so it can be improved later.

Removed noteInputEvent() since it is unused.

Bug: 14480844
Change-Id: Iee8cf8dce1a1f91c62678bb6d3d9fe567ad6db42
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
fb0448ab4b42c1b390cd75c3660ec0de511b7b3b 02-May-2014 Jeff Brown <jeffbrown@google.com> resolved conflicts for merge of 4f8cd188 to master

Change-Id: I148cd616cd14d834915978aa2dc3f9e27188dbd3
140ffc783c50bbe3b62e817c117a31b93e7f627e 02-May-2014 Jeff Brown <jeffbrown@google.com> Clean up some terminology related to interactive state.

Change-Id: Ife4445685a5314dea64332a3490fa8dd3ffd89a2
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
4e5c089ef3e62e7f658e71c0be262d09bd3e399b 11-Apr-2014 Jeff Brown <jeffbrown@google.com> resolved conflicts for merge of 337e764d to master

Change-Id: I8168dbf42b68c2f7b5ccb300e0080dddc627af26
037c33eae74bee2774897d969d48947f9abe254f 09-Apr-2014 Jeff Brown <jeffbrown@google.com> Plumb display power state through display manager.

Declare a new method, Display.getState() to retrieve the actual
power state of a display.

Improved documentation for Intent.ACTION_SCREEN_ON and
Intent.ACTION_SCREEN_OFF to clarify what they really mean in
terms of the interactive state of the device.

Deprecated PowerManager.isScreenOn() and replaced it with
PowerManager.isInteractive() with a more suggestive name and
better documentation.

Redirect display power state changes to go through the display
manager first and only then head over to the power manager for
legacy compatibility.

Eliminated the bright here and woke here policy flags since they
were unused. Simplified the input dispatch policy somewhat.

Ensure that screen wake locks are respected up until the point
when dozing really begins.

Fixed a regression in DreamService where onDreamingStarted
might be called before onWindowAttached.

Bug: 13133142
Bug: 13472578
Bug: 13929355
Bug: 13760290
Change-Id: Iabef96921dd554ce3768fb18619cefc3230b5fb0
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
a981e3b01ae6af2b67e582f0d1cbb95560d05626 09-Apr-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 7289f3ab to klp-modular-dev-plus-aosp

Change-Id: I788ca17503e2fd225e205a76d3e7062f71d58316
131206b8a9d07400d7c98aea50cc45c38769448f 09-Apr-2014 Jeff Brown <jeffbrown@google.com> Move display power controller to display manager service.

This refactoring is in preparation for enabling the display manager
to have more control over the blanking state of individual displays.
There are no functional changes. Some bits will be cleaned up in
a subsequent patch.

Bug: 13133142
Change-Id: I159a060088344d8e6fcdf9208a1f242960f7ab90
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
13014b5fe5967b3c7e232ffaf81581ed178e6df6 08-Apr-2014 Jeff Brown <jeffbrown@google.com> Move certain internal activity manager methods to new class.

This is a little bit of refactoring in preparation for changing how
the power manager notifies system components about changes in power
state.

Deleted the startRunning method since it is no longer useful.

Bug: 13133142
Change-Id: I7f845c61ecc7ee890154ed0cbd90795de609b7ea
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
ad9ef191f50767d8d5b6f0fbd4b59bb1400dcd25 09-Apr-2014 Jeff Brown <jeffbrown@google.com> Move display power controller to display manager service. (DO NOT MERGE)

This refactoring is in preparation for enabling the display manager
to have more control over the blanking state of individual displays.
There are no functional changes. Some bits will be cleaned up in
a subsequent patch.

Bug: 13133142
Change-Id: Ib811835e8757449c7899ac61807029baaf998161
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
bbb7472b8e378a46a1e77747265c19d22bd6968c 13-Mar-2014 Dianne Hackborn <hackbod@google.com> Fix some uid issues in battery stats.

Change-Id: I9f7773568ff12603d51b26d50d758add09bedbb2
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
e5167ca61e2c5607aad9041b44158581bc61b4d8 08-Mar-2014 Dianne Hackborn <hackbod@google.com> Reduce wake lock noise in battery history.

When the work source of a wake lock was changed, this would
cause the old wake lock to be released in battery stats before
the new one was acquired (the power manager would correctly
keep holding the associated wake lock). This resulted in a
pointless entry in the battery history showing the last wake
lock being released and a new one acquired.

This change adds a new path in to battery stats to report
when a wake lock has changed, allowing it to acquire the
new wake locks first before the old ones, so it can't drop
down to zero wake locks. This also provides better timing
information, as the same current time can be used for both
operations.

In addition, added a new kind of history entry for the
current time, so you can tell when in actual world clock
time the battery data is happening.

Change-Id: Ibbf2eed83bb93f31f60267889b7bc5b9e71e355f
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
a1f1a3c573acd91024fda0ceb3b921c73b186963 25-Feb-2014 Dianne Hackborn <hackbod@google.com> More battery stats.

- Add events for sync.
- Add more descriptive tags for wake events.
- Fix battery reset.
- Fix tracking of wifi data.

Change-Id: Ic07f2a86a5ed33e7da57eb1108c31c777ecd801f
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
3d658bf20e2d56e36941e7407deebeec1276fbcf 05-Feb-2014 Dianne Hackborn <hackbod@google.com> Improve logging of first wake lock, history size.

We now try to have a better label for the first wake lock
that is acquired in the log. This is done in two ways:

- The alarm manager now sorts the alarms it is going to
execute so that wakeup alarms are first, which are more
important w.r.t. which one should be logged.
- There is a new power manager facility to make a wake lock
as "unimportant for logging," which just means in battery
stats that a wake lock acquired after that can be considered
the actual one to log. This is only used by the alarm manager
to mark its TIME_TICK alarms as unimportant for logging.

Also reworked the battery history code to be cleaner and a bit
smaller. There is no longer a separate EVENT command, instead
the event code and tag are just another thing that can be included
in an UPDATE command.

The bits used in the first history int are also re-arrange, so
that only the ones that really change a fair amount in the state
bits are up at the top and there is no longer space used for
the command code (since now it is always just UPDATE). This
allows us to have more room for the time delta at the bottom,
to better avoid situations where we need to write an int delta.

Change-Id: I1bb860ae5b558a248800b090b03a84fbf7acd68a
/frameworks/base/services/core/java/com/android/server/power/Notifier.java
9158825f9c41869689d6b1786d7c7aa8bdd524ce 22-Nov-2013 Amith Yamasani <yamasani@google.com> Move some system services to separate directories

Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
/frameworks/base/services/core/java/com/android/server/power/Notifier.java