Added the following testsAPIs to replace the usage
of adb shell commands in tests:
* setChargerAcOnline
* setBatteryLevel
* unplugBattery
* resetBattery
* suspendBatteryInput
Test: atest MixedDeviceOwnerTest#testInstallUpdate using the adb
commands and the new testAPIs
Bug: 182260585
Change-Id: I48c2ad37f6240f4d7a3c437416fdcc0beeed6bd1
Timeouts are calculated from mLastUserActivityTime, so just calling updatePowerStateLocked will go to locked with almost no dim duration.
Test: Tested with local device.
Bug: 164517126
Change-Id: I084c13fada7613bd745ceb1dc2f7038097d70686
When data or obb is not cached, it may slow down app starting speed as
we wait the directory is paged before starting zygote.
To improve this, we postpone the dir check after starting zygote process
in ProcessList, so the directory paging and creation can be done in
background without blocking app starting.
As it's possible that dir is not created when zygote needs it, we also a
busy waiting check in zygote to ensure data and obb dirs are created before
we do our work.
Bug: 177248242
Test: Able to boot device and start app after enabling app storage data isolation flag.
Change-Id: I892b7a1a4f8c38331546f9129b8fb43333093aec
Merged-In: I892b7a1a4f8c38331546f9129b8fb43333093aec
(cherry picked from commit ff269b9e8f)
As requested by go/incremental-disablement-metrics, we will expose the
duration since oldest pending read as part of the crash/ANR metrics.
This is the first step that exposes the value to Incremental Service.
BUG: 180951530
Test: unit test
Change-Id: Ic67460072556ef01780a1794b40924ca2092060d
Connectivity service(CS) is going to be a mainline module and
currently it uses IBatteryStats to communicate with battery
stats service directly. CS cannot use this way after becomes
a mainline module so add new system APIs to communicate with
battery stats service through BatteryStatsManger.
The new API reportNetworkInterfaceForTransports requires
system-only permission NETWORK_STACK or MAINLINE_NETWORK_STACK
so that given the only caller was in ConnectivityService.
This change only add new surface, the usage in CS will be
updated in follow-up CL.
Bug: 171686421
Test: builds, boot, mobile and wifi work.
Change-Id: Ifbd4a9784ed7664751e69d530f8204e292fa6b39
Merged-In: Ifbd4a9784ed7664751e69d530f8204e292fa6b39
Create splashscreen thread with priority -10 in shell for starting
window controller, the definition is moved from
AMS#TOP_APP_PRIORITY_BOOST to Process#THREAD_PRIORITY_TOP_APP_BOOST.
Create and set SplashScreenView object on the starting window after the
first simple view on the starting window drawn, in this way the
transition can be prepare early than wait the actually view was draw,
which can save some time.
Bug: 73289295
Bug: 131311659
Test: atest StartingSurfaceDrawerTests ShellTaskOrganizerTests
Test: atest SplashscreenTests
Change-Id: Ibb430a66d6b329e74d62de047fbf37205cb66a96
Make it clear in the javadoc for addPrimitive method the start point of the delay parameter, which is right after the previous primitive in the composition has finished.
Fix: 150715908
Test: N/A
Change-Id: Ic88b0d8a31a193b8b1726a9541d9e5955b729866
Prior to this change the createDir method would return false if invoked
around the same time on two different threads for the same directory.
Test: manual
Change-Id: I34ba4f645a034f47917054af4b299f916a9cfa67
Track battery voltage along side the measured energy to calculate
battery charge consumption per EnergyConsumer. This better represents
a consumer's impact on battery. Also change numerous variable/method
names from energy units to charge units.
Bug: 180079165
Fixes: 173765509
Test: atest FrameworksCoreTests:com.android.internal.power.MeasuredEnergyStatsTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryStatsNoteTest
Test: atest ScreenPowerCalculatorTest
Test: atest FrameworksServicesTests:com.android.server.am.MeasuredEnergySnapshotTest
Change-Id: I5e727cebf1252cc7b1645a53282de2281c68ae85
Connectivity service(CS) is going to be a mainline module and
currently it uses IBatteryStats to communicate with battery
stats service directly. CS cannot use this way after becomes
a mainline module so add new system APIs to communicate with
battery stats service through BatteryStatsManger.
The new API reportNetworkInterfaceForTransports requires
system-only permission NETWORK_STACK or MAINLINE_NETWORK_STACK
so that given the only caller was in ConnectivityService.
This change only add new surface, the usage in CS will be
updated in follow-up CL.
Bug: 171686421
Test: builds, boot, mobile and wifi work.
Change-Id: Ifbd4a9784ed7664751e69d530f8204e292fa6b39