History log of /frameworks/base/core/java/android/util/TimeUtils.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
71a9531806d9d37f5482c4d242f95416c04715bf 17-Apr-2018 Kweku Adams <kwekua@google.com> Adding batterystats history to proto dump.

It will only print out a dump for userdebug or eng builds.

Bug: 77727638
Test: flash device and check output of incident proto and
'dumpsys batterystats -c --history'

Merged-In: Ib74d4c664f23a61e6fc33f700ba6a3c6fad32c74
Change-Id: Ia0c993d1281cc350d93f9c13f5540b349a4bfb84
/frameworks/base/core/java/android/util/TimeUtils.java
11351b655b1b0af26b7dde0bb40ec2b0d319d2a8 09-Jan-2018 Neil Fuller <nfuller@google.com> Remove code no longer used by telephony

This code was previously used by telephony
but was removed by frameworks/opt/telephony
commit a0f09cee0f6328ea104b9ef965a387b4a4652e8a

Bug: 63743683
Test: make droid
Change-Id: I83deffc2aadc098e1c976bf164a752e19b96c77a
/frameworks/base/core/java/android/util/TimeUtils.java
d0fff2eac4fe878071dd170e885a4a9c0a1b20e8 08-Nov-2017 Jeff Sharkey <jsharkey@android.com> Extend JobInfo to support NetworkRequest.

The current JobInfo.NETWORK_TYPE values offer basic network selection
ability, but more precise requirements continue to come up. Instead
of creating more NETWORK_TYPE constants, add support for the existing
NetworkRequest object, which is the idiomatic way for an app to
express the type of network they'd like to use.

Move the implementation details of NETWORK_TYPE constants to use this
new NetworkRequest functionality. Deprecate NETWORK_TYPE_METERED,
since the lack of the NOT_METERED capability doesn't imply that the
connection is metered. (Apps using this API to get to a cellular
network should use TRANSPORT_CELLULAR instead.)

Add new SystemClock APIs that return java.time.Clock instances for
various Android-specific clocks. This gives us a clean interface
(with negligible overhead) for swapping in artificial clocks for
testing purposes.

Improve JobStoreTest to validate new NetworkRequest features, and
add one last sanity check to assertTasksEqual() to compare raw
bits-on-wire, to catch people who forget to check new fields. Watch
for IoThread to go idle to run tests faster.

Test: bit FrameworksServicesTests:com.android.server.job.
Bug: 67040695
Change-Id: I189e7602132a0ec26d2f0cc6dadc188664961a47
/frameworks/base/core/java/android/util/TimeUtils.java
1e49f6c35f2a2c0133f9e331ebb84f96d34cef4c 31-Mar-2017 Neil Fuller <nfuller@google.com> Remove time_zones_by_country.xml file

time_zones_by_country.xml has been replaced by a file that can
be updated outside of an OTA and can be accessed via
libcore.util.TimeZoneFinder. This means parsing code has been
removed from this class and replaced by calls to libcore code.

libcore code uses ICU so this class adapts to
java.util.TimeZone for published public APIs as well as other
knock-ons to reduce impact of this change in telephony code.
All use of classes called TimeZone are fully-qualified to
reduce confusion.

Several public-but-hidden methods have been removed. These
can be returned if there are any important apps relying on
them.

Bug: 25338903
Test: Ran CtsUtilTestCases
Change-Id: I699b4e7420e8d7e61ee68ec96552ab3144c9bab2
/frameworks/base/core/java/android/util/TimeUtils.java
f9a80cbbfe5585772ea16fddfeb728c74bc04b2d 23-Sep-2015 Mitchell Wills <mwills@google.com> Fix TimeUtils.formatDuration for exactly one of a unit

Previously printing a duration where a unit (except ms) was one and the
next smallest unit was zero would result in the duration being being
expressed in the next smallest unit. For example 1m0s0ms would be
formatted as 60s0ms.

Update testFormatHugeDuration to supporting times > 999 days
The implementation was fixed in 3d1933c45fe9ba2389ebd166d96abeceab1971d1

Change-Id: I9d609f7a0f82755ea653a205293a6e3785a10d1e
/frameworks/base/core/java/android/util/TimeUtils.java
e8a4b66960056c2dc2c8dbb5f8df00710645cc64 28-Jun-2015 Jeff Sharkey <jsharkey@android.com> Better handling of trim/benchmark results.

Request benchmarking of devices once per week during normal fstrim
maintenance window. Tunable parameter gives us the ability to change
frequency through global setting.

Track individual benchmark and trim results for each volume, and
use scrubbed volume identifier (based on adoptiong age) when logging
stats to drop box. Track last benchmark and trim time for each
volume separately.

Bug: 21831325
Change-Id: I53b3ed788f7820c2e5bceb2840339f5b4aada3f0
/frameworks/base/core/java/android/util/TimeUtils.java
3d1933c45fe9ba2389ebd166d96abeceab1971d1 11-Jun-2015 Dianne Hackborn <hackbod@google.com> Implement some control over ALLOW_WHILE_IDLE alarms.

Since these alarms allow you to bypass the idle restrictions,
we don't want them to be so open-ended like other alarms. This
implements a policy where the alarm manager will only deliver these
types of alarms every X minutes to each application. For this
initial implementation, X is 1 minute under normal operation and
15 minutes when in idle mode.

To do this, I needed to introduce a new internal allow-while-idle
flag for system alarms, which applications can't get, and doesn't
have these new restrictions.

Also tweaked how the alarm manager handles the alarm window, so it
doesn't change if the alarm gets rescheduld; the window is now always
what as computed based on the time when the alarm was first
given to it.

Finally, fix TimeUtils to be able to correctly print times that
are > 999 days.

Change-Id: Ibad8c6a7c14b0624b54e82267be23224b4c31e84
/frameworks/base/core/java/android/util/TimeUtils.java
5af1edc4bbcd8ece7d9c1d270ffc0a4e7d44dc4f 16-Jun-2014 Narayan Kamath <narayan@google.com> am 5a44bdc8: am 8382b0d3: am ab9a19e3: Merge "Remove some pointless code."

* commit '5a44bdc828cba61aa055e2d71b3af62f39100179':
Remove some pointless code.
d9d0bb64e74d363a027d24e93ccb67e46fb256ba 13-Jun-2014 Narayan Kamath <narayan@google.com> Remove some pointless code.

Unnecessary disk reads for values that are never
used (and cached elsewhere, so that optimization is
rendered pointless).

Change-Id: Ic14a8b53a96908bb03eae28759d7be2c217e8125
/frameworks/base/core/java/android/util/TimeUtils.java
315c329544d7c593d1072b071cbb92d9afe74021 10-May-2014 John Reck <jreck@google.com> Add TimeInterpolator support to RNA

Bug: 14678626

Change-Id: I6554e7fcd42c49fac3618ca792083bb68e358f55
/frameworks/base/core/java/android/util/TimeUtils.java
48289433d878d679ecae0cd7d74371d6440285e3 26-Apr-2013 Elliott Hughes <enh@google.com> Use the newer ZoneInfoDB API.

Change-Id: I846c720ae6c262afb4fd7f8a749008c837e76cc4
/frameworks/base/core/java/android/util/TimeUtils.java
9630704ed3b265f008a8f64ec60a33cf9dcd3345 28-Jul-2012 Jeff Brown <jeffbrown@google.com> Power manager rewrite.

The major goal of this rewrite is to make it easier to implement
power management policies correctly. According, the new
implementation primarily uses state-based rather than event-based
triggers for applying changes to the current power state.

For example, when an application requests that the proximity
sensor be used to manage the screen state (by way of a wake lock),
the power manager makes note of the fact that the set of
wake locks changed. Then it executes a common update function
that recalculates the entire state, first looking at wake locks,
then considering user activity, and eventually determining whether
the screen should be turned on or off. At this point it may
make a request to a component called the DisplayPowerController
to asynchronously update the display's powe state. Likewise,
DisplayPowerController makes note of the updated power request
and schedules its own update function to figure out what needs
to be changed.

The big benefit of this approach is that it's easy to mutate
multiple properties of the power state simultaneously then
apply their joint effects together all at once. Transitions
between states are detected and resolved by the update in
a consistent manner.

The new power manager service has is implemented as a set of
loosely coupled components. For the most part, information
only flows one way through these components (by issuing a
request to that component) although some components support
sending a message back to indicate when the work has been
completed. For example, the DisplayPowerController posts
a callback runnable asynchronously to tell the PowerManagerService
when the display is ready. An important feature of this
approach is that each component neatly encapsulates its
state and maintains its own invariants. Moreover, we do
not need to worry about deadlocks or awkward mutual exclusion
semantics because most of the requests are asynchronous.

The benefits of this design are especially apparent in
the implementation of the screen on / off and brightness
control animations which are able to take advantage of
framework features like properties, ObjectAnimator
and Choreographer.

The screen on / off animation is now the responsibility
of the power manager (instead of surface flinger). This change
makes it much easier to ensure that the animation is properly
coordinated with other power state changes and eliminates
the cause of race conditions in the older implementation.

The because of the userActivity() function has been changed
so that it never wakes the device from sleep. This change
removes ambiguity around forcing or disabling user activity
for various purposes. To wake the device, use wakeUp().
To put it to sleep, use goToSleep(). Simple.

The power manager service interface and API has been significantly
simplified and consolidated. Also fixed some inconsistencies
related to how the minimum and maximum screen brightness setting
was presented in brightness control widgets and enforced behind
the scenes.

At present the following features are implemented:

- Wake locks.
- User activity.
- Wake up / go to sleep.
- Power state broadcasts.
- Battery stats and event log notifications.
- Dreams.
- Proximity screen off.
- Animated screen on / off transitions.
- Auto-dimming.
- Auto-brightness control for the screen backlight with
different timeouts for ramping up versus ramping down.
- Auto-on when plugged or unplugged.
- Stay on when plugged.
- Device administration maximum user activity timeout.
- Application controlled brightness via window manager.

The following features are not yet implemented:

- Reduced user activity timeout for the key guard.
- Reduced user activity timeout for the phone application.
- Coordinating screen on barriers with the window manager.
- Preventing auto-rotation during power state changes.
- Auto-brightness adjustment setting (feature was disabled
in previous version of the power manager service pending
an improved UI design so leaving it out for now).
- Interpolated brightness control (a proposed new scheme
for more compactly specifying auto-brightness levels
in config.xml).
- Button / keyboard backlight control.
- Change window manager to associated WorkSource with
KEEP_SCREEN_ON_FLAG wake lock instead of talking
directly to the battery stats service.
- Optionally support animating screen brightness when
turning on/off instead of playing electron beam animation
(config_animateScreenLights).

Change-Id: I1d7a52e98f0449f76d70bf421f6a7f245957d1d7
/frameworks/base/core/java/android/util/TimeUtils.java
eaaf396169abdbd213565cacb37dc0c9c391b365 21-Jul-2012 Jeff Sharkey <jsharkey@android.com> Avoid emitting broken ASCII.

Bug: 6131887
Change-Id: Iff13573aad8128cc7ae3613ab718c81e6d0862a1
/frameworks/base/core/java/android/util/TimeUtils.java
26e1a02ba3183aba2ba262c6f60602e10dd792e3 11-May-2012 Wink Saville <wink@google.com> Add additional debug for time zone handling.

Change-Id: Ie46bba7e0ef7737a865f7efadbf963c2d14e488f
/frameworks/base/core/java/android/util/TimeUtils.java
a27421a306c49fbe9b3823b30f7ab1cd58b28854 01-Mar-2012 Wink Saville <wink@google.com> If no NITZ information use Country Code to set TimeZone.

This is not perfect and only works if the CC is known via
the GSM radio and is only accurate if there is one time zone
per country. This does nothing to resolve time zone problems
for wifi only devices.

So this is a partial fix for bug 2896745

Bug: 2896745
Change-Id: I78f013836c4e4870b8b1016a8312f5adbe0d31c9
/frameworks/base/core/java/android/util/TimeUtils.java
08065b9f09ead8895d97b2971622af8c179e1768 02-Apr-2011 Brian Carlstrom <bdc@google.com> Tracking merge of dalvik-dev to master

git cherry-pick --no-commit a80febd83c8bf0b6717da2a7136179bdc906a5b7

git cherry-pick --no-commit 5e642b41cf44c5da7afdd95ab3d5e2bdbf7b31dd

git cherry-pick --no-commit 4886db14c9eee4b6fee69bd54c57c5af04709c4c

git cherry-pick --no-commit 560c685e448769904047507b9484ce8111967d7e

git cherry-pick --no-commit 63dde7a2fcfa53dc531558635b64cea613d3cdb4

git cherry-pick --no-commit 74e5cb91060a379d98dd3a333b5f231bfb4f502e

git cherry-pick --no-commit 1cc8c9708b555e2e338b7798d38887a2fefcfea6

git cherry-pick --no-commit 09625a21f5abe0c0db15757f58585d552d62c3d7

git cherry-pick --no-commit fcb02dfe0f5a2bb7c07e6d6fc69f756a484b5458

git cherry-pick --no-commit a68cb7fa3ab42854768b8145ff85231663770292

git cherry-pick --no-commit 716beb1c131dd2c6b805d4f681debaa20075010c

git cherry-pick --no-commit 8c29b1097a7afe3a77e27546a56e396f3620a4ec

git cherry-pick --no-commit 9c6a1a55d1c8086c1cc57464eea43725694ff70c

git cherry-pick --no-commit b14f5ea5c57acdd009ba5b51f1bbe430f3d353b8

Change-Id: I8cc94175441b009e23549762d6baee1dbace4881
/frameworks/base/core/java/android/util/TimeUtils.java
7719436342611a106df5d379fedf180a5dd0809e 28-Feb-2011 Xavier Ducrohet <xav@android.com> am b732b7b5: am ce57a7f3: am 6504490c: am dff6b8e7: Merge "Add --non-constant-id to aapt."

* commit 'b732b7b5e8192501360edc15fb8c6399d11fb97d':
GpsLocationProvider: Clean up HAL initialization/cleanup sequence
Fixed GSM encoded network initiated position request
Ensuring thread-safe usage of DateFormat.
Fixing infinite loop for zero duration.
Fix for an infinite loop while scrolling lists.
WAPPushManager, WAP Push over SMS message handler
Add --non-constant-id to aapt.
6504490cde3ec5d48321d539e654d1f2072b33f9 28-Feb-2011 Xavier Ducrohet <xav@android.com> am dff6b8e7: Merge "Add --non-constant-id to aapt."

* commit 'dff6b8e71dda9f5d841fa26408714aec2aef1505':
GpsLocationProvider: Clean up HAL initialization/cleanup sequence
Fixed GSM encoded network initiated position request
Ensuring thread-safe usage of DateFormat.
Fixing infinite loop for zero duration.
Fix for an infinite loop while scrolling lists.
WAPPushManager, WAP Push over SMS message handler
Add --non-constant-id to aapt.
a0f8bc51aff98c2e23e73069e447f63397471a0a 24-Feb-2011 Jesse Wilson <jessewilson@google.com> Remove default constructors from static utility classes.

Change-Id: Id8dc55a30a03e1da87500b66c429de9268033b9e
http://b/3344646
/frameworks/base/core/java/android/util/TimeUtils.java
47f13e7c52b260858bab42217d2101741ea8bc46 22-Feb-2011 Jozef BABJAK <jozef.babjak@gmail.com> Fixing infinite loop for zero duration.

Change-Id: I837478c1598f1d2f99bf773597f0d66d0fc3cf1a
/frameworks/base/core/java/android/util/TimeUtils.java
f5f75104868ce699db458ce6360f3843371e594f 23-Nov-2010 Bjorn Bringert <bringert@android.com> Fix issue #3224616: TimeUtils.formatDuration() can drop 0s.

Integrated from master.

Change-Id: Ie12dd25cce03c06fafb7df1335266322df43b038
/frameworks/base/core/java/android/util/TimeUtils.java
901b3796fd0954cc4b01bf95dbcbd88d87414e84 23-Nov-2010 Bjorn Bringert <bringert@android.com> Don't drop zeros in the second position in formatDuration()

Bug: 3223250
Change-Id: I462c96af51cc052f9df1dc3d2c668551b10155ea
/frameworks/base/core/java/android/util/TimeUtils.java
b5e3165129a5871cf679a67d9e9323ffad3d4902 07-Sep-2010 Dianne Hackborn <hackbod@google.com> Fixes to battery stats debug output.

Change-Id: I32e7cad9633b8c517a74573069e426d9f835a83d
/frameworks/base/core/java/android/util/TimeUtils.java
1ebccf531d1049853b3b0630035434619682c016 15-Aug-2010 Dianne Hackborn <hackbod@google.com> Fix problems with determining when to kill apps for wake usage.

Also improve debug printing of various times.

Change-Id: Ifcc288fd1bcbf44c069875ba97925b9e7ffe9a48
/frameworks/base/core/java/android/util/TimeUtils.java
2269d1572e5fcfb725ea55f5764d8c3280d69f6d 25-Feb-2010 Dianne Hackborn <hackbod@google.com> Re-arrange android-common so framework no longer links with it.

This is the framework part, moving classes around so the framework
no longer needs to link to android-common. Makes some APIs public,
others that didn't need to be public are private in the framework,
some small things are copied.
/frameworks/base/core/java/android/util/TimeUtils.java
d4a4729c0cac582a2dcec7c8cfb316b81885a0f0 21-Dec-2009 Tom Taylor <tomtaylor@google.com> Update imports to android-common

Several files were moved to android-common. Update all the references
to import those files from the new location.
/frameworks/base/core/java/android/util/TimeUtils.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/util/TimeUtils.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/util/TimeUtils.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/util/TimeUtils.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/util/TimeUtils.java