Commit Graph

759 Commits

Author SHA1 Message Date
Christopher Tate
616541d701 Persisted jobs versus incorrect boot-time RTC
Devices routinely boot in a state where the RTC is wildly incorrect
in the past (2009, 1999, or even at Unix epoch zero).  When we have
persistent jobs to be scheduled at boot, this presents a problem: when
should those jobs run, given that our idea of "now" is incorrect?

The previous implementation fell back to rescheduling these jobs
"from scratch" in this situation, as though they were newly-introduced,
but this turns out to have some emergent pathologies when the jobs
were intended to become runnable after long initial delays: the
rescheduling behavior could wind up starving jobs out entirely,
never running them regardless of how much real uptime the device
had, given the "wrong" pattern of reboots.

We now preserve the original nominal schedule, but recognize when we
have booted in a pathological situation, and correct the schedule for
these jobs when the system clock becomes sensible.

Bug 63817592
Test: JobScheduler test suite plus manual bogus-boot-time repro

Change-Id: Ia36fc5298b68db74e4e07e973b68e68e66206b43
2017-07-31 16:26:01 -07:00
Jeff Sharkey
84c6684bba Merge "Expose SubscriptionPlan API." into oc-mr1-dev 2017-07-21 17:14:30 +00:00
Amith Yamasani
fc923bbcce Merge "Handle an edge case that can reset settings provider data" into oc-dr1-dev
am: 6b4f0bb6fe

Change-Id: I9c71705f57c65fc99da831f9ee382168f131937e
2017-07-21 05:14:33 +00:00
Jeff Sharkey
17bebd2fd7 Expose SubscriptionPlan API.
Clean up SubscriptionPlan, add docs, and expose as public API.

Deprecate older constants in CarrierConfigManager, and point users
towards new API.  (The goal of CarrierConfigManager is to express
key/value pairs that are identical for all users on a particular
carrier, not to configure details that vary between users.)

Since a CarrierService may itself not have access to the plan
details, allow them to "delegate" the capability to configure plans
to another package name.

Factor out new RecurrenceRule class which is used by both
NetworkPolicy and SubscriptionPlan internally.  Polish it to support
arbitrary periods, and continue to test it through NPMST.

Bug: 63391323
Test: bit FrameworksCoreTests:android.util.RecurrenceRuleTest
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Exempt-From-Owner-Approval: Bug 63673347
Change-Id: I93fae4a43e58e9e4c32f8bf345a257dcd607f088
2017-07-20 14:55:57 -06:00
Amith Yamasani
74bf71b23c Handle an edge case that can reset settings provider data
If the AtomicFile does the rename and fails when writing the
original, make sure we can at least use the backup on reboot.

Bug: 63753300
Test: Stop shell, move settings_global.xml to backup, start shell.
Change-Id: I2049b48af05161bb2c68717a71c1700a95150a6c
2017-07-20 13:50:23 -07:00
TreeHugger Robot
b3f68233d9 Merge "Stop tracking user specific uid cpu time on user stop" 2017-07-06 00:42:09 +00:00
Suprabh Shukla
e6e723d588 Stop tracking user specific uid cpu time on user stop
Telling kernel module uid_cputime to stop accounting time for uids
belonging to a stopped user. Upon user remove, removing uid states for
those uids.

Test: adb shell am instrument -e class \
com.android.internal.os.BatteryStatsUserLifecycleTests -w \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

adb shell am instrument -e class android.util.SparseLongArrayTest -w \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Bug: 62390461
Change-Id: Ibe07778465e3d2c13679e4d88d32f7b92fa959d9
2017-07-05 15:39:42 -07:00
Bryce Lee
a89a8cdef9 Merge "Always send configuration to client from resize and relayout." into oc-dr1-dev am: 392ac74f37
am: 4c201983cf

Change-Id: Ie0a49f094952dbd717dc1a71de4aafd267e9c214
2017-06-30 16:42:10 +00:00
Bryce Lee
f858b5788e Always send configuration to client from resize and relayout.
Previously, the server side would omit reporting new configurations
during resize and relayout if the current configuration matched the
last reported. However, if the last reported came through a resize,
the client side handling would be enqueued as a Handler message. This
leads to the possibility of the client getting a new window frame but
not a new configuration where this is synchronously handled, such as
ViewRootImpl::performTraversals.

To address this issue, we now always send the current configuration
from the server to the client. The client then identifies changes
against its own record of last reported configuration and updates as
appropriate.

This changelist also adds a call to force window relayout during
updateConfiguration, as it's possible this is called after
performTraversals is called or resize is handled, leading to a stale
window frame.

Bug: 24671393
Test: go/wm-smoke
Test: Open Camera while rotating phone to landscape. Added
      temporary logs to detect inconsistencies between measurements
      and reported rotation on draw.

Change-Id: I0d5143dfe80400f6a43ce710750f9fc9d4b93f74
2017-06-30 06:42:50 -07:00
Scott Main
87c751f3b2 Merge "Merge "add links to Log class summary for methods and logcat doc" into oc-dev am: ea6fea4d5d am: afeb63d823" into oc-dr1-dev-plus-aosp
am: ef5b81dd69

Change-Id: I3c489f89e2838ee7770f21d7e82ad4678be7f1e4
2017-06-29 16:36:27 +00:00
Scott Main
ecc03fbc9e Merge "add links to Log class summary for methods and logcat doc" into oc-dev am: ea6fea4d5d
am: afeb63d823

Change-Id: If161555970f40d9db0e15c20768a7ddb46527302
2017-06-29 16:27:24 +00:00
Scott Main
afeb63d823 Merge "add links to Log class summary for methods and logcat doc" into oc-dev
am: ea6fea4d5d

Change-Id: I205254f618a3a405aab6f783f5d7de99c9a3a907
2017-06-29 16:19:25 +00:00
Scott Main
41fc46aaa9 Merge "add links to Log class summary for methods and logcat doc" into oc-dev
am: ea6fea4d5d

Change-Id: I322405e6712ef9affb57d86e43b852e19cdc7f88
2017-06-29 16:19:20 +00:00
Scott Main
450a5bb81c add links to Log class summary for methods and logcat doc
bug: 29123084

Change-Id: Ida1351ca3647faa133905c5ff85df716bffd3203
2017-06-28 23:02:02 +00:00
Jeff Sharkey
5ab0243330 Only require that system UIDs tag their sockets.
Apps with a normal UID are typically isolated enough to not require
socket tagging; we're mostly interested in tracking down internal
UIDs that have lots of code sharing the same UID.

Also fix up everyone doing manual string checks of Build.TYPE, since
we now have first-class fields for those.

Bug: 38126076
Test: builds, boots
Change-Id: I3a40348196bd8459289f2b9355d9783a07f1e7dd
2017-06-27 11:11:06 -06:00
Narayan Kamath
6229d99082 LocalLog: Use LocalDateTime.now() instead of a Calendar.
Calendars are cloned once per format argument they're used for and cloning
a calendar is quite expensive. The line modified by this change used to
create dozens of objects, most of them pointlessly cloned.

Instead, we LocalDateTime, which is immutable and will be used directly.
Moreover, we can rely on its toString method which is specified to
format dates the same way we were doing in this class.

Test: manual
Change-Id: Ia2f6f5eb4f79252663c22b5a81d747c928771ee9
2017-06-12 15:30:55 +01:00
Joe Onorato
b3b191e340 Merge changes I4b58610f,Ib758756a into oc-dev
am: a9873bc8f6

Change-Id: I07b352ee11492718ee2abb76d48937f39f17125c
2017-05-31 01:14:54 +00:00
Joe Onorato
53610791a9 Fix typos that cause infinite recursion and CTS test failure.
Bug: 37171450
Test: bit CtsProtoTestCases:*
Change-Id: Ib758756a64fa19eb976dc0a2b1bb1cd6e42fd6f2
2017-05-30 14:06:33 -07:00
Joe Onorato
416723dccd Fix typos that cause infinite recursion and CTS test failure.
Bug: 37171450
Test: bit CtsProtoTestCases:*
Change-Id: Ib758756a64fa19eb976dc0a2b1bb1cd6e42fd6f2
2017-05-26 19:52:12 -07:00
TreeHugger Robot
a775aec337 Merge "MathUtils.map fix" 2017-05-26 07:26:53 +00:00
Neil Fuller
727cca7a83 Merge "Remove time_zones_by_country.xml file" am: 3436fd4833 am: 1541ef3712 am: 4e9c135a5a
am: 4e9e1ea566

Change-Id: I444faff9c0f779f4c4e99949efb393d0cad66913
2017-05-25 11:08:04 +00:00
Neil Fuller
4e9e1ea566 Merge "Remove time_zones_by_country.xml file" am: 3436fd4833 am: 1541ef3712
am: 4e9c135a5a

Change-Id: I8d03ce9616c702d73fb6a807d45c58afd332b50b
2017-05-25 11:01:07 +00:00
Lucas Dupin
09c4bf8d03 MathUtils.map fix
Test: runtest -x cts/tests/tests/util/src/android/util/cts/MathUtilsTest.java
Bug: 62068907
Change-Id: I26613407a2f477580cbe17160651f1f8972a75d8
2017-05-24 17:08:58 -07:00
Neil Fuller
1e49f6c35f 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
2017-05-24 15:31:16 +01:00
Svetoslav Ganov
7c5e0fd431 Merge "Init MemoryIntArray#mFd with -1" am: d6eaa80590 am: a3f14a1531 am: b1274a057f
am: 88993e244a

Change-Id: I2c01823fd8bc0e1485352ea7edba32d84f31cd6a
2017-05-12 06:41:52 +00:00
Svetoslav Ganov
88993e244a Merge "Init MemoryIntArray#mFd with -1" am: d6eaa80590 am: a3f14a1531
am: b1274a057f

Change-Id: I1db50e323b452520c766be40a0c6524a12e14194
2017-05-12 02:48:26 +00:00
Svet Ganov
32eee4f19d Make sure fd is always initialized
Test: MemoryIntArray tests pass

bug:35791084

Change-Id: Icf1ea7717d58a23b89f85a798826b2f5e4d47401
2017-05-11 16:45:19 -07:00
Svetoslav Ganov
d6eaa80590 Merge "Init MemoryIntArray#mFd with -1" 2017-05-11 23:34:24 +00:00
Chris Wren
d8cc90c303 Merge "expose the UID in the EventLog API" into oc-dev am: 8ae5e04636
am: 21abf1cd20

Change-Id: Id1ccf3fa7a50f276003e98cfebee1407e0fa4090
2017-04-28 18:02:57 +00:00
Chris Wren
21abf1cd20 Merge "expose the UID in the EventLog API" into oc-dev
am: 8ae5e04636

Change-Id: Id199e23d3024c9b137946e7802ee57e5e85281db
2017-04-28 17:46:02 +00:00
Chris Wren
4d6b54d2bf expose the UID in the EventLog API
Bug: 32806111
Test: runtest --path frameworks/base/core/tests/coretests/src/android/metrics
Change-Id: I16800a33bc6d4d37b3addd71b675fd760bd5d7b8
2017-04-28 11:18:07 -04:00
Mukesh Agrawal
503af47c0a Merge "Log: increase visibility of Log.TerribleFailure" am: 5e253647ad am: f6328d6943 am: 864dffcd81
am: ab0c70ea81

Change-Id: I6361cf9eb54eb1c9fbb0c4f49b913b4add870e97
2017-04-27 17:25:00 +00:00
Mukesh Agrawal
ab0c70ea81 Merge "Log: increase visibility of Log.TerribleFailure" am: 5e253647ad am: f6328d6943
am: 864dffcd81

Change-Id: I04838769ed83bd6b8283fbcb658ff89a4f92dee6
2017-04-27 17:12:17 +00:00
Mukesh Agrawal
5e253647ad Merge "Log: increase visibility of Log.TerribleFailure" 2017-04-27 16:40:48 +00:00
Daniel Sandler
84c00e396e Merge "Avoid ClassCastException in ArrayMap." into oc-dev am: f9e5395081
am: c467559093

Change-Id: I078ba5b3ce2acaab5151e37f0a0f718f15a230dd
2017-04-27 01:38:07 +00:00
Daniel Sandler
c467559093 Merge "Avoid ClassCastException in ArrayMap." into oc-dev
am: f9e5395081

Change-Id: I2b8b50865bd6db37092ac5752bf280a74e840074
2017-04-27 01:31:40 +00:00
Dan Sandler
d0ecb1ed10 Avoid ClassCastException in ArrayMap.
Only happens if you're put()ing and clear()ing the map from
different threads, and Dianne told you not to do that.

In addition to avoiding the cache poisoning that results
from concurrent access, ArrayMap now attempts to throw
ConcurrentModificationException if clear() or
ensureCapacity() or put() notices you've modified the map
elsewhere.

Bug: 32994281
Test: runtest -x frameworks/base/core/tests/coretests/src/android/util/ArrayMapTest.java
      runtest -x cts/tests/tests/util/src/android/util/cts/ArrayMapTest.java
Change-Id: Ia75970aa9e2b2b65692179f51243584b9773797f
2017-04-26 14:18:15 -04:00
mukesh agrawal
c2a56b279e Log: increase visibility of Log.TerribleFailure
The Log.setWtfHandler() provides a way to override
the default TerribleFailureHandler, so that we can
test that a piece of code reports as terrible
failure as expected.

Unfortunately, we can't actual use setWtfHandler()
at the moment. The problem is as follows:
1. The Log.setWtfHandler() method requires a
   Log.TerribleFailureHandler instance.
2. The Log.TerribleFailureHandler interface requires
   subclasses to implement a onTerribleFailure()
   method. The method requires a Log.TerribleFailure
   argument.
3. Log.TerribleFailure is a private inner class.

Given the above, classes outside of Log can't create
an appropriate argument to pass to Log.setWtfHandler().

To resolve this, we update the visibility of
Log.TerribleFailure to be the same as that of
Log.setWtfHandler(), and Log.TerribleFailureHandler.

Test: m -j32
Bug: 37425059
Change-Id: Ie646b931869582398d61495e367e0d36e767a3e3
2017-04-26 00:49:34 +00:00
Wale Ogunwale
2e80263ec4 Merge "Switch ActivityRecord last reported config. to MergeConfiguration" into oc-dev am: 3ce611f1b4
am: a17d99a389

Change-Id: I3abcabf0bf75fb7217fb8045d2b6404300f4255f
2017-04-26 00:27:56 +00:00
Wale Ogunwale
a17d99a389 Merge "Switch ActivityRecord last reported config. to MergeConfiguration" into oc-dev
am: 3ce611f1b4

Change-Id: I1dd4284b58c901d89ac82853712d17ffc0e86c0a
2017-04-25 21:16:00 +00:00
Wale Ogunwale
e610d3dba8 Switch ActivityRecord last reported config. to MergeConfiguration
Clean-up before actual fix for b/36897968 that makes the code easier to
follow.

Test: Existing tests pass
Bug: 36897968
Change-Id: I3039548929440f922dc69d7f130169a3d60b1eef
2017-04-25 11:48:43 -07:00
Sunny Goyal
bfb5991945 Merge "Creating a common class for loading drawables and handling various badging" into oc-dev am: 15b48ff4de
am: cdb51ebb41

Change-Id: If4ee1ff513c4f52b102a9252c99e813d783f6d1d
2017-04-19 03:03:37 +00:00
Sunny Goyal
cdb51ebb41 Merge "Creating a common class for loading drawables and handling various badging" into oc-dev
am: 15b48ff4de

Change-Id: Ifce032deebbe1dd66d4e80dd211030765daab4a0
2017-04-19 02:53:05 +00:00
Sunny Goyal
bab3075e2e Creating a common class for loading drawables and handling various badging
Test: Manually tested on device
Bug: 36591157
Change-Id: Ic847537d416650015cecaeb68f47f7f032e0dbaa
2017-04-18 16:36:15 -07:00
Adam Lesinski
08551954aa Merge "Add example to TypedValue.changingConfigurations JavaDoc" into oc-dev am: 4124851b64
am: b8dc42fcf3

Change-Id: I4874c6683a150b98f8edcd4f1d5e60e69b39e457
2017-04-14 16:09:37 +00:00
Adam Lesinski
b8dc42fcf3 Merge "Add example to TypedValue.changingConfigurations JavaDoc" into oc-dev
am: 4124851b64

Change-Id: I2bdfbdbe4e08e4b10b0fe7a2d0ed813f29d72fe7
2017-04-13 21:03:53 +00:00
TreeHugger Robot
4124851b64 Merge "Add example to TypedValue.changingConfigurations JavaDoc" into oc-dev 2017-04-13 20:54:30 +00:00
Adam Lesinski
41a2fb1c75 Add example to TypedValue.changingConfigurations JavaDoc
Also includes a list of possible bits that can be set.

Bug: 36676115
Change-Id: I84fd374a00debb4647719e62cf5a1ef22bb6071c
Test: builds
2017-04-13 11:39:50 -07:00
Hyunyoung Song
47da8197b1 Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev am: 76c13a5fce
am: e99cf60039

Change-Id: Ib821f43548e938a7652f62ef444e0a116aa8a58b
2017-04-13 17:31:16 +00:00
Hyunyoung Song
e99cf60039 Merge "Update API, add more documentation on AdaptiveIconDrawable" into oc-dev
am: 76c13a5fce

Change-Id: I060797416983056208f21c099ba21fdc8409103a
2017-04-13 17:20:50 +00:00