Commit Graph

5321 Commits

Author SHA1 Message Date
Makoto Onuki
a31a1c67f4 Merge "Add stats logging to ServiceManager and NPMS" into pi-dev am: a26e755900
am: fa3a2acfbc

Change-Id: I30bea4b59318ac1871293739c6c5f2d9b7551fb1
2018-04-11 19:01:30 -07:00
Makoto Onuki
fa3a2acfbc Merge "Add stats logging to ServiceManager and NPMS" into pi-dev
am: a26e755900

Change-Id: Ib0bd9ecc183b1b2c9a6785554e6f717744820da3
2018-04-11 18:39:53 -07:00
TreeHugger Robot
a26e755900 Merge "Add stats logging to ServiceManager and NPMS" into pi-dev 2018-04-12 01:13:07 +00:00
Michael Wright
afc4b2d969 Merge "Add API to compute charge time remaining." into pi-dev am: ba6f173cb1
am: ec69f61cc4

Change-Id: Ic383fb123232f0a69221bda7fa489922dd6a5218
2018-04-11 18:10:38 -07:00
Michael Wright
ec69f61cc4 Merge "Add API to compute charge time remaining." into pi-dev
am: ba6f173cb1

Change-Id: Ic2c23a0b22282a2bbea31ec004c58e2d686d2868
2018-04-11 17:56:45 -07:00
TreeHugger Robot
ba6f173cb1 Merge "Add API to compute charge time remaining." into pi-dev 2018-04-12 00:27:53 +00:00
Makoto Onuki
49392d335a Add stats logging to ServiceManager and NPMS
ServiceManager:
- Do an event log every N getService() calls with total time spent
in getService().
where N = 100 for core UIDs and 200 for other apps.

- Do an event log if getService() takes longer than N ms.
where N = 10 for core UIDs and 50 for other apps.

... with some extra throttling.

NPMS:
- Do the basic "stats logger" log for updateNetworkEnabledNL() and
isUidNetworkingBlocked()

This CL also enhances StatsLogegr so it now can show the slowest call
and the max # of calls per-second.

Bug: 77853238
Test: Manual test:
- Insert a SIM card
- Set data limit
- toggle airplane mode
- toggle wifi
- toggle mobile data

Then
- "dumpsys netpolicy" and "dumpsys activity processes" and check the stats
- also check "adb logcat -b all | grep ' service_manager'"

Change-Id: I5789541063f95d0eac501189816c8604a4571ba0
2018-04-11 16:37:57 -07:00
Kweku Adams
052421faf3 Merge "Updating BatteryStats to account for Ambient Display sipper." into pi-dev am: 5d9498a62c
am: 0c41a17c1e

Change-Id: Ifa33707f1829c3d9f430693fdd45349fe9906417
2018-04-11 16:12:43 -07:00
Kweku Adams
0c41a17c1e Merge "Updating BatteryStats to account for Ambient Display sipper." into pi-dev
am: 5d9498a62c

Change-Id: Id2a3bb41586790366a945946bbb3326a4c7de142
2018-04-11 15:55:01 -07:00
Michael Wright
928167e044 Add API to compute charge time remaining.
This is so unbundled applications (e.g. dreams) can present a charge
time indicator that is in sync with the rest of the system.

Bug: 77919650
Test: manual
Change-Id: I7d62dea4fd49eb173b4f052a0fc36f4e7ce5b6bb
2018-04-11 23:47:31 +01:00
Chet Haase
a27a43ae51 Merge "Add targetSdk check around new LinearLayout weighted measure behavior" into pi-dev
am: f24335ec85

Change-Id: I6a3d25fc7b4c03be19847fa988f6119d1eb5e1bc
2018-04-11 15:38:23 -07:00
TreeHugger Robot
5d9498a62c Merge "Updating BatteryStats to account for Ambient Display sipper." into pi-dev 2018-04-11 22:28:17 +00:00
Chet Haase
f24335ec85 Merge "Add targetSdk check around new LinearLayout weighted measure behavior" into pi-dev 2018-04-11 22:17:44 +00:00
Yangster-mac
4006c96aa4 Merge "Trim the invalid uids and tags when reading uids/tags from chain." into pi-dev am: 9054656c20
am: 0b90c524cb

Change-Id: Iaf27e817a7b9fd024f643e6874da76e4bd5e194d
2018-04-11 13:01:02 -07:00
Yangster-mac
0b90c524cb Merge "Trim the invalid uids and tags when reading uids/tags from chain." into pi-dev
am: 9054656c20

Change-Id: I3c67a3842b3444d1dbc068917500db908a383b9c
2018-04-11 12:24:31 -07:00
Bookatz
a156a23a46 Merge "StatsManager throws exceptions" into pi-dev am: 6b317915e8
am: b1d3483102

Change-Id: Ib8b72e4a6a21300ba843325a69847856bd9346aa
2018-04-11 11:56:31 -07:00
TreeHugger Robot
9054656c20 Merge "Trim the invalid uids and tags when reading uids/tags from chain." into pi-dev 2018-04-11 18:29:40 +00:00
Bookatz
b1d3483102 Merge "StatsManager throws exceptions" into pi-dev
am: 6b317915e8

Change-Id: I3de523046404285f3bcc7bfff598393d7c16820d
2018-04-11 11:19:33 -07:00
David Pursell
6f42d1bac2 Merge "MessageQueue: explicitly remove FD event listeners." into pi-dev 2018-04-11 18:05:52 +00:00
Mathew Inwood
070eeaf375 Merge "Configurable sampling rate for hidden API access log events." into pi-dev am: fb55bd8706
am: d39b02157b

Change-Id: I135d9a3bb38c238185763dd14ef103ea860fbb1a
2018-04-11 10:43:38 -07:00
Mathew Inwood
d39b02157b Merge "Configurable sampling rate for hidden API access log events." into pi-dev
am: fb55bd8706

Change-Id: I734dffcd6c993bf718d6835a734be26de5d76780
2018-04-11 10:19:04 -07:00
TreeHugger Robot
6b317915e8 Merge "StatsManager throws exceptions" into pi-dev 2018-04-11 17:02:06 +00:00
Chet Haase
cb8488822c Add targetSdk check around new LinearLayout weighted measure behavior
Bug: 73827180
Test: Existing CTS tests in LinearLayoutTest
Change-Id: I88dfde3743d0f954cd275be6a0032fe30ef55c03
(cherry picked from commit 28230e5efa)
2018-04-11 16:22:47 +00:00
Bookatz
4f71629002 StatsManager throws exceptions
When StatsManager fails to connect to statsd, it now throws an exception
for the caller to catch. It also throws an exception of the config being
added is of an unreadable format.

Due to backwards compatibility issues, the old APIs could not be
changed, so new ones were made to replace the old ones. The old ones are
now temporary and will be removed when the compatibility issue is
resolved.

Bug: 77648233
Test: gts-tradefed run gts-dev --module GtsStatsdHostTestCases
Change-Id: Ibea05883a29b9b3ef9927d2f8fe295eb99832ab7
2018-04-10 19:07:32 -07:00
Kweku Adams
ef72895a48 Updating BatteryStats to account for Ambient Display sipper.
The sipper was added in http://ag/3667626 but BatteryStats wasn't
updated to properly output the data.

Bug: 77877717
Test: flash device and check batterystats output
Change-Id: Ibf98545a147f2d62dd29c57dd7efa14ed4c58aa6
2018-04-10 18:24:41 -07:00
Mathew Inwood
04194fef78 Configurable sampling rate for hidden API access log events.
To reduce log spam, we do not log all hidden API accesses. This CL allows
configuration of the sampling rate of the log events so it can be tweaked
later if necessary.

Test: m
Test: $ adb shell settings put global hidden_api_access_log_sampling_rate 65536
Bug: 64382372
Bug: 77517571
Change-Id: I659c22bd504564da58d972f94b774a9af4039386
2018-04-10 16:57:07 +01:00
Jeff Sharkey
df9a15f6b4 Merge "Update storage wizard to latest UX mocks." into pi-dev am: daafeb35a1
am: 3847ad028a

Change-Id: I3095c525869754c9f9d8f447ffcd5352647312e7
2018-04-09 19:27:17 -07:00
Jeff Sharkey
3847ad028a Merge "Update storage wizard to latest UX mocks." into pi-dev
am: daafeb35a1

Change-Id: Idb7bcbbca24447a7af17e8895f91d225e752fc1d
2018-04-09 18:23:49 -07:00
Yangster-mac
5fa895ed7f Trim the invalid uids and tags when reading uids/tags from chain.
Test: manual test.

BUG: b/77817908
Change-Id: I5570c9bd0e76290e09ba84388db027dc272039a6
2018-04-09 14:45:28 -07:00
Jeff Sharkey
4627071291 Update storage wizard to latest UX mocks.
Changes to support Settings updates.

Bug: 76097999
Test: manual
Change-Id: I8944d4cb7be6a406d5cb6be25ff261b7631b3331
2018-04-09 13:05:48 -06:00
Philip P. Moltmann
325f7284d9 Merge "Expose TestAPIs needed by GtsOsTestCases" into pi-dev am: d565f04957
am: e2e7dd4eda

Change-Id: I57cbfacd181876b65447e5fe7497c83802a55b60
2018-04-09 09:17:38 -07:00
Philip P. Moltmann
e2e7dd4eda Merge "Expose TestAPIs needed by GtsOsTestCases" into pi-dev
am: d565f04957

Change-Id: Ifa630db3e1d20f3b96cb3d9637391590ce2652bf
2018-04-09 09:08:37 -07:00
Philip P. Moltmann
f80809ffd7 Expose TestAPIs needed by GtsOsTestCases
Test: atest GtsOsTestCases on pi-dev:taimen and oc-mr1:sailfish
Bug: 77497338
Change-Id: I5de976991a857bfbed2faa943822af542601fa8b
2018-04-06 14:59:07 -07:00
Daniel Colascione
ee9402a767 Merge "Clarify doc comment for android.os.Build.VERSION.RELEASE" am: fe79660d1e am: 7c4bcfc298
am: c266a5d5c0

Change-Id: I865b0fc84cff768352780c245a9ed46cf92f0429
2018-04-06 12:56:13 -07:00
Daniel Colascione
c266a5d5c0 Merge "Clarify doc comment for android.os.Build.VERSION.RELEASE" am: fe79660d1e
am: 7c4bcfc298

Change-Id: I45af296fbec2d35434e0dd0fda4649e6c07e56e3
2018-04-06 12:36:07 -07:00
TreeHugger Robot
88c5c482d3 Merge "Mark methods as @TestApi" 2018-04-06 17:07:56 +00:00
Daniel Colascione
d1520aa11b Clarify doc comment for android.os.Build.VERSION.RELEASE
The RELEASE field has no guaranteed internal structure and developers
should not attempt to parse it.

Test: no code changes
Change-Id: I0ea3ab5ba5dd4cc733feb62725cf7c62c00c857b
2018-04-06 08:36:18 -07:00
Mathew Inwood
a947da9004 Merge "Treat hidden API exemptions as whitelist." into pi-dev am: 35b218d735
am: 4e1da91329

Change-Id: I4f8bf9386d661685464ce19f73c9b241c59f9aea
2018-04-06 07:10:07 -07:00
Mathew Inwood
4e1da91329 Merge "Treat hidden API exemptions as whitelist." into pi-dev
am: 35b218d735

Change-Id: Ia8564c8ff73264da937fe9392d8920d65d637f16
2018-04-06 06:59:51 -07:00
Mathew Inwood
33d5138e13 Treat hidden API exemptions as whitelist.
Update docs accordingly.

Test: m
Bug: 64382372
Change-Id: Ief8daf3badeb046b0461a3ebcd289e242d559070
2018-04-06 12:14:16 +01:00
Narayan Kamath
7e918239b8 resolve merge conflicts of c8f5480981 to pi-dev-plus-aosp
Test: I solemnly swear I tested this conflict resolution.
Change-Id: I0aa2671c54b0af4a6104e52aea0b5474922042fe
2018-04-05 15:43:51 +01:00
TreeHugger Robot
c8f5480981 Merge "StrictMode: Add support for warning on non SDK API usage." into pi-dev 2018-04-05 13:41:17 +00:00
Narayan Kamath
53bdcf7d05 Merge "StrictMode: Add support for warning on non SDK API usage." 2018-04-05 10:11:27 +00:00
Fyodor Kupolov
47b2288da3 Merge "Fix reading exception from Parcel" into pi-dev am: e269a5ac62
am: 30f3e957d3

Change-Id: If2d51fee0cb1d84738798c804761233b7004d385
2018-04-04 12:37:42 -07:00
Fyodor Kupolov
30f3e957d3 Merge "Fix reading exception from Parcel" into pi-dev
am: e269a5ac62

Change-Id: I3c4ee53e8f1e96f58034ac89e7f4bb65dd549120
2018-04-04 12:28:29 -07:00
David Pursell
5631f665a6 MessageQueue: explicitly remove FD event listeners.
When removing an FD listener from a MessageQueue, the MessageQueue waits
until the next event callback on that FD to remove it from the
underlying native Looper.

This works as expected most of the time, but due to the epoll rebuild
logic in the native Looper, there is a rare condition where FDs can get
stuck in the Looper:
  1. Register two or more FD listeners.
  2. Unregister FD1 listener and close FD1.
  3. Before the Looper processes FD1, get an event on FD2 and close it.
(3) will trigger a rebuild of the epoll set but as FD1 is no longer
valid it cannot be added back to the epoll set, and the MessageQueue
will never get the final callback to clean it up.

Each time this happens:
  * There is a small memory leak (24-32 bytes) in native Looper
  * Rebuilding the epoll set incurs slightly more processing
  * An error is logged for each lost FD on each epoll rebuild
This is fairly minimal, and does get cleaned up if the lost FDs is
re-opened during an epoll rebuild (since it can now be added back in),
but worst-case if a process somehow triggers this on a large number of
FDs it might be noticeable.

It seems worth it to just remove the FD explicitly right away to avoid
this case altogether.

Bug: 64083817
Test: [aosp_x86-userdebug emulator] adb shell am instrument -w \
        -e class android.os.cts.MessageQueueTest \
        android.os.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: I5093ca0d576473f490347ab4244af11a2835d23a
(cherry picked from commit 57f25ad657)
2018-04-03 21:20:47 +00:00
Takamasa Kuramitsu
2214b828e5 Fix reading exception from Parcel
It fails to read exception from Parcel using
Parcel#readException(int, String) because this method doesn't take into
account the remote stack trace info added in writeException().

Test: Manual
Bug: 77495513
Change-Id: I7b646b4a591306832897a42c4ed205d00019cc2b
2018-04-03 11:40:46 -07:00
Alexey Kuzmin
505872d841 Mark methods as @TestApi
Methods previously marked as @hide which are used from cts were marked
as @TestApi
Bug: 74227356
Test: Look through the code of VibrationEffect.

Change-Id: I83cd9b9f19c43467bb310598c6b390583908a162
2018-04-03 15:58:26 +01:00
Narayan Kamath
6e80c19a48 StrictMode: Add support for warning on non SDK API usage.
Adds new API methods to enable and disable these warnings.

(cherry-picked from commit ad1b2a9cc1)

Bug: 73896556
Test: StrictModeTest
Change-Id: I096ce4c355c79cde1b98c3f48d392cd0b2ea5d98
2018-04-03 13:10:13 +01:00
Narayan Kamath
ad1b2a9cc1 StrictMode: Add support for warning on non SDK API usage.
Adds new API methods to enable and disable these warnings.

Bug: 73896556
Test: StrictModeTest

Change-Id: I049812fcdc79f191ab627766f66fc6f51b82e3d1
Merged-In: I096ce4c355c79cde1b98c3f48d392cd0b2ea5d98
2018-04-03 12:40:11 +01:00