Commit Graph

12208 Commits

Author SHA1 Message Date
Winson Chiu
7267e3ef6b Merge "Deprecate PackageParser#Package" 2019-09-27 18:02:56 +00:00
TreeHugger Robot
a3dfb5f2c4 Merge "Integrate pooled lambda with systrace." 2019-09-27 17:18:07 +00:00
Felipe Leme
4bc790d232 Integrate pooled lambda with systrace.
Looper traces handler calls by calling Handler.getTraceName(), which when used with PooledLambda
ends up showing just:

"android.os.Handler: com.android.internal.util.function.pooled.PooledLambdaImpl"

That name doesn't help understand what's the real bottleneck, and even worse, could let people
think it's the PooledLambda who's causing it.

Which this change, it will display names like:

com.android.server.appop.AppOpsService$Lambda
com.android.server.wm$Lambda

Fixes: 141172840
Test: manual verification (neither PoolLambda nor Message have unit tests)

Change-Id: I80d2158a50a644b10f3724fb42a4a9c2aee63ae9
2019-09-26 16:45:43 -07:00
Winson
243e7ea14b Deprecate PackageParser#Package
Replaces PackageParser#Package and it's related structures with
ParsingPackage, ParsedPackage, and AndroidPackage.

This is a large scoped CL, the first step in an eventual goal
to refactor how data is handled in the package parsing and install
process. It introduces as few logic changes as necessary. Mostly
migrating to interfaces and renaming, moving parsing data calls into
3 separate interfaces that outline the intended flow for parsing.

ParsingPackage is built and used during what was PackageParser, now
replaced by ApkParseUtils and it's related classes. This is almost
exactly what was parsed from the XML/files on disk.

ParsedPackage is used when the object exits PackageParser and is
adjusted by PackageManagerService to what is considered the final
"parsed" state, adjusted from literal values, but consistent given
the same APK on disk. This should eventually be moved out of PMS
and possibly collapsed into the previous interface entirely.

AndroidPackage is the final state of the package after parsing and
adjustment has completed and no more mutations should be expected.
There are a few exceptions to this, included in AndroidPackageWrite,
which will eventually be refactored into PackageSetting or another
state class.

This marks PackageParser#Package and all the old infrastructure with
@Deprecated, as none of them are used internally. All usages were
converted, and the legacy Package is only built for un-converted tests
and @UnsupportedAppUsage methods.

There are numerous TODOs still outstanding, but addressing them
in this initial CL would introduce several logic changes. They've been
marked with the bug number and will be handled in follow ups.

This is being merged with caution thrown to the wind because
testing this on devices and in development will be the best way
to debug differences introduced by the migration. Getting it merged
as early as possible gives the most amount of time to fix regressions.

Waiting for tests of all the functionality could take literal years
before covering enough to merge this with all regressions verified.

Given a sample size of 4 heap dumps and the caveat it was taken very
early in the migration, there is a memory overhead of about 200 KB
versus the legacy implementation. This should be verified more
accurately and addressed in follow ups.

This CL also kills child/parent package support, since that's
broken already, and difficult to support with the new interface
structure.

Bug: 135203078

Test: booted an emulator, works generally as expected

Specific tests which failed / failed to build were fixed, but because
not all tests are currently passing before this change, not all were
verified.

Change-Id: I4ba050c228e6c60b8f63a9e3347b1f9a57ef794a
2019-09-26 13:27:17 -07:00
Tobias Thierer
2ee7cf7386 Merge "Introduce ZygoteInit.preForkInit()." am: 52efd46075 am: 4edffff80a am: 023ae56991
am: a3dc6e86fc

Change-Id: I0f30ca38d41c5aa9e444e29d0d23b346dc12909d
2019-09-26 12:36:50 -07:00
TreeHugger Robot
d09a2bf54e Merge "Nullcheck ServiceConnector argument" 2019-09-26 19:33:49 +00:00
Tobias Thierer
a3dc6e86fc Merge "Introduce ZygoteInit.preForkInit()." am: 52efd46075 am: 4edffff80a
am: 023ae56991

Change-Id: I4f6fcc59933e31f0c99d10a5da83aa8c66e5fc3a
2019-09-26 12:29:56 -07:00
Tobias Thierer
023ae56991 Merge "Introduce ZygoteInit.preForkInit()." am: 52efd46075
am: 4edffff80a

Change-Id: Ifc0061d8cf9ee3c5860f31fa9ad821bfcd0b6a88
2019-09-26 12:20:55 -07:00
Tobias Thierer
4edffff80a Merge "Introduce ZygoteInit.preForkInit()."
am: 52efd46075

Change-Id: I5bc25ca924624283126a584917f5adb6ff6eed03
2019-09-26 12:08:06 -07:00
Tobias Thierer
52efd46075 Merge "Introduce ZygoteInit.preForkInit()." 2019-09-26 18:38:39 +00:00
atrost
1904bb31ad Merge "Refactor ChangeReporter and rate limit stats logging." am: 9a253e12cc am: 76191fa6b0 am: 604f8002d8
am: 7564285e10

Change-Id: Ib6605757514b90ec5fb2df03f08fc7d48d12e08e
2019-09-26 10:59:12 -07:00
atrost
7564285e10 Merge "Refactor ChangeReporter and rate limit stats logging." am: 9a253e12cc am: 76191fa6b0
am: 604f8002d8

Change-Id: I5ed4a64b701041393026b742bc3f451d73c4ed33
2019-09-26 10:52:39 -07:00
atrost
604f8002d8 Merge "Refactor ChangeReporter and rate limit stats logging." am: 9a253e12cc
am: 76191fa6b0

Change-Id: I8c853fb3e09a83ad877f02132608884cfaba966f
2019-09-26 10:45:54 -07:00
atrost
76191fa6b0 Merge "Refactor ChangeReporter and rate limit stats logging."
am: 9a253e12cc

Change-Id: I33b14641d259efea6bf7038da264a3483e71f955
2019-09-26 10:39:31 -07:00
Eugene Susla
2ffea17af2 Nullcheck ServiceConnector argument
Fixes: 141617464
Test: presubmit
Change-Id: I511175ccca23f482892887007e4e8e5b06f00832
2019-09-26 10:33:18 -07:00
Tobias Thierer
a45917eb77 Introduce ZygoteInit.preForkInit().
Until recently, I and apparently some others were under the assumption
that RuntimeInit.commonInit() runs before the Zygote fork. Actually, it
does not.

This CL introduces a method ZygoteInit.preForkInit() which runs before
the Zygote fork. For now, only enableDdms() moves into it and can become
private. This should not alter behavior since enableDdms() is called
from the same places as before, and because enableDdms() (now private)
was already not part of any API surface.

The CL also removes the qualifier "final" from the (static) method
enableDdms(), because it is redundant.

Note: This CL was uploaded with --no-verify because of preexisting
import ordering issues in RuntimeInit.java

Test: Treehugger
Change-Id: I8f637e160a2d7810feb43b6a43ec7d628af18fb8
2019-09-26 16:08:59 +01:00
atrost
6624ffa207 Refactor ChangeReporter and rate limit stats logging.
Only log once per change-package-state(resets every app launch if used
from within the app process).

Next: reset every app launch for server usage as well.

Test: using the test app.
Bug: 138374585
Change-Id: I5587f7138cf2cd8d144e88cf294e65c14bb32bfb
2019-09-26 12:59:19 +01:00
Anna Trostanetski
bbf394bf19 Merge "Add package name based APIs to PlatformCompat." am: ef530d9fa4 am: 29a23e753a am: 0a96b3aff3
am: 6dd3bf2e50

Change-Id: Id6ca3662746565a63f6a5db4fa4f67227b9215da
2019-09-25 12:35:26 -07:00
Anna Trostanetski
6dd3bf2e50 Merge "Add package name based APIs to PlatformCompat." am: ef530d9fa4 am: 29a23e753a
am: 0a96b3aff3

Change-Id: I6844ad19650aef716339e2b6a1d91cfe93f0115a
2019-09-25 12:28:52 -07:00
Anna Trostanetski
0a96b3aff3 Merge "Add package name based APIs to PlatformCompat." am: ef530d9fa4
am: 29a23e753a

Change-Id: I1872639b936ddd40a0b4aa75b418faec4d04f308
2019-09-25 12:21:48 -07:00
Anna Trostanetski
29a23e753a Merge "Add package name based APIs to PlatformCompat."
am: ef530d9fa4

Change-Id: Ib6e31e0439efd856cc834ee5590e2419c25f3197
2019-09-25 12:04:33 -07:00
TreeHugger Robot
be0f335f5a Merge "Whitelist packages for user types" 2019-09-25 18:45:13 +00:00
atrost
12d0da3179 Add package name based APIs to PlatformCompat.
The APIs behave the same as the AppInfo APIs, and returns the change is
enabled if there is no installed package with the provided name.

Test: flashed device, used the test app, and made the API use the new
      per-package API.
Bug: 138275545

Change-Id: Ic925751dddc6c2e0996fe195a208f5c689554839
2019-09-25 16:32:07 +01:00
Zimuzo Ezeozue
a56baba8cb Merge "Support a mount mode to bypass FUSE on /storage" 2019-09-25 12:29:38 +00:00
Zim
74a9bbae98 Support a mount mode to bypass FUSE on /storage
When Zygote forks a process with the MOUNT_MODE_PASS_THROUGH
flag, bind mount the pass_through path into /storage for the
process, allowing the process to bypass FUSE.

Bug: 140064376
Test: cat /proc/<pid of app with pass_through flag>/mountinfo shows
the lower fs bind mounted directly on /storage

Change-Id: Ia212c2c71ecfdc1629739ca8af171f332ccfca72
2019-09-25 13:05:30 +01:00
Bookatz
04d7ae5c6f Whitelist packages for user types
Creates a new SystemConfig xml entry which allows a device to whitelist
system packages to be installed on users when they are created, based on
the type of user.

System packages will be installed on users when they are created, or
during OTAs, based on this whitelist. The whitelist can be
enabled/disabled via a Config resource.

For any user type, system packages can be whitelisted or blacklisted.
If it is both (for the same user type), the blacklist takes priority.
If it is neither, it won't be installed (since it isn't whitelisted).

If a system package isn't mentioned in the whitelist file at all, for
any user, then its behaviour depends on the Config resource value, which
can optionally implicitly whitelist all such apps on all users.

For now, the list is mostly empty and the default config is set to be
enabled but implicitly whitelist all system packages that are not
mentioned.

Test: atest FrameworksServicesTests:SystemConfigTest
Test: atest com.android.server.pm.UserManagerServicePackageWhitelistTest
Test: manually test user 0 by flashall -w and checking packages
Test: manually test OTA by setting setprop persist.pm.mock-upgrade 1
Bug: 134605778

Change-Id: Ia098c1f597f66a1c946cfcc9b7771c25e8ceabf7
2019-09-24 09:38:58 -07:00
Vishnu Nair
196200dec2 Merge "Don't hold wm lock when intercepting keys" 2019-09-23 23:55:30 +00:00
Vishnu Nair
539334aa8a Don't hold wm lock when intercepting keys
We need to check the window type and some private flags to figure out if we should
intercept the home key. Instead of holding checking the WindowState associated with
the window token, check a separate map that contains a snapshot of the relevant info.

Bug: 134365580

Test: atest KeyboardInterceptorTest
Test: go/wm-smoke
Test: home key works
Change-Id: Ica60cef649754095f5c1ed6204a9b1581a07bfc6
2019-09-20 10:46:21 -07:00
TreeHugger Robot
a18d21345e Merge "Check for file existence before reading it." 2019-09-19 22:03:14 +00:00
Anna Trostanetski
28fa70f0e0 Merge "Implement stats logging for Compatibility API." into stage-aosp-master am: 81e186ab99
am: 44b8ba5095

Change-Id: I0a7652cc97b7b50fc3797b26582b09caa0617a16
2019-09-18 03:55:45 -07:00
Anna Trostanetski
44b8ba5095 Merge "Implement stats logging for Compatibility API." into stage-aosp-master
am: 81e186ab99

Change-Id: I48e2e3cdc23cdfcc541a5912aec20435ebc4c0c8
2019-09-18 03:42:49 -07:00
Anna Trostanetski
13cd9c0b1c Merge "Implement stats logging for Compatibility API." 2019-09-18 10:32:47 +00:00
Vinit Nayak
e9c26cad6e Merge "Redraw legacy navigation bar paint onLayout" into qt-qpr1-dev
am: 10000738e4

Change-Id: I153b1ec594dff63eb13fc386c38820404c095fd4
2019-09-17 09:36:56 -07:00
TreeHugger Robot
10000738e4 Merge "Redraw legacy navigation bar paint onLayout" into qt-qpr1-dev 2019-09-17 16:19:23 +00:00
Mehdi Alizadeh
f472619495 Merge changes I41e08b86,I7760f37d into qt-qpr1-dev am: 30e495d0c4
am: a69031d173

Change-Id: Ia43318041306a97daedc5fd2409caf61ef4f4456
2019-09-16 16:38:31 -07:00
Mehdi Alizadeh
a69031d173 Merge changes I41e08b86,I7760f37d into qt-qpr1-dev
am: 30e495d0c4

Change-Id: Iae876b13f07a0bfe55baff58ca672d93a0f461e3
2019-09-16 16:31:24 -07:00
Mehdi Alizadeh
30e495d0c4 Merge changes I41e08b86,I7760f37d into qt-qpr1-dev
* changes:
  Use ShortcutInfo#rank to order Sharing Shortcuts in ShareSheet
  Adds tests for AppPrediction service availability check
2019-09-16 23:15:22 +00:00
Vinit Nayak
0aa0f133b7 Redraw legacy navigation bar paint onLayout
Navigation bar background wasn't being redrawn
when using legacy navigation bar.

Fixes: 140096278
Test: Open Sheets app, turn landscape, select
a cell, press the "Fx" button on buttom left,
turn portrait and observe no black bar.
Open Sheets app, turn landscape, open recents
and select sheets icon and go into split screen,
choose any other app, click on cell, press "Fx",
turn portrait, observe no black bar.

Change-Id: Ibfe1abdba87a0d66c68478ee206b992c933cd9ad
(cherry picked from commit 7ab1fb8f37)
2019-09-16 21:04:58 +00:00
Mehdi Alizadeh
26a7dfb211 Merge "Add target type flags to set the origin of share targets" into qt-qpr1-dev am: 2a873c7628
am: 205bb67ec8

Change-Id: I328ba7a6ccfdc4b53e288564a1b2bd993ce89a64
2019-09-16 11:47:23 -07:00
Mehdi Alizadeh
205bb67ec8 Merge "Add target type flags to set the origin of share targets" into qt-qpr1-dev
am: 2a873c7628

Change-Id: Iea7aa38cecabd626e803b27ede6473b714bd2d8a
2019-09-16 11:39:03 -07:00
Mehdi Alizadeh
2a873c7628 Merge "Add target type flags to set the origin of share targets" into qt-qpr1-dev 2019-09-16 18:31:09 +00:00
Mehdi Alizadeh
707c0cf361 Use ShortcutInfo#rank to order Sharing Shortcuts in ShareSheet
Sort based on rank only when directly fetching the targets from
ShortcutManager. Otherwise the target from AppPredictionService are
already ordered.

Bug: 140449186
Test: atest ChooserActivityTest
Test: Manual test to verify shortcuts have the same order in Launcher and ShareSheet when AppPredictionService is disabled

Change-Id: I41e08b86746c977c05acea8a5d0654083897741d
2019-09-16 11:28:42 -07:00
Mehdi Alizadeh
e870e97c73 Adds tests for AppPrediction service availability check
Bug: 138595943
Test: atest ChooserActivityTest
Change-Id: I7760f37d3f9fee00648cea5c70e744f1da2bdeca
2019-09-16 11:10:08 -07:00
Vinit Nayak
890ccb94ca Merge "Redraw legacy navigation bar paint onLayout" 2019-09-16 17:58:59 +00:00
Vinit Nayak
7ab1fb8f37 Redraw legacy navigation bar paint onLayout
Navigation bar background wasn't being redrawn
when using legacy navigation bar.

Fixes: 140096278
Test: Open Sheets app, turn landscape, select
a cell, press the "Fx" button on buttom left,
turn portrait and observe no black bar.
Open Sheets app, turn landscape, open recents
and select sheets icon and go into split screen,
choose any other app, click on cell, press "Fx",
turn portrait, observe no black bar.

Change-Id: Ibfe1abdba87a0d66c68478ee206b992c933cd9ad
2019-09-16 17:58:11 +00:00
atrost
e36b1a142f Implement stats logging for Compatibility API.
Add a new atom and log from both the app process API and the system server API
Bug: 136794938
Bug: 138378110
Test: statsd_testdrive 228

Change-Id: I80f07d0beb30c779c4bce70bebf2bb4ab22f6bfe
Merged-In: I80f07d0beb30c779c4bce70bebf2bb4ab22f6bfe
2019-09-16 14:55:53 +01:00
atrost
1516d5290c Implement stats logging for Compatibility API.
Add a new atom and log from both the app process API and the system server API
Bug: 136794938
Bug: 138378110
Test: statsd_testdrive 228

Change-Id: I80f07d0beb30c779c4bce70bebf2bb4ab22f6bfe
Merged-In: I80f07d0beb30c779c4bce70bebf2bb4ab22f6bfe
2019-09-16 14:54:44 +01:00
atrost
01a2093248 Implement stats logging for Compatibility API.
Add a new atom and log from both the app process API and the system server API
Bug: 136794938
Bug: 138378110
Test: statsd_testdrive 228

Change-Id: I80f07d0beb30c779c4bce70bebf2bb4ab22f6bfe
2019-09-16 14:26:01 +01:00
Alison Cichowlas
f296d0597e Merge "Sharesheet - log copy actions." into qt-qpr1-dev am: c1d0b9cc00
am: bef9f3aba6

Change-Id: Ie01a5d6f773942e2188b178bdc0dce9a862627e6
2019-09-14 00:15:12 -07:00
Alison Cichowlas
bef9f3aba6 Merge "Sharesheet - log copy actions." into qt-qpr1-dev
am: c1d0b9cc00

Change-Id: Ifb384080e4d1abd21817275f3bcb7f45ba1a5b1c
2019-09-14 00:08:36 -07:00