Commit Graph

9438 Commits

Author SHA1 Message Date
TreeHugger Robot
2daee6e888 Merge "Resolve IndexOOBException in SigningDetails#hasAncestor" into rvc-dev am: 8ba4e7599a am: bae75d4789 am: 593c7a916c am: 3578fd742d
Change-Id: I46025a75faf75b974341c7ac3a23fbe3c6adf174
2020-04-29 02:20:51 +00:00
TreeHugger Robot
8ba4e7599a Merge "Resolve IndexOOBException in SigningDetails#hasAncestor" into rvc-dev 2020-04-29 01:21:27 +00:00
Michael Groover
09c24c3c4f Resolve IndexOOBException in SigningDetails#hasAncestor
When a package that is part of a shareduid is installed / updated its
lineage is compared against the current signature / lineage for the
shareduid. If the new package has more than one signature in the lineage
an IndexOutOfBoundsException is thrown by SigningDetails#hasAncestor
crashing the system server. This commit ensures the ancestor check
is only performed against the current signer for the shareduid.

Fixes: 155134046
Test: atest SigningDetailsTest
Change-Id: Icef9f21c6901e255e5276085259d2f773f41e858
2020-04-28 15:08:20 -07:00
JW Wang
68d6ab7815 Allow app to specify the rollback data policy in the manifest (1/n)
See b/148098864#comment1.

It makes more sense for an app to declare the data policy in their
manifest, rather than leaving this decision to the installer.

The attribute will be read by RollbackManager during install to decide
which data policy to adopt when committing a rollback.

Also migrate to ApkLiteParseUtils per
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/11069722/1/core/java/android/content/pm/PackageParser.java#1660.

Bug: 148098864
Test: m
Change-Id: Ie6635249ea0dfbd21b0e56080fb492b9949841ec
2020-04-28 10:48:06 +08:00
TreeHugger Robot
046df72d9a Merge "Revert "Q Upstream: Use ParcelFileDescriptor for storing large clip data."" into rvc-dev 2020-04-28 02:12:12 +00:00
Alec Mouri
dd097c3e12 Merge "Remove exposed hidden apis in Point.java" 2020-04-28 01:29:02 +00:00
Mehdi Alizadeh
a2432d0fee Merge "Adds unit tests for ShortcutChangeCallback APIs" into rvc-dev am: 082d0c47b7 am: 3bf7571409 am: bf272b5617 am: 510df71f77
Change-Id: I4640c1502f61f66e86c4e7323f078c07b682a96b
2020-04-27 20:43:03 +00:00
Mehdi Alizadeh
082d0c47b7 Merge "Adds unit tests for ShortcutChangeCallback APIs" into rvc-dev 2020-04-27 19:34:25 +00:00
Mehdi Alizadeh
df11e11cb5 Merge "Include cache-only and pinned-only shortcuts as Sharing shortcuts as well" into rvc-dev am: 666796b0fa am: 663821fd66 am: 9aaec7de21 am: f7ba55df41
Change-Id: I0451afd079636c4666ce0e7e9a35d32cca97a796
2020-04-27 18:39:51 +00:00
Mehdi Alizadeh
666796b0fa Merge "Include cache-only and pinned-only shortcuts as Sharing shortcuts as well" into rvc-dev 2020-04-27 17:47:23 +00:00
Satoshi Niwa
921fc028f3 Revert "Q Upstream: Use ParcelFileDescriptor for storing large clip data."
This reverts commit 472371c6ad.

Reason for revert: The feature should never be enabled on R and above.

Bug: 111577843
Change-Id: I4e15231909d120d548fa7b7623276e518e32f7a5
Test: ClipboardManagerTest
2020-04-25 05:42:59 +00:00
TreeHugger Robot
0feb43fa89 Merge "Revert "Q Upstream: Use ParcelFileDescriptor for storing large clip data."" 2020-04-25 05:30:27 +00:00
Eugene Susla
617188a6df Merge "Update auto revoke deeplink action javadoc: extra -> Uri" into rvc-dev am: 181ef8dfa1 am: d57a34e141 am: a986bee4ed am: 835cf73a54
Change-Id: Icc15d2d04948945f54da7d76e205b3187612da27
2020-04-24 23:51:09 +00:00
Eugene Susla
181ef8dfa1 Merge "Update auto revoke deeplink action javadoc: extra -> Uri" into rvc-dev 2020-04-24 22:27:00 +00:00
Mehdi Alizadeh
e65b53e5d7 Include cache-only and pinned-only shortcuts as Sharing shortcuts as well
Bug: 154249544
Test: atest com.android.server.pm.ShortcutManagerTest1
            com.android.server.pm.ShortcutManagerTest2
            com.android.server.pm.ShortcutManagerTest3
            com.android.server.pm.ShortcutManagerTest4
            com.android.server.pm.ShortcutManagerTest5
            com.android.server.pm.ShortcutManagerTest6
            com.android.server.pm.ShortcutManagerTest7
            com.android.server.pm.ShortcutManagerTest8
            com.android.server.pm.ShortcutManagerTest9
            com.android.server.pm.ShortcutManagerTest10
Change-Id: Iacbca104e0fee91d80768bd0280db252aca2c5c0
2020-04-23 18:37:08 -07:00
TreeHugger Robot
3cc84ea58a Merge changes from topic "bound status" into rvc-dev am: a721ccdc7c am: a10bf2e92c am: 4ed82d2559 am: fa4eb8985d
Change-Id: I7e560ca1d8ed57abdf9cab5e47cf6c7b6ba3edab
2020-04-23 23:50:27 +00:00
Eugene Susla
f33f0315ad Update auto revoke deeplink action javadoc: extra -> Uri
Test: presubmit
Bug: 153607914
Change-Id: I02816b71a898d3cac0d50f988b1fdc3427067e14
2020-04-23 16:05:03 -07:00
TreeHugger Robot
a721ccdc7c Merge changes from topic "bound status" into rvc-dev
* changes:
  DataLoader cleanup: return plain FD from Java.
  Keep only service binding in DataLoaderManager.
2020-04-23 22:50:46 +00:00
TreeHugger Robot
9088adc266 Merge "Parses package/provider with non-configuration strings" into rvc-dev am: 9b8965044c am: fcd312d89b am: 080d004671 am: ed7ab96b04
Change-Id: I42db8d0acd99053ec89e4ac3edf89e03fe2a3908
2020-04-23 22:11:55 +00:00
TreeHugger Robot
9b8965044c Merge "Parses package/provider with non-configuration strings" into rvc-dev 2020-04-23 20:55:02 +00:00
Alex Buynytskyy
ea1390ff32 Keep only service binding in DataLoaderManager.
This simplifies:
- resource management - no extra copies of controls,
- state management - all states in one place, no more hidden (bound but
not created) state.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I3d16a099c7f42fcf14637c5a8e96bd6f99e073d1
2020-04-23 19:38:44 +00:00
Patrick Baumann
3361f334d5 Parses package/provider with non-configuration strings
Fixes: 153658673
Test: AppEnumerationTests
Change-Id: I7fb09f2746f9ccf151d8675cc4ab1360eac1dcd6
2020-04-23 10:37:25 -07:00
Satoshi Niwa
bd7386df40 Revert "Q Upstream: Use ParcelFileDescriptor for storing large clip data."
This reverts commit 472371c6ad.

Reason for revert: The feature should never be enabled on R and above.

Bug: 111577843
Change-Id: I4e15231909d120d548fa7b7623276e518e32f7a5
Test: ClipboardManagerTest
2020-04-23 22:33:52 +09:00
Kholoud Mohamed
85ad0e0e51 Merge "Fix javadoc for CrossProfileApps#canRequestInteractAcrossProfiles" into rvc-dev am: 4bf358fe39 am: fa63df9f03 am: c676ece481 am: 703ae47969
Change-Id: I06c1ec23b6e8fdcde9011f57fb7f08dbb0195a28
2020-04-23 11:20:24 +00:00
Kholoud Mohamed
4bf358fe39 Merge "Fix javadoc for CrossProfileApps#canRequestInteractAcrossProfiles" into rvc-dev 2020-04-23 10:12:36 +00:00
Charles Chen
1d27e76e9b Merge "Limit number of window context without any window" into rvc-dev am: 1e52a093ae am: 20f72281dd am: 65ca556487 am: 6237d88b9b
Change-Id: I3c2f662692c355cdce63528fc4cb4801e001f40b
2020-04-23 04:30:04 +00:00
Charles Chen
1e52a093ae Merge "Limit number of window context without any window" into rvc-dev 2020-04-23 03:34:37 +00:00
Alex Buynytskyy
fca5f4683c Merge "Packages on IncrementalFS can't have oat dir." into rvc-dev am: d48ca975b6 am: cd800931a2 am: 034cd60ea4 am: f3939dcfb8
Change-Id: Ia6b79061b89d4f619a7203983b0977ea09cc713c
2020-04-22 17:34:04 +00:00
kholoud mohamed
716cf78bfe Fix javadoc for CrossProfileApps#canRequestInteractAcrossProfiles
Remove the app being whitelisted requirement from
the javadoc.

Fixes: 154712757
Test: N/A
Change-Id: Ib476d0b19717e901d26039194d33f8c43f7e3f74
2020-04-22 17:03:21 +00:00
Alex Buynytskyy
d48ca975b6 Merge "Packages on IncrementalFS can't have oat dir." into rvc-dev 2020-04-22 17:01:00 +00:00
Charles Chen
2622d3ef7e Limit number of window context without any window
This change is to prevent misuse of window context from app
and leads to performance drop on system by limit the numer of window
context an app can use. Code snippet below is a sample to cause
this issue:
```
Rect getBounds() {
    Context windowContext = context.createWindowContext(...);
    return windowContext.getSystemService(WindowManager.class)
            .getCuttentWindowMetrics().getBounds()
}
```
This method could be invoked dozens of times and produce dozens of window
tokens. It would slow down the speed of window traversalling. These
token won't be removed until system server has been GC'd.

Test: atest WindowContextTests WindowContextPolicyTests
fixes: 152934797
Bug: 153369119

Change-Id: I927e85a45c05c4d90b51a624ea408ff3a3ffce93
2020-04-22 18:16:56 +08:00
Alex Buynytskyy
d29a2ccced Packages on IncrementalFS can't have oat dir.
Bug: b/154535403
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I7428f3c0a28cc300586ad083cc4ab12082d67e72
2020-04-21 16:39:38 -07:00
Jeff Sharkey
ea636fd945 Merge changes from topic "apr19" into rvc-dev am: b67e70aa40 am: ed91f7aabf am: a650421e92 am: a719ff7c61
Change-Id: I315e0b8f3a4309298951fed20c5a706f4707fd6a
2020-04-21 23:33:54 +00:00
TreeHugger Robot
f5b7654550 Merge "DataLoader statuses, explained." into rvc-dev am: 2f14c3a752 am: c036152905 am: 0fa1ef8ff7 am: 63867839cb
Change-Id: I983e6501ba42610c77ddbc9ad0164c542bbc2b0b
2020-04-21 23:31:57 +00:00
Jeff Sharkey
b67e70aa40 Merge changes from topic "apr19" into rvc-dev
* changes:
  Update some Parcelables to send Strings UTF-8.
  Offer to write Strings through Parcels as UTF-8.
2020-04-21 22:59:40 +00:00
Jeff Sharkey
0223df096c Update some Parcelables to send Strings UTF-8.
An earlier CL with benchmarks has shown that sending strings as UTF-8
is 50% faster for US-ASCII strings, and still 68% faster for complex
strings referencing higher Unicode planes.  (So an improvement in
both cases!)

Since code across the OS still makes heavy assumptions about Parcel
strings typically being UTF-16, we need to carefully migrate
Parcelables by hand, which is what this CLs begins doing.

This is a purely mechanical refactoring with no functional changes.

Bug: 154436100
Test: manual
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ia9e581efd7c40269342b7528ca07363deb843c0f
2020-04-21 22:59:26 +00:00
TreeHugger Robot
2f14c3a752 Merge "DataLoader statuses, explained." into rvc-dev 2020-04-21 22:44:40 +00:00
Alex Buynytskyy
785957d352 DataLoader statuses, explained.
Bug: b/153874006
Test: comment-only change
Change-Id: I6c85c1c6fc5c922e9d789b3ecd31a94c812dc3a1
2020-04-21 13:36:19 -07:00
Jeff Sharkey
d387e79ae1 Offer to write Strings through Parcels as UTF-8.
Recently while investigating some Binder limits, I discovered that
we're still sending Strings across Binder as UTF-16, which is very
wasteful for two reasons:

1. The majority of data flowing through APIs like PackageManager is
already limited to US-ASCII, and by sending UTF-16 we're wasting
half of our transactions on null-byte overhead.

2. Internally ART is already "compressing" simple strings by storing
them as US-ASCII instead of UTF-16, meaning every time we want to
write a simple string to Binder, we're forced to first inflate it
to UTF-16.

This change first updates Parcel.cpp to accept char* UTF-8 strings,
similar to how it accepts char16_t* for UTF-16.  It then offers
both UTF-8 and UTF-16 variants to Parcel.java via JNI.  We also
update the String8 handling to behave identical to String16.

This change adds benchmarking to show that these new methods are
about 50% faster for US-ASCII strings, and about 68% faster for
complex strings that reference higher Unicode planes.  (So an
improvement in both cases!)

Bug: 154436100
Test: atest FrameworksCoreTests:ParcelTest
Test: make core-libart conscrypt okhttp bouncycastle vogar caliper && vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/ParcelStringBenchmark.java
Change-Id: I22a11d3497486d922ec8e14c85df66ca096b8f2a
2020-04-21 09:38:36 -06:00
Jeongik Cha
9ccdd32880 Support multiple requiredSystemProperty in overlay
As-is: Only one requiredSystemProperty is allowed
To-be: It supports several requiredSystemProperty

Here is format for multiple fields.
  android:requiredSystemPropertyName="rw.num,rw.char"
  android:requiredSystemPropertyValue="1,a"

Test: m
Test: Make two overlay with different condition
      Check if it works properly depending on condition
      If there is no overlay package matching the condition, both aren't
      applied

Bug: 137628879
Merged-In: I4c8c4a1304dc52d6568767d90e3dcbf6acef024a
(cherry picked from commit 5e6a87013f)
Change-Id: If3765218c96f8922c155e18e99b0f4bb6a032ff1
2020-04-20 08:11:45 +00:00
TreeHugger Robot
dd08939ba8 Merge "RESTRICT AUTOMERGE: Autocork package invalidations" into rvc-dev 2020-04-17 23:26:42 +00:00
TreeHugger Robot
e185aca339 Merge changes If07d6938,I32f9b89a,Ife4f8c4e into rvc-dev
* changes:
  RESTRICT AUTOMERGE: Add a facility for time-based cache corking
  RESTRICT AUTOMERGE: Cork permission and package cache around bulk permission update
  RESTRICT AUTOMERGE: Cork package information cache invalidations during boot
2020-04-17 23:25:02 +00:00
Edgar Arriaga
c7f8e75806 Optimization: remove duplicated flags computations for getInstalledPackages
Below are some test runs that show 100 iterations of getInstalledPackages ran
at activity startup of touchlatency app to demonstrate the perf cost.

R Baseline:
https://screenshot.googleplex.com/PnVi5APraJo
https://pprof.corp.google.com/?id=dc105ca9592f8367c381e2dcf7f1847d

R Optimized:
https://pprof.corp.google.com/?id=2d1d9fadc20bcc61d41bd52116bd94e3
https://screenshot.googleplex.com/OAwJnvwPqPH

Savings: 8% of system_server binder response time when the call is executed.

In terms total binder transaction time. Savings are 2% of the total
binder call time.

Exempt-From-Owner-Approval: CP to correct branch for R

Bug: 153656459

Test: atest FrameworksServicesTests:PackageParserTest
Test: atest FrameworksServicesTests:PackageParserLegacyCoreTest
Test: atest FrameworksServicesTests:ScanTests
Test: atest FrameworksServicesTests:ParallelPackageParserTest

Merged-In: I2de9cf1f754a505239d4416e1fc70bf77932c5db
Change-Id: I2de9cf1f754a505239d4416e1fc70bf77932c5db
(cherry picked from commit 7cb9e5f671)
2020-04-17 18:38:29 +00:00
Daniel Colascione
d59e2a9045 RESTRICT AUTOMERGE: Autocork package invalidations
Bug: 140788621
Test: m; strace -s512 -f -p 1 2>&1 | grep 'cache_key'
Change-Id: Iceaabee5ea8eac42934c1cc4914cdf43d2f11f58
2020-04-17 00:19:21 +00:00
Daniel Colascione
f73a41c1cf RESTRICT AUTOMERGE: Cork package information cache invalidations during boot
Bug: 140788621
Bug: 150331002
Test: enable DEBUG; watch log
Change-Id: Ife4f8c4e7d10524d6000399947a4e4b9d36db750
2020-04-17 00:18:24 +00:00
Mehdi Alizadeh
d0a7a90b39 Adds unit tests for ShortcutChangeCallback APIs
Also fixes small bugs and TODOs here and there for tests to pass.

Bug: 153266100
Bug: 153107300
Bug: 148560657
Bug: 148615405
Test: atest com.android.server.pm.ShortcutManagerTest1
            com.android.server.pm.ShortcutManagerTest2
            com.android.server.pm.ShortcutManagerTest3
            com.android.server.pm.ShortcutManagerTest4
            com.android.server.pm.ShortcutManagerTest5
            com.android.server.pm.ShortcutManagerTest6
            com.android.server.pm.ShortcutManagerTest7
            com.android.server.pm.ShortcutManagerTest8
            com.android.server.pm.ShortcutManagerTest9
            com.android.server.pm.ShortcutManagerTest10
            com.android.server.pm.ShortcutManagerTest11
Change-Id: I702de148059296af0a5db70e1a11e4620588a00a
2020-04-16 13:22:10 -07:00
Oli Lan
3fb9cda5ca Merge "Add min extension versions to AndroidPackage." into rvc-dev am: 46a0a5abb5 am: a0660c0b0e am: 9ec5c28f94 am: f25eb01e4b
Change-Id: I729c7c2da77118c6e70824e581f1f35a586b42e8
2020-04-16 09:35:52 +00:00
Oli Lan
46a0a5abb5 Merge "Add min extension versions to AndroidPackage." into rvc-dev 2020-04-16 08:21:33 +00:00
TreeHugger Robot
701cdb6c73 Merge "bypass anti-malware verification" into rvc-dev am: a93686c403 am: ba4ec979c5 am: e3666d6eff am: be4b8542bd
Change-Id: I3a85f17ee3da0ed11b053d012a8cdd54629f6df0
2020-04-16 00:32:12 +00:00
TreeHugger Robot
a93686c403 Merge "bypass anti-malware verification" into rvc-dev 2020-04-15 20:13:43 +00:00