Commit Graph

9593 Commits

Author SHA1 Message Date
Bernardo Rufino
9e26212dac Avoid full unparcelling where possible in Bundle
and put a warning where it's not possible. This is to make sure we know
when to touch bundles provided by apps.

In this CL:
* deepCopy() now doesn't deserialize lazy objects before copying. It
  doesn't copy them either, it merely passes them into the new map as
  the same reference. This works because we implemented fine-grained
  locking into each lazy value, so concurrent access won't be a problem.
  Furthermore, LazyValue caches the deserialized object, so we'd still
  honor the contract of deepCopy() that "Other types of objects (such
  as Parcelable or Serializable) are referenced as-is and not copied in
  any way". I had to perform one extra check in the synchronized block
  in LazyValue to guarantee this (double-checked locking), I explain
  that in the comments.
* Removed filterValues() and codepaths that used it. This was created
  with the purpose of removing items whose classes weren't available to
  the system to prevent crashes coming from full deserialization. This
  is not a concern anymore with lazy bundle, hence we can remove the
  codepaths altogether (see email for more details).
* Put warnings in javadoc of getMap() and PeristableBundle().

Test: Boots
Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
Bug: 195622897
Change-Id: I14bb6a7874814f42cbcc6b5fd372c42752aa74c8
2021-10-05 13:39:36 +01:00
Bill Yi
505f138725 Merge RQ3A.210905.001 to aosp-master - DO NOT MERGE
Merged-In: If0c6aebc7ecb401d0f68a00a746f7ae337e4bb86
Merged-In: Ic4c9fc8a62966b7b171d4ff2185e3d3232dea2e0
Merged-In: Ic4c9fc8a62966b7b171d4ff2185e3d3232dea2e0
Change-Id: Ife6d981ebcc9d55b8b7f0089ef9af09a51ae87c5
2021-09-08 18:01:22 -07:00
Jooyung Han
8ed699e610 OverlayManager: use typed collection type in AIDL
Use Map<K,V> and List<V>.

Bug: 192615532
Test: m
Change-Id: I5ad7f67b4b08b646362a58214c3b62cd1ada28c0
2021-08-19 15:56:48 +09:00
Makoto Onuki
ea8407635c Update OWNERS for Intent* and Content*
Test: Build
Change-Id: I2232342d3e68cc8e1eea14bfa999f32b15ba5789
2021-08-17 14:27:35 -07:00
Winson
49cb41f9d7 Remove ParsedIntentInfo CREATOR
Its existence allows implicit readParcelable calls to invoke a Parcel
operation with mismatched read/write data sizes, allowing someone to
swap out the data on a reparcel.

Internal classes will use writeIntentInfoToParcel, so this is safe to
remove.

Bug: 191055353

Test: atest com.android.server.pm.test.parsing.parcelling

Change-Id: I44faa635faf8a77894a3dda8adf89c10064e53f1
(cherry picked from commit 75214cc510)
2021-06-30 23:58:42 +00:00
Treehugger Robot
e2ddd9d277 Merge "Do not canonicalize overlay config test paths" 2021-06-04 17:04:49 +00:00
Ryan Mitchell
2c9685573f Do not canonicalize overlay config test paths
Some devices may not have certain partitions available and the
OverlayConfigTests use hardcoded paths to test OverlayConfig
functionality. This change ensures that the temporary directory
created to test OverlayConfig has all of the partitions defined in
PackagePartitions#SYSTEM_PARTITIONS within it.

Bug: 187020117
Bug: 187020675
Test: atest OverlayConfigTest
Change-Id: I511e24b7ccfe82e6e89ceea7107457439793ef77
2021-06-02 21:12:18 +00:00
Calin Juravle
95590e1a62 Merge "Update the use of registerAppInfo" 2021-05-20 21:46:00 +00:00
liulvping
2cd9d26116 Reset target sdk version of ParseTypeImpl
In device booting, PackageParser2 uses a thread
local ParseTypeImpl obj as shared result and reset
it before parsing everty time. But it doesn't reset
the target sdk version, which could make deferError
returned unexpected error, cause apk scaned failed
and deleted by the system.

Test: atest com.android.server.pm.parsing

Change-Id: Ie6fbc4b79e94943c9282206b1ef6d20b4129fa0b
Signed-off-by: liulvping <liulvping@xiaomi.com>
2021-05-18 17:10:54 +08:00
Calin Juravle
3e308c6270 Update the use of registerAppInfo
Pass additional parameters to ART to assist with better profiling
and debuggability.

Test: m
Bug: 182793486
Bug: 185979271

Change-Id: Iae0beab92194d75f191147578922c760f04470b9
2021-05-13 07:59:39 -07:00
satayev
a8e4e5dcc3 Expose SharedLibraryInfo#getAllCodePaths as @TestApi.
The method is called by CTS helper app to list all java shared libraries
present on the device. All classes present in the reported jar/apk files
are then collected by a CTS/GTS EDI collector.

Bug: 187823488
Test: m
Change-Id: I750065112d70bc3ab45c8b6c6cc8aa4d429488a8
2021-05-11 17:26:47 +01:00
Winson Chiu
7edfb41f13 PackageParser OWNERS noparent
Remove other OWNERS from PackageParser.java to disallow future changes.
No new code should go into PackageParser.java except in extreme outlier
circumstances.

Change-Id: I2f663d2ae527beccbd47402492aa51d0cc6f6c13
2021-04-27 16:14:50 +00:00
Varun Shah
81f00f0198 Merge "Update OWNERS for Content* framework." 2021-04-22 23:59:17 +00:00
Aurimas Liutikas
6dd6c5a603 Merge "Cleanup nativeHeapZeroInit and memtagMode implementation." 2021-04-19 16:52:58 +00:00
paulhu
b4e9b2b3d8 Move ACTION_CLEAR_DNS_CACHE to ConnectivityManager
- As API review feedback, move ACTION_CLEAR_DNS_CACHE form Intent
  to ConnectivityManager.

- Rename to "android.net.action.CLEAR_DNS_CACHE" because of lint
  suggestion.
frameworks/base/packages/Connectivity/framework/src/android/net/
ConnectivityManager.java:449: error: Inconsistent action value;
expected `android.net.action.CLEAR_DNS_CACHE`, was
`android.intent.action.CLEAR_DNS_CACHE` [ActionValue]

Bug: 183937999
Test: atest FrameworksNetTests
Test: atest ActivityTaskManagerServiceTests
Test: atest android.permission2.cts.PermissionPolicyTest
Test: atest CtsNetTestCases
Change-Id: Iae8aa0ba10dfc7581f0cfaab82643edbee789e2f
2021-04-07 19:40:47 +08:00
Jeff Chang
a40fbcd94c Merge "Add more OWNERS coverage" 2021-04-07 05:57:30 +00:00
Varun Shah
f897219ad2 Update OWNERS for Content* framework.
Change-Id: I9eeda350ea0d2766e16f69854dfcbb9009e13ef5
Fixes: 184080497
Test: n/a
2021-04-06 19:19:38 +00:00
Aaron Huang
46d99ea11f Expose Context#PAC_PROXY_SERVICE as module lib API
(cherry-picked from ag/14097767)
Bug: 183938000
Test: make update-api
Merged-In: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
Change-Id: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
2021-04-06 17:06:03 +08:00
Jeff Chang
663709f12f Add more OWNERS coverage
Bug: 123083574
Test: build
Change-Id: I912ad002d40f19944946ac650add8547ad7bc248
2021-03-31 14:49:32 +08:00
Evgenii Stepanov
487d3f6e2f Cleanup nativeHeapZeroInit and memtagMode implementation.
* Rename nativeHeapZeroInit to nativeHeapZeroInitialized.
* nativeHeapZeroInitialized is a tri-state, so make it an @IntDef.
* Add documentation to some accessor methods, and missing @type
  annotations.
* Add attrs_manifest.xml document for the new attributes.

Bug: 182165383
Bug: 182370211
Test: com.android.cts.tagging
Change-Id: Iad46a1da9bc040baf4c438afbc5fd8cd128e99f1
Merged-In: Iad46a1da9bc040baf4c438afbc5fd8cd128e99f1
2021-03-30 20:47:56 -07:00
paulhu
63691d5ec8 Add documents for isOem/Vendor/Product
Bug: 182793544
Bug: 182285645
Test: m
Change-Id: I3b0353c38f74143e40540617fbaf2e247f152918
2021-03-30 11:36:50 +08:00
David Zeuthen
d9cbeba041 PackageManager: Add FEATURE_HARDWARE_KEYSTORE, modify FEATURE_STRONGBOX_KEYSTORE.
These feature flags will hold the KeyMint version for the default and
StrongBox HALs. They can be used by apps to convey that they'll only
work on devices which have a recent enough version of KeyMint.

For example, if an application requires ECDH to be implemented in
Secure Hardware it can convey this requirement by indicated that it
needs FEATURE_HARDWARE_KEYSTORE >= 100. Or if it needs this in the
StrongBox it can use FEATURE_STRONGBOX_KEYSTORE >= 100. As with other
feature flags, this can be used to only show the app on devices which
satisfy such requirements.

Test: Compiles
Bug: 160616951
Change-Id: I582e50fba92de0d598d7e86fcc3b1b2b4a91b103
2021-03-25 09:38:42 -04:00
Charles Chen
4eca6d0c5c Merge "Add OWNERS for ComponentCallbacksController" 2021-03-24 10:05:52 +00:00
Remi NGUYEN VAN
7e26e33269 Merge "Add TEST_NETWORK_SERVICE to module API" 2021-03-19 02:32:00 +00:00
Remi NGUYEN VAN
2bf4c58ceb Add TEST_NETWORK_SERVICE to module API
TestNetworkManager is being unbundled; the TEST_NETWORK_SERVICE constant
is necessary for the module to register the manager with
registerContextAwareService.

Bug: 171540887
Test: m
Change-Id: I0690251ddfcdaa8a34830e110b75869a370de389
Merged-In: I0690251ddfcdaa8a34830e110b75869a370de389
2021-03-19 00:04:24 +00:00
Peter Collingbourne
7fe1ca63df Merge "Add support for a hw_timeout_multiplier system property." 2021-03-17 18:18:51 +00:00
Charles Chen
661351a645 Add OWNERS for ComponentCallbacksController
Bug: 181134729
Test: pre-upload check
Change-Id: I183c66c346b39ae6f731d197a0db31d00062ac7b
2021-03-17 22:27:20 +08:00
Aaron Huang
16f50075b1 Merge changes from topic "pacproxy-service"
* changes:
  Make PacProxyService be a system service
  Revert^2 "Refactor setCurrentProxyScriptUrl to a void method"
2021-03-15 11:49:45 +00:00
Aaron Huang
5d31a15d84 Make PacProxyService be a system service
PacProxyInstaller class is running a thread all the time and is
listening to intent ACTION_PAC_REFRESH so it would be better to
make it be a system service with a manager class PacProxyManager
which is obtained with getSystemService(PacProxyManager.class).
Besides, rename PacProxyInstaller to PacProxyService will
be easier to know it's the service for PacProxyManager.

ConnectivityService is going to be a mainline module and it
needs constructor of PacProxyService to be SystemApi.
However, in current design, it needs to pass a handler and
an int arguments to the constructor which would be difficult
to maintain if just expose the constructor directly.

So, define a listener for the event that the current PAC
proxy has been installed so that the handler and the int
arguments can be removed from the constructor.

Bug: 177035719
Test: FrameworksNetTests
Change-Id: I2abff75ec59a17628ef006aad348c53fadbed076
2021-03-15 14:40:58 +08:00
paulhu
97c860113a Expose Intent#ACTION_CLEAR_DNS_CACHE
DnsManager will broadcast ACTION_CLEAR_DNS_CACHE intent to clear
dns cache when network have changed. But DnsManager is in the
Connectivity mainline module which can not use non-formal API.
Thus, expose Intent#ACTION_CLEAR_DNS_CACHE as module lib API for
mainline module.

Bug: 182370679
Test: m update-api
Merged-In: I30b1b146dcae82926be7bdb8b343635a01eabefe

Change-Id: I30b1b146dcae82926be7bdb8b343635a01eabefe
2021-03-12 05:21:08 +00:00
Peter Collingbourne
6353c57d57 Add support for a hw_timeout_multiplier system property.
In order to test the platform in emulators that are orders of magnitude
slower than real hardware we need to be able to avoid hitting timeouts
that prevent it from coming up properly. For this purpose introduce
a system property, ro.hw_timeout_multiplier, which may be set to
an integer value that acts as a multiplier for various timeouts on
the system.

Bug: 178231152
Change-Id: I6d7710beed0c4c5b1720e74e7abe3a586778c678
Merged-In: I6d7710beed0c4c5b1720e74e7abe3a586778c678
2021-03-11 14:04:18 -08:00
Treehugger Robot
1b2163d9e8 Merge "Update OWNER for team's files under content" 2021-03-05 18:07:37 +00:00
Joanne Chung
f01f6bc59f Update OWNER for team's files under content
Update for AutofillOptions, ContentCaptureOptions, LocusId.

Bug: 177641730
Test: n/a
Change-Id: I88ed9b0e79255c42d57968882750733e414b7767
2021-03-05 12:56:53 +08:00
Xin Li
1af6a12e98 Merge "Merge RQ2A.210305.007" 2021-03-03 21:41:39 +00:00
Patrick Baumann
8ee2b99d71 Merge "Parcel queriesProviders in ParsingPackageImpl" 2021-03-03 18:19:56 +00:00
Evan Severson
d35d84c8fc Merge "Update permissions OWNERS files" am: 391145ab85
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1611821

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I99f1eefce42cc8717be7c9834b685e53dec813ce
2021-03-02 21:40:58 +00:00
Evan Severson
391145ab85 Merge "Update permissions OWNERS files" 2021-03-02 19:46:59 +00:00
Evan Severson
13fd14252b Update permissions OWNERS files
Test: None
Change-Id: I039bf12c65b0cd509a6772d89b96821b98ff318c
2021-03-02 10:37:41 -08:00
Evgenii Stepanov
ac811c4025 Merge "Implement memtagMode and nativeHeapZeroInit manifest attrs." am: d600f5067a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1556655

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9c84f162736af927f6cac041f4200dc3ab2b8efa
2021-02-26 20:50:30 +00:00
Evgenii Stepanov
d600f5067a Merge "Implement memtagMode and nativeHeapZeroInit manifest attrs." 2021-02-26 20:11:10 +00:00
Winson Chiu
b87d41ab87 Merge "Add OWNERS for pm.verify.domain" am: 1736ad8bfe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1606753

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2cc5663bb712bcf4f8a2fd8c6a335bc5a4a50946
2021-02-26 18:36:42 +00:00
Evgenii Stepanov
15cce113f7 Implement memtagMode and nativeHeapZeroInit manifest attrs.
memtagMode allows an app to opt in to MTE in either sync or async mode.

nativeHeapZeroInit enables automatic initialization of heap memory.

Both attributes default to off and can be specified at either
application or process level.

Bug: 135772972
Bug: 177438394
Bug: 178038272
Test: CtsTaggingHostTestCases

Change-Id: I6a481a9d2363997bf954f248d08224c79f0c2afb
Merged-In: I6a481a9d2363997bf954f248d08224c79f0c2afb
2021-02-25 23:38:33 +00:00
Winson Chiu
49a02e54f5 Add OWNERS for pm.verify.domain
Change-Id: I8585463eeff6298f39498f5cf1117bb923634450
2021-02-24 20:47:46 +00:00
Roshan Pius
1d024a0e6a Merge "Add getTargetSdkVersion without AppInfo" am: f8ab9c895b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1599639

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iab7f841edba1f96b5b8248bdee88d9165f4d644e
2021-02-24 01:30:53 +00:00
Winson
3eb5bd0a11 Add getTargetSdkVersion without AppInfo
For quickly checking an app's targetSdkVersion without building and
returning an entire ApplicationInfo object.

Bug: 164459559

Test: atest android.content.pm.cts.PackageManagerTest#testGetInfo

Merged-In: Ibe1a3e977cd71b23e26395eb6cc73f61c1a85a0e
Change-Id: Ibe1a3e977cd71b23e26395eb6cc73f61c1a85a0e
2021-02-23 09:25:58 -08: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
Treehugger Robot
3ad85e407e Merge "pm: Require manifest.json for .dm (dex-metadata) files." 2021-02-17 20:36:43 +00:00
Igor Murashkin
abe2776ddf pm: Require manifest.json for .dm (dex-metadata) files.
Example file:
  $> unzip CtsApkVerityTestAppPrebuilt.dm manifest.json ; cat manifest.json
  {
    "packageName": "android.appsecurity.cts.apkveritytestapp",
    "versionCode": 30
  }
  
Cherry-picked from 12af11d6f5

Test: adb install-multiple -r foo.apk foo.dm
Test: atest FrameworksServicesTests:com.android.server.pm.dex.DexMetadataHelperTest
Bug: 179295368
Merged-In: I7a3c442bb27da5948bc9ead146c77213de6b56cc
Change-Id: I7a3c442bb27da5948bc9ead146c77213de6b56cc
2021-02-17 20:34:17 +00:00
Shawn Willden
50a66e39cd Merge "Add support for app-generated attestation keys." 2021-02-17 19:12:20 +00:00
Shawn Willden
bffded442a Add support for app-generated attestation keys.
This allows apps to request that AndroidKeyStore generate attestation
keys that can be used to sign attestations of other keys that the app
generates or imports.

Bug: 163606833
Test: atest CtsKeystoreTests
Change-Id: I943a6922271cbe909cb3a9d67021663b5646aa70
2021-02-17 06:46:13 -07:00