We need some services to create a battery stats snapshot
captured at the time of battery reset.
The issue is that if the battery stats reset occurs during boot,
before the system is ready, those services may not be prepared.
The fix is to postpone battery stats reset until after the
system server is ready.
Also, we will now reset the stats if battery got partially charged
and discharged repeatedly without ever reaching the full charge.
This will prevent battery sessions from going on forever and
overflowing internal data structures.
This CL partially reverts 0ed84f1263
Bug: 192252233
Test: run PowerOnOffTest#testPowerOnOff repeatedly
Change-Id: Ib486e4caeeac7c933288c3a1055259c05f45c6c8
Native library extraction potentially takes much longer time for
Incremental installations vs the regular ones: each page can
wait for up to 10s (adb) or 100ms (non-adb), adding up to the
full watchdog timeout of 1 min and triggering a reboot.
This CL pauses Watchdog for the thread that's running extraction
to make sure we don't try to fix a hanging single installation
with killing the OS.
Bug: 191166673
Fixes: 191166673
Test: atest package manager and incremental suites
Change-Id: I9c4c24f305e079f346a76b64d4841cdbd58734fa
Instead of managing across all users we can restrict globally and fast
fail if the restriction is set
Test: atest CtsSensorPrivacyTestCases
Bug: 191016260
Change-Id: Ida1a2d1734b7e3d40818485062bec0f96270bc4b
Make sure to log stack traces of unexpected exceptions
to allow us to better diagnose issues such as b/190023280
Change-Id: I29a32329f52b8346570148ed5abc34f3149aa0f9
Test: make
Bug: 190023280
Change-Id: Idd4e4968fe4c642b463149f98a7669a8733b37d7
Adds ListViewCaptureHelper to handle captures from ListView.
This is required due to the implementation of
ListView#requestChildRectangleOnScreen which limits scrolling
to currently-bound views only.
Bug: 189479375
Test: Manual, long screenshot WhatsApp conversation view.
Change-Id: I37d01391b4d773db6e91fc104b0351d70bff01d3
Add a historical flag to signify that attribution chains should be
assembled. Assemble the chains, filter out middle nodes, and attach the
last visible node to the start as a proxy info
Bug: 158792096
Test: manual
Change-Id: I8fbd8f438c62b28fd90039440e86224c624dea79
Remaining clients of BatteryStatsHelper and BatterySipper should switch
over to BatteryStatsManager.getBatteryUsageStats()
Bug: 191877985
Test: N/A
Change-Id: Icb55e574a3d91bc6bef716e6724b352ef3d426b3
Revert the class rename in master as discussed in http://b/183513856#comment19,
because the API has landed Android S.
This reverts the commit fa36bdff9f
Bug: 183513856
Test: m droid
Change-Id: I38bd8b7a9dad85d993dd432ab8f72995a23550fc
The bug proposes to 'move' the /proc/self/fd/ readlink/stat/etc checks
performed by the FileDescriptorAllowlist from before-fork to an earlier
stage.
The original aim was to allow the app zygote Preload hook to open
ashmem/memfd read-only regions to save more RAM (around 5MiB on aarch64)
via sharing more across processes. Potentially other files/sockets can
be opened - the app zygote takes responsibility of managing file
descriptor access controls across its own processes. App Zygote Preload
does not run 3rd party code.
Unfortunately a straightforward move of the checks to
just-before-preload has disadvantages:
* opens more codepaths for potential accidental misuse (the zygote
accepts commands between preload and fork, there are valid usecases
for extending these commands)
* this way FileDescriptorAllowlist would need to support more file
descriptor types (sockets and maybe pipes), which is not needed now
because these FDs are closed right before forking
The solution proposed here is to:
1. Determine the set of file descriptors open before preload
2. Run the preload hook
3. Determine FDs opened by the hook and allow them to remain open across
fork
4. Hypothetical new attempts to preload (if ever supported) will not
affect the allowed FDs - the preload will be able to toss its own FDs
the way it wants, but not open the new-new ones
Bug: 184808875
Test: Manual: unreleased Chrome patch: while in app zygote preload,
create ashmem region, passes it to 'untrusted_app' (=browser
process), and call mmap(2) on it.
Change-Id: Ie302eabca83a0e4f409cb131e4308b73e5f6a580
Merged-In: Ie302eabca83a0e4f409cb131e4308b73e5f6a580