Commit Graph

8986 Commits

Author SHA1 Message Date
Hans Boehm
a15cde59cc Merge "Add zygote native fork loop" am: 43a9a8089f am: dd81ed70c7 am: 925ecc3f80 am: 1d550ecd10
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540230

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia212ba95b161d9df0257c3cefab8dd12dacc3e26
2021-02-26 17:35:42 +00:00
Adam Bookatz
85e74cc4e1 Merge "TEST_MAPPING for BatteryStats" into sc-dev am: 47fe2c6ade
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13562596

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibd3867d363fe0c70543886fd175ffe72a0cf9d72
2021-02-26 17:34:33 +00:00
Hans Boehm
1d550ecd10 Merge "Add zygote native fork loop" am: 43a9a8089f am: dd81ed70c7 am: 925ecc3f80
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540230

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I3afb617aab80b073b56fa0c61398ae6d42800a75
2021-02-26 17:20:42 +00:00
Adam Bookatz
47fe2c6ade Merge "TEST_MAPPING for BatteryStats" into sc-dev 2021-02-26 17:11:40 +00:00
Kholoud Mohamed
0215a5bfdc Merge "Exposed some testAPIs in UserManager" into sc-dev am: b3d381a109
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13462285

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I295b60fe5ec071a7e79297c643a78f203342b546
2021-02-26 13:00:22 +00:00
Kholoud Mohamed
afb12625a9 Exposed some testAPIs in UserManager
The following changes in UserManager are required for ongoing
improvements to CTS/GTS infrastructure.
- Exposed the following as testAPIs:
	* isGuestUserEphemeral
	* createUser
	* preCreateUser
	* createProfileForUser
	* createRestrictedProfile
	* getUsers
	* getUserType
- Added permissions to the following APIs:
	* CREATE_USERS for getUserName
	* INTERACT_ACROSS_USERS for getProfileParent
- Added CREATE_USERS permission to the documentation of
getUsers and the APIs that call it.

Test: Confirmed that a CTS test can call these APIs
Bug: 178695365
Change-Id: Id9105db3bfefb926139715b728acedefd2a5ca3e
2021-02-26 10:08:18 +00:00
Dmitri Plotnikov
6da67ebebe Merge "Add UID time-in-state to UidBatteryConsumer" into sc-dev am: 02073550c0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13618629

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I055a28959af4454a5620c6d040501a8a221818be
2021-02-26 05:25:43 +00:00
Dmitri Plotnikov
02073550c0 Merge "Add UID time-in-state to UidBatteryConsumer" into sc-dev 2021-02-26 04:51:40 +00:00
Rupert Lane
cfd021a5ee Merge "Rename Build.IS_CONTAINER to IS_ARC" 2021-02-26 00:16:28 +00:00
Dmitri Plotnikov
f441fbf774 Add UID time-in-state to UidBatteryConsumer
Bug: 158137862
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsProviderTest
Test: atest FrameworksCoreTests:com.android.internal.os.BatteryUsageStatsTest
Change-Id: I8fde2f754deaa0d2c4ebb06b9a2c99d60086bc23
2021-02-25 15:47:20 -08:00
Adam Bookatz
b62859528e TEST_MAPPING for BatteryStats
Creates presubmit test mapping for BatteryStats-related
files.

These tests can be run manually via
atest FrameworksServicesTests:com.android.server.am.BatteryExternalStatsWorkerTest FrameworksServicesTests:com.android.server.am.MeasuredEnergySnapshotTest FrameworksServicesTests:com.android.server.am.BatteryStatsServiceTest FrameworksCoreTests:com.android.internal.os.BatteryStatsTests

Tests that currently fail are marked to be skipped;
they should be addressed by b/180015146.
This is accomplished by introducing a new annotation, @SkipPresubmit.

Test: treehugger presubmit
Bug: 180016384
Change-Id: If01beaa342468aeded660e5766a14391d3ee9bcc
2021-02-25 14:51:01 -08:00
TreeHugger Robot
783f21bda6 Merge "Convert WifiPowerCalculator to work with BatteryUsageStats" into sc-dev am: 2863f6a40d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13486648

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6d10027d87c517e9e5f5704e61d59877e64b41fb
2021-02-25 20:27:05 +00:00
TreeHugger Robot
2863f6a40d Merge "Convert WifiPowerCalculator to work with BatteryUsageStats" into sc-dev 2021-02-25 20:15:38 +00:00
Charles Chen
ff2cf5155c Merge "Unhide isUiContext()" into sc-dev am: f225921153
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13636799

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2569a3d0e1465853b637d4ecc16200d9afc8eb19
2021-02-25 14:37:14 +00:00
Alex Buynytskyy
99afc66507 Merge "API feedback: getVersion instead of isV2." into sc-dev am: 02492968c6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13676256

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iedc9f7ed0ccd583c462ddb740e38fefed11db9af
2021-02-25 14:35:37 +00:00
Charles Chen
f225921153 Merge "Unhide isUiContext()" into sc-dev 2021-02-25 04:05:49 +00:00
Rupert Lane
45ad354f50 Rename Build.IS_CONTAINER to IS_ARC
As ARC is moving from a container to a VM based solution, change the
build method to detect this.

Bug: 139490365
Test: Check that VM works after pushing to device: run play store,
install app.

Change-Id: Ic91a7e5c9a36242d2c905cecffeec72acba8ff45
(cherry picked from commit 2f78de6d0e1428d959f97ea0dd0e3c9c28b6e3fb)
2021-02-25 02:32:43 +00:00
Alex Buynytskyy
414d9ecc26 API feedback: getVersion instead of isV2.
Bug: 181015045
Fixes: 181015045
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I623f73b834759d9a1c599d7c7f3ff585fa75c4aa
2021-02-25 02:06:08 +00:00
Hans Boehm
925ecc3f80 Merge "Add zygote native fork loop" am: 43a9a8089f am: dd81ed70c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540230

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I11e1abaa50306262ec5b2a19d95b481ef64987cc
2021-02-25 01:14:50 +00:00
Hans Boehm
dd81ed70c7 Merge "Add zygote native fork loop" am: 43a9a8089f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540230

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I92e404bd6ce19df88d832127f738ec8c6305fe74
2021-02-25 00:30:09 +00:00
Hans Boehm
43a9a8089f Merge "Add zygote native fork loop" 2021-02-25 00:02:19 +00:00
Treehugger Robot
a60b71817f Merge "BugreportManager API review updates." am: e0db8b998f am: c8e42d59e7 am: 94a089b673 am: feed10cb15
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584520

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia732a5c8ebf12e8d138df55e960abfebb6b092b0
2021-02-24 00:43:23 +00:00
Tianjie Xu
b03e458835 Merge "Throw an exception in RoR api on no-pin case" am: 7444774737 am: 4d208ac97e am: c26952bf52 am: fd08d9eac5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584516

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I700f72a41e9f257e19bd63396f161a0ff832c482
2021-02-24 00:42:56 +00:00
Treehugger Robot
feed10cb15 Merge "BugreportManager API review updates." am: e0db8b998f am: c8e42d59e7 am: 94a089b673
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584520

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: If29af220ff4d636b5870a16b14ead953e562aa70
2021-02-24 00:20:46 +00:00
Tianjie Xu
fd08d9eac5 Merge "Throw an exception in RoR api on no-pin case" am: 7444774737 am: 4d208ac97e am: c26952bf52
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584516

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I65d8cb00ee0c08763a53714f8825bc4d8a75557e
2021-02-24 00:19:46 +00:00
Treehugger Robot
94a089b673 Merge "BugreportManager API review updates." am: e0db8b998f am: c8e42d59e7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584520

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ibba20423d6d2d3a5394d871f5f4f2d33d0afdceb
2021-02-24 00:14:10 +00:00
Tianjie Xu
c26952bf52 Merge "Throw an exception in RoR api on no-pin case" am: 7444774737 am: 4d208ac97e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584516

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic6399b2d5de8fdca4973c8cf4a435c22ba0e68d8
2021-02-23 23:58:41 +00:00
Treehugger Robot
c8e42d59e7 Merge "BugreportManager API review updates." am: e0db8b998f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584520

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I41e43baa35a660165075df1bc602cf197656df82
2021-02-23 23:58:26 +00:00
Tianjie Xu
4d208ac97e Merge "Throw an exception in RoR api on no-pin case" am: 7444774737
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1584516

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic466002e50e6125c27f52eb2e989505720fc30c0
2021-02-23 23:52:30 +00:00
Hans Boehm
69d44b0bfd Add zygote native fork loop
Do not return to Java mode between consecutive fork operations.
This greatly reduces the Zygote overhead, since we no longer need to
stop and restart Java daemons.

By not switching back to Java mode, and being careful about what memory
we touch between forks, we also keep the Zygote heaps much more stable,
facilitating page sharing between the zygote and all its children.
Under normal operation we should no longer allocate any memory in the
zygote between forks. That applies to both the Java and C++ heap.
This makes the zygote behave much more like the mental model many
of us had assumed: It has nearly constant memory contents, which are
copy-on-right cloned at each fork. This does not apply to the initial
system server and webzygote forks, that are currently still handled
differently.

This includes

1. Add ZygoteCommandBuffer, and switch the argument parsing code to use it.
This slightly reduces allocation and enables (3).

2. Support process specialization in the child, even when the arguments
are already know, Leverages existing Usap code.

3. Add support for forking multiple child processes directly to the
ZygoteCommandBuffer data structure. This directly uses the buffer
internals, and avoids returning to Java so long as it can handle the
zygote commands it sees.

FUNCTIONALITY CHANGE:

We now limit the total size of the zygote command, rather than the
number of arguments.

Initial performance observations:

[ These are not perfect, since I'm comparing to numbers before I
started. There may have been other moving parts, but they should be
minor. ]

System-server-observed launch latency:

[Not the best metric, but easy to measure. In particular, this
does not represent a significant reduction in application launch
time.]

Based on measuring the last 10 launches in a lightly used cf AOSP
instance, the system server latency from requesting an app launch to
response with the pid (which does not require the child to execute
anything) went from an average of about 10.7(25) msecs to 6.8(9) and
7.9(16) in two tries with the CL. (The parenthetical numbers are
maxima from among the 10; the variance appears to have decreased
appreciably.)

Dirty pages:

The number of private dirty pages in the zygote itself appears to have
decreased from about 4000 to about 2200. The number of dalvik-main
private dirty pages went from about 1500 to nearly zero.

Initially ART benchmarking service claim -1.88% in PSS. But this is not
consistently repeatable.

Drive-by fix:

Call setAllowNetworkingForProcess on usap / native loop path.

Bug: 159631815
Bug: 174211442
Test: Boots AOSP
Change-Id: I90d2e381bada1b6c9857666d5e87372b6a4c1a70
2021-02-23 15:03:40 -08:00
TreeHugger Robot
957680b76f Merge "Fix Vibrator and VibratorManager public API docs" into sc-dev am: 1d55488df5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13671772

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I333321bad888df8c3760e6c3851a26b723e5422c
2021-02-23 19:18:13 +00:00
TreeHugger Robot
1d55488df5 Merge "Fix Vibrator and VibratorManager public API docs" into sc-dev 2021-02-23 19:00:43 +00:00
Lais Andrade
89d7a876fa Fix Vibrator and VibratorManager public API docs
Add information about value returned by Vibrator.getId, including a
description of what the default -1 value represents.

Fix description of CombinedVibrationEffect arguments to
VibratorManager methods.

Fix: 180962151
Fix: 180963421
Test: N/A
Change-Id: I3fab2d5fe299be5a951f32bd75eb2e5275ef6e56
2021-02-23 17:23:18 +00:00
Songchun Fan
ba6118561d Merge "[pm] smooth transition from install progress to incremental loading progress" into sc-dev am: df9c8ba64b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13619076

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I592fe868b17c4178ae391655680ab673de8b531d
2021-02-23 16:58:28 +00:00
Songchun Fan
a67a1a9841 [pm] smooth transition from install progress to incremental loading progress
Previously, regardless of the downloading progress reported by the client,
right before installation completion, we publish the install progress
as 0.9. For incremental installs, because we will publish the
incremnetal loading progress after the installation completion, we
might see the progress going backward, because the incremental loading
progress is likely less than 0.9.

For a smoother transition, we do not overwrite the client progress.
Instead, during committing, publish the incremental loading progress
while making sure the progress doesn't go backwards. After committing,
the launcher will keep showing the incremental loading progress.

+ Making sure the installer's incremental progress listener is
unregistered after session is committed.

See the demo video for an example. Notice that the progress is changed
during "Installing..." (around 00:35).

BUG: 180040329
Test: manual
Change-Id: I6c30b0dac6758fd103ed6a985ca39b6f8557ba8f
2021-02-22 22:25:51 +00:00
Treehugger Robot
e0db8b998f Merge "BugreportManager API review updates." 2021-02-22 21:46:41 +00:00
Tianjie Xu
7444774737 Merge "Throw an exception in RoR api on no-pin case" 2021-02-22 20:42:35 +00:00
Dmitri Plotnikov
80c0c66edc Convert WifiPowerCalculator to work with BatteryUsageStats
Also, combine WifePowerCalculator and WifiPowerEstimator: they
have a lot more in common than different.

Bug: 158137862
Test: atest WifiPowerCalculatorTest

Change-Id: Ib937102043a1fe04941ecfd09b5077b14058e6ef
2021-02-22 11:35:14 -08:00
TreeHugger Robot
28a92fd4f8 Merge "Adds caller check to getAllPackages()" into sc-dev 2021-02-22 18:23:55 +00:00
Kweku Adams
e6904ada6a Merge "Remove unnecessary permission check." into sc-dev am: 0c89d4b843
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13616884

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I94103b01d0644395d15e400996924f89dd1719ae
2021-02-22 16:57:51 +00:00
Kweku Adams
0c89d4b843 Merge "Remove unnecessary permission check." into sc-dev 2021-02-22 16:55:01 +00:00
Kholoud Mohamed
222b5c70d9 Merge "Expose isUserKeyUnlocked as a TestAPI" into sc-dev am: bfe45b77f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13567147

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iaa9ef78829cdc0420daf949ae97ee1fe97392333
2021-02-22 16:01:52 +00:00
Kholoud Mohamed
bfe45b77f8 Merge "Expose isUserKeyUnlocked as a TestAPI" into sc-dev 2021-02-22 15:46:21 +00:00
Charles Chen
aa6de2e6e8 Unhide isUiContext()
... because it is more tied to Context instance that developers
are working with.

Bug: 179308116
Test: atest ContextIsUiContextTest
Change-Id: I41d90c4b5b81b430fc8007a0bdf86c6fd1c54400
2021-02-22 08:38:52 +00:00
TreeHugger Robot
8a0a87003a Merge "Constrain scaled amplitude to valid values in [1,255]" into sc-dev am: 81c669d39b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13519387

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I19d177ad2adfdd918ff8d5f9b1f20cfb589fe43e
2021-02-22 03:33:18 +00:00
Lais Andrade
2356453306 Constrain scaled amplitude to valid values in [1,255]
Scaling down low amplitudes can lead to one-shot effects with amplitude
zero, which leads to an invalid VibrationEffect and causes
IllegalArgumentException to be thrown on an originally valid effect.

Bug: 179674498
Test: VibrationEffectTest
Change-Id: Ie653084d37f9bfed20aac25f8805ffdf40661e03
2021-02-22 01:08:18 +00:00
TreeHugger Robot
c1fd0badfc Merge "Measured energy for Ambient Display in BatteryUsageStats" into sc-dev am: 863e3fee2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13556589

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia6c80f20a5ac02b2cc9c892bedfa78b5c479fb94
2021-02-21 20:12:50 +00:00
TreeHugger Robot
863e3fee2b Merge "Measured energy for Ambient Display in BatteryUsageStats" into sc-dev 2021-02-21 19:08:28 +00:00
Dmitri Plotnikov
5363df4157 Merge "Copy custom measured power to BatteryUsageStats" into sc-dev am: 919528f401
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13564227

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7c3c00c53721aaf0604cf718dbcb16961fe525c6
2021-02-21 18:35:11 +00:00
Xin Li
be473bf819 Merge ab/7061308 into stage.
Bug: 180401296
Merged-In: I4bf82035631ccff6d5a6144d6d9b1d203b076851
Change-Id: I1b5f3a672a55eaabba0f5389bab110b395553559
2021-02-21 09:39:53 -08:00