Commit Graph

6791 Commits

Author SHA1 Message Date
Felipe Leme
e5434c301b Initial implementation of system service optimizations for different type of users.
On R, we want to optimize boot time by not starting system services for some types of users,
like a headless system user (which is the case for Automotive)

As a "guinea pig", it optimizes VoiceInteractionService for headless system user, so the 3rd-party app
service is not bound for user 0 (and hence its process is not launched).

This change improves boot time on Automotive in about 100ms.

Test: atest CtsVoiceInteractionTestCases CtsAssistTestCases # on walleye and Automotive
Test: manual verification on logcat

Bug: 133242016
Fixes: 137878080

Change-Id: Ib0a902855e32691a1d00bfa77ee82c8e2430977c
2019-08-13 10:10:53 -07:00
Jing Ji
a736da8213 Add RSS to dumpsys meminfo
Include the RSS info into the meminfo output of dumpsys and
incident_report.

Bug: 117880513
Test: adb shell dumpsys meminfo
Test: cts-tradefed run cts-dev --module \
      CtsIncidentHostTestCases --test \
      com.android.server.cts.MemInfoIncidentTest
Change-Id: Id1058e279b7ca6925b59a6a523e0f0d14d830761
2019-08-09 22:57:50 +00:00
Makoto Onuki
7c730311ea Merge "Remove build time dependency from BatteryStats to JobParameters" 2019-08-09 20:38:34 +00:00
Jeff Sharkey
7c2a8686c6 Merge changes from topic "callz"
* changes:
  Expand ContentProviderOperation to support call().
  Add nullability annotations for current behavior.
2019-08-09 16:01:23 +00:00
Makoto Onuki
9111d1dcec Remove build time dependency from BatteryStats to JobParameters
In preparation of moving the jobscheduler framework code to its
own jar.

Bug: 138793378
Test: dumpsys batterystats  -c | grep jbc and make sure the line looks correct

Change-Id: I9938c99e37bd44e522e5f8d8e95772e69d5be492
2019-08-08 15:33:37 -07:00
Jeff Sharkey
7d6fd4b82a Expand ContentProviderOperation to support call().
ContentProviderOperation has long supported basic operations like
insert(), update(), and delete(), but it was never extended to
support the general-purpose call() method.

This change adds support for call(), including configuration of the
extras Bundle using back-references to other operations.  In
addition, the output Bundle from call() can be used for
back-references from other operations.

Clean up how back-references are handled internally; we now store
either a literal value in each slot, or an explicit BackReference
instance which we can "instanceof" check to resolve when needed.

Also add withExceptionAllowed() capability, which can be used to
catch and report the failure of a single operation while allowing
any subsequent operations to proceed.  Adds various nullability
annotations to reflect the behavior of all existing logic.

Bug: 131598520
Test: atest android.content.cts.ContentProviderOperationTest
Test: atest android.content.cts.ContentProviderResultTest
Change-Id: I1744bf8fc1ad048aa96460d487c2867c4c81d7b3
2019-08-08 14:40:29 -06:00
Nicolas Geoffray
a98e4142f6 Merge "Notify the ART runtime when boot is complete." am: f83748ae28 am: 6b9ab57b2d am: ed22d5f05c am: 8f93d19459
am: 6e16874401

Change-Id: Icc2ec9b98c8b507f2431ef60a4cd7bbe11bab430
2019-08-08 06:02:32 -07:00
Nicolas Geoffray
8f93d19459 Merge "Notify the ART runtime when boot is complete." am: f83748ae28 am: 6b9ab57b2d
am: ed22d5f05c

Change-Id: I88c5ab8807446464854d59f95ffc2877fa6aa963
2019-08-08 05:43:38 -07:00
Nicolas Geoffray
ed22d5f05c Merge "Notify the ART runtime when boot is complete." am: f83748ae28
am: 6b9ab57b2d

Change-Id: I5466b6f73087c6dea67c9b7cfaa3bf55bacb8a23
2019-08-08 05:32:55 -07:00
Nicolas Geoffray
6b9ab57b2d Merge "Notify the ART runtime when boot is complete."
am: f83748ae28

Change-Id: Iea67d64570657173832ee0d61288dc97af11496b
2019-08-08 05:11:55 -07:00
Nicolas Geoffray
f83748ae28 Merge "Notify the ART runtime when boot is complete." 2019-08-08 11:58:06 +00:00
David Srbecky
6d0d7066cf Notify the ART runtime when boot is complete.
Needed for jit-zygote performance improvements.

Test: device boots
Bug: 119800099
Change-Id: I1e46f49d94440384473430d8afebe29fbee9c68e
2019-08-08 07:57:35 +00:00
PO HUNG CHEN
a3c58bf44b Merge "Clean up usage on deprecated GSID methods" 2019-08-08 06:32:53 +00:00
Nandana Dutt
d24128264f Merge "Remove obsolete methods from DumpstateListener implementations" am: cbdb10f982 am: b745860a3e
am: 82446aa5b6

Change-Id: Idbf64e9fb70f39ae547ab3283ca6eb03b95db32d
2019-08-07 07:39:17 -07:00
Nandana Dutt
82446aa5b6 Merge "Remove obsolete methods from DumpstateListener implementations" am: cbdb10f982
am: b745860a3e

Change-Id: Idd72ca09a0256c3e1283fd0c9d73a29939de4778
2019-08-07 07:28:15 -07:00
Nandana Dutt
b745860a3e Merge "Remove obsolete methods from DumpstateListener implementations"
am: cbdb10f982

Change-Id: Ia746b0cdadd0c4d652c373763f7a12266b080e3b
2019-08-07 07:08:27 -07:00
Nandana Dutt
47c5ecc50a Remove obsolete methods from DumpstateListener implementations
Note that with the new Bugreporting API, SystemServer is the only
expected DumpstateListener implementation. Once we fully migrate Shell
app, we can remove the implementation in BugreportService as well.

BUG: 128980174
Test: bugreport from power menu, observe progress bar

Change-Id: I40d654a70bd9ceb3a29f8a0113b85616100f4ee9
Merged-In: I40d654a70bd9ceb3a29f8a0113b85616100f4ee9
2019-08-06 17:43:11 +00:00
Nandana Dutt
ecc40227b6 Merge "Remove obsolete methods from DumpstateListener implementations" 2019-08-06 16:21:34 +00:00
Howard Chen
295d74964f Clean up usage on deprecated GSID methods
change: Add a oneShot argument to setEnable

remove: commit() and replace it with enableGsi

rename: removeGsiInstall -> removeGsi
rename: disableGsiInstall -> disableGsi

Bug: 138969329
Test: adb shell am start-activity \
    -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
    -a android.os.image.action.START_INSTALL \
    -d file:///storage/emulated/0/Download/system.raw.gz \
    --el KEY_SYSTEM_SIZE $(du -b system.raw|cut -f1) \
    --el KEY_USERDATA_SIZE 8589934592

Change-Id: I680013c8b1181599f0b858222bd92e31c5f085fd
2019-08-06 11:39:20 +08:00
Noah Zimmt
4e878506d7 Merge "Avoid calling installd where not needed" 2019-08-05 19:06:08 +00:00
Noah Zimmt
b255807189 Avoid calling installd where not needed
The method StorageStatsManager#getCacheBytes is called several times
during package installation. It calls
InstalldNativeService::getUserSize via a binder call.

The runtime of getUserSize is variable; I have traces where it takes
50ms and traces where it takes 500ms.

The return value of getUserSize used to take into account freeable cache
space when determining available space on a given volume. In most cases,
it is possible to first do a pessimistic check of the space available on
the volume - forgoing the installd call - and only consider cache space
if the pessimistic check fails.

This avoids a binder call + the time spend in getUserSize for most
installs.

Bug: None
Test: atest frameworks/base/core/tests/coretests/src/android/content/pm/PackageHelperTests.java
cts/tests/tests/os/src/android/os/storage/cts/StorageManagerTest.java
Change-Id: Icaecee732ef330fee1b409d2dd76723822c25959
2019-08-05 11:25:22 -07:00
Patrick Baumann
2f2fd718e6 Removes direct use of LocalServices.getService
To improve testability, we're relying on dependencies passed into
PackageManagerService via constructor. This change addresses all
dependencies fetched via LocalServices and context.getSystemService.

Test: atest ScanTests
Bug: 137881067
Change-Id: Ifa781fadc44996f3a88db40a956dd0e0d1f9ebb2
2019-08-02 09:43:49 -07:00
Artur Satayev
70507ed5a1 Add @UnsupportedAppUsage annotations for max-p.
See go/UnsupportedAppUsage for more details.

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 137350495
Test: m
Change-Id: I5aa29a49b193db47aaee4d3a756c17f48cc9f0b1
2019-08-01 19:46:29 +01:00
Dan Zhang
99c738bb94 Merge "Fix the reference leak on RemoteCallbackList" am: be30d27a8a am: ea493e4c77 am: dbf00b6a0b am: c8029bfbc3
am: 88d4bf0964

Change-Id: Ie51d3979ff7b74068203a43a85dd56a8a9e693e7
2019-08-01 09:50:52 -07:00
Nandana Dutt
56659ae22f Remove obsolete methods from DumpstateListener implementations
Note that with the new Bugreporting API, SystemServer is the only
expected DumpstateListener implementation. Once we fully migrate Shell
app, we can remove the implementation in BugreportService as well.

BUG: 128980174
Test: bugreport from power menu, observe progress bar

Change-Id: I40d654a70bd9ceb3a29f8a0113b85616100f4ee9
2019-08-01 16:08:56 +01:00
Dan Zhang
c8029bfbc3 Merge "Fix the reference leak on RemoteCallbackList" am: be30d27a8a am: ea493e4c77
am: dbf00b6a0b

Change-Id: If49b4ffddb6e578d82c1ad4b6c26f8153bb48a3a
2019-08-01 00:58:51 -07:00
Dan Zhang
dbf00b6a0b Merge "Fix the reference leak on RemoteCallbackList" am: be30d27a8a
am: ea493e4c77

Change-Id: Iffc4beb2fd5c30a35a744c133186826cd7f487b8
2019-08-01 00:37:46 -07:00
Dan Zhang
ea493e4c77 Merge "Fix the reference leak on RemoteCallbackList"
am: be30d27a8a

Change-Id: Ibf79be3f125ab58c8048c15f3f6f3a3e693295e7
2019-07-31 22:19:30 -07:00
Dan Zhang
be30d27a8a Merge "Fix the reference leak on RemoteCallbackList" 2019-08-01 05:03:03 +00:00
Josh Gao
cdca6b559c Merge changes I9350ec13,I809d9191,I235f727d,I1930f3ba
am: a0c949d5de

Change-Id: I1633d9eae6f162e338990766e62e3aa3873df606
2019-07-31 21:46:23 -07:00
Josh Gao
75f730abaf SharedMemory: use fdsan to protect our fd.
Bug: http://b/138422309
Test: booted, saw the GraphicsStatsService fd misacquisition
Change-Id: I9350ec13e523e1bf86797a1231769d890f277008
2019-07-31 15:19:11 -07:00
Josh Gao
9fdb8f9910 Revert "Revert "SharedMemory: break Cleaner reference cycle.""
This commit was reverted in Q because it broke things, but we want it in
master.

This reverts commit c36d0765a25d4701980738dc3e2053f19eb3d6b8.

Change-Id: I809d9191eee4909d265d2864ebd523f262f6bb61
Test: treehugger
2019-07-31 15:19:11 -07:00
Adam Seaton
9428f73436 Revert "SharedMemory: break Cleaner reference cycle."
Bug: 138422309

This reverts commit 390d9e6a18.

Reason for revert: crashes documented in b/138422309

Change-Id: I235f727d0fe87c09f6f05dddcae7759bab64dfd8
Merged-In: I235f727d0fe87c09f6f05dddcae7759bab64dfd8
(cherry picked from commit b16411f83a)
2019-07-31 15:19:11 -07:00
John Reck
51969a1758 Merge "Fix regression in PFD#fromData" into qt-r1-dev am: 1775a48935 am: 1efbccc58d
am: 524d0b6f8c

Change-Id: I8bd5bd2d779fe838b5c53481e1989be7e7847d3e
2019-07-29 16:15:28 -07:00
John Reck
524d0b6f8c Merge "Fix regression in PFD#fromData" into qt-r1-dev am: 1775a48935
am: 1efbccc58d

Change-Id: Ifa8cc2718ec176143c835c824c09cccb747914b0
2019-07-29 15:35:14 -07:00
John Reck
c3ca72ca5b Merge "Fix regression in PFD#fromData" into qt-r1-dev
am: 1775a48935

Change-Id: Icf8fb72af14eb1cd16765a36e9fca4f9f5fdb265
2019-07-29 15:10:04 -07:00
John Reck
1775a48935 Merge "Fix regression in PFD#fromData" into qt-r1-dev 2019-07-29 21:23:57 +00:00
bsears
4dcd747290 Merge "Merge "Revert "SharedMemory: break Cleaner reference cycle." Bug: 138422309" into qt-dev am: d4b0c9348a am: 868ac4f3a1 am: a53549d307" into qt-qpr1-dev-plus-aosp
am: 6ea7d84278

Change-Id: Ie92c672911f824a9650dd89fba94a9aa6dc87b0e
2019-07-26 17:54:19 -07:00
bsears
da5d7a7b03 Merge "Revert "SharedMemory: clear file descriptor when explicitly closed." Bug: 138422309" into qt-dev am: 480f1db9bc am: 87216d7403 am: d15de9d187
am: 4432f424d6

Change-Id: I20c604b9c40423525988376769d2a1cb81926064
2019-07-26 17:23:20 -07:00
bsears
393caff3cb Merge "Revert "SharedMemory: break Cleaner reference cycle." Bug: 138422309" into qt-dev am: d4b0c9348a am: 868ac4f3a1
am: a53549d307

Change-Id: Ie7a0f95a0b260ecfdaf74d9637363c40b0550142
2019-07-26 17:20:07 -07:00
bsears
206ab727cf Merge "Revert "SharedMemory: break Cleaner reference cycle." Bug: 138422309" into qt-dev am: d4b0c9348a
am: b0e003f2c8

Change-Id: Icf894b94730571311439360533cfdc6ffca227f2
2019-07-26 17:12:20 -07:00
bsears
d15de9d187 Merge "Revert "SharedMemory: clear file descriptor when explicitly closed." Bug: 138422309" into qt-dev am: 480f1db9bc
am: 87216d7403

Change-Id: Ie6221fa2e0069b28284c37eea0a90327dd7164d6
2019-07-26 16:55:22 -07:00
bsears
b0e003f2c8 Merge "Revert "SharedMemory: break Cleaner reference cycle." Bug: 138422309" into qt-dev
am: d4b0c9348a

Change-Id: Ic8ff79117a25be51cccf4e1492e3dea87a045eb5
2019-07-26 16:36:19 -07:00
bsears
868ac4f3a1 Merge "Revert "SharedMemory: break Cleaner reference cycle." Bug: 138422309" into qt-dev
am: d4b0c9348a

Change-Id: Icef464ff04de9d1e300161383251e35d557ca973
2019-07-26 16:35:31 -07:00
bsears
de6bfd230c Merge "Revert "SharedMemory: clear file descriptor when explicitly closed." Bug: 138422309" into qt-dev
am: 480f1db9bc

Change-Id: Ib346fb19a7be0635fe9e15d0fc6a307a614fb1c5
2019-07-26 16:31:52 -07:00
bsears
87216d7403 Merge "Revert "SharedMemory: clear file descriptor when explicitly closed." Bug: 138422309" into qt-dev
am: 480f1db9bc

Change-Id: I3ba90a97cc16bcf29c15073c252c382450ae4a71
2019-07-26 16:31:40 -07:00
John Reck
12ea937f8f Fix regression in PFD#fromData
Don't rely on the GC to clean up FD resources when they can
just be cleaned up immediately. We know the MemoryFile isn't
going to be used any further, so just close it.

Bug: 138323667
Test: Repro steps in bug. Verified addresses FD leak in system_server from repeatedly opening & closing settings.
Change-Id: Ic82006c9cb48f580aaad942c4679e774186382c9
2019-07-26 23:19:05 +00:00
Josh Gao
a4a7c1a0a5 Merge "SharedMemory: clear file descriptor when explicitly closed."
am: e33db449d8

Change-Id: I699605f2c6c7f0e24f9646d692b45c71dd88fc91
2019-07-26 15:08:05 -07:00
Adam Seaton
b16411f83a Revert "SharedMemory: break Cleaner reference cycle."
Bug: 138422309

This reverts commit 390d9e6a18.

Reason for revert: crashes documented in b/138422309

Change-Id: I235f727d0fe87c09f6f05dddcae7759bab64dfd8
2019-07-26 17:17:16 +00:00
Adam Seaton
5966196515 Revert "SharedMemory: clear file descriptor when explicitly closed."
Bug: 138422309

This reverts commit 20ab1e3427.

Reason for revert: crashes documented in b/138422309

Change-Id: Ic9e33fdb24bad2b30f0eb357d6752c1834df41d5
2019-07-26 17:17:03 +00:00