Commit Graph

9809 Commits

Author SHA1 Message Date
Hani Kazmi
34b061c00a Merge "BaseBundle.java: Recycle underlying parcel when bundle is cleared." 2022-06-15 09:51:53 +00:00
Jooyung Han
a4d51305f7 Merge "Unhide Parcel.writeTypedList() with additional flag" 2022-06-15 01:02:07 +00:00
Hani Kazmi
1b74a666d3 BaseBundle.java: Recycle underlying parcel when bundle is cleared.
Lazy Bundles, (aosp/1787847), introduced a change in behavior where a Parcel
created as part of initializing a Bundle is dependent on the next ART GC run to be
recycled, causing a short term memory-leak.

To land this in T, we are making the change targetted and allowing
consumers to opt into the parcel being immediately cleared by calling
.clear() on the bundle.

As part of the unparcel() in clear(), mParcelledData is set to null, and
mMap may or may not still contain references through lazy values,
depending on if the lazy valyes have been unmarshalled.  As
such, we keep a weak reference to mParcelledData we can use to recycle it.

The mParcelledData reference could have been copied to other bundles in
a few operations:
new Bundle(Bundle o)
bundle.deepCopy()
bundle.putAll()

In this case we can not recycle the parcel yet as other bundles may
still require it. If so, we will skip the recycle and rely on the later GC pass

Bug: 233216232
Test: Reproduced linked bug on-device
Test: atest android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
Change-Id: Ic26eceaa1c11da67866af0963f760423d41d54bc
Merged-In: Ic26eceaa1c11da67866af0963f760423d41d54bc
2022-06-14 12:20:33 +00:00
Steven Moreland
d36a3f33e2 Merge "Parcel: warnings for 'REPLY' statuses" 2022-06-10 17:40:52 +00:00
Max Bires
5592977b0f Merge "Fix comment in docs about ID attestation." 2022-06-09 23:42:03 +00:00
Eric Biggers
d96c8701dd Merge "Remove obsolete support for emulated FBE" 2022-06-09 18:42:00 +00:00
Steven Moreland
06e4550187 Parcel: warnings for 'REPLY' statuses
Comment a warning for this hack to add data into statuses. I've also
heard from jsharkey@ in the past a need for a generic solution here.
At a minimum, this prevents new bugs/bad interactions with native
code.

Bug: 235006086
Test: N/A
Change-Id: I3bcb2b8638803cde0f6ef257b65bb9456843abf7
2022-06-06 21:40:49 +00:00
Max Bires
7e477d6320 Fix comment in docs about ID attestation.
ID attestation will not work if the device identifiers are altered in
the system image. This is because KeyMint checks the device identifiers
that are provided in a generateKey call against the device identifiers
that were provisioned in the factory. If there is a mismatch, the key
request is rejected. The documentation on getSerial() has been fixed to
clarify this.

Test: The new documentation is semantically digestible by a SWE
Change-Id: Ie300cd167bb82b44e38fb3e091b90abe02a7c197
2022-06-03 03:47:00 -07:00
Eric Biggers
a0da4eb791 Remove obsolete support for emulated FBE
Emulated FBE was a developer-mode feature intended to allow developers
to add Direct Boot support to apps before native FBE devices became
widely available.  Since all devices running the latest version of
Android now use native FBE (except for a couple edge cases not relevant
here, like in-development devices on which encryption hasn't been
enabled yet), and emulated FBE doesn't work on native FBE devices
anyway, there's no longer any need to carry the code for emulated FBE.

Bug: 232458753
Change-Id: I2ab35472c872b19b2bf64aa99424b5ccd9f6170f
2022-06-02 00:53:48 +00:00
Jooyung Han
8cff29b8ea Unhide Parcel.writeTypedList() with additional flag
The flag should be propagated to Parcelable.writeToParcel(). But since
it was hidden, we were not able to pass the flag to elements of the
list.

Bug: 215654054
Test: atest android.os.cts.ParcelTest
Change-Id: I72d419caa74c62d979c5102ebd8eba4338ec3e3b
2022-05-27 18:33:52 +09:00
Dipankar Bhardwaj
2b932750af Add dipankarb to storage owners
Change-Id: I486ad459e945340865adcc030286c443afa7007b
Test: n/a
Bug: 233893599
2022-05-25 16:20:53 +00:00
Treehugger Robot
fbc5263e1a Merge "Updating nativeAsyncTraceForTrackEnd to not require a name argument" 2022-05-24 19:27:55 +00:00
Ray Ye
8dae06607c Updating nativeAsyncTraceForTrackEnd to not require a name argument
Bug: 230399626
Test: atest TraceDevTest
Change-Id: Ic8f8a304f8fbb9c1bc6fbbac0e0bf5de97ce70aa
2022-05-16 21:27:11 +00:00
Christopher Tate
5c5f45325c Make binderDied(IBinder who) public API
Expose the binderDied() variant that supplies the IBinder that has
become invalid.

Bug: 207163286
CTS-Coverage-Bug: 214327236
Test: atest BinderDeathDispatcherTest
Change-Id: I7193e29287dcc5c2a6447514c84840eca8adf61f
2022-05-03 17:23:23 -07:00
Colin Cross
b0b0bb9882 Add UpsideDownCake to aapt2 codenames and android.os.Build
Bug: 219519679
Test: m checkbuild
Change-Id: I2b668d1cd875657b27a1d52bda21f238d7020862
Merged-In: I2b668d1cd875657b27a1d52bda21f238d7020862
(cherry picked from commit d27566da4c)
2022-04-22 09:17:01 -07:00
satayev
337762d9c6 Fix KNOWN_CODENAMES javadoc to mention that all codenames are there.
Bug: 220153433
Test: atest BuildTest
Change-Id: I93cade7cb11e34557445b74d1e1841508061d616
Merged-In: I93cade7cb11e34557445b74d1e1841508061d616
(cherry picked from commit 82d33f26f9)
2022-04-22 09:17:01 -07:00
Eric Biggers
bd13f84152 Remove more FDE methods from StorageManager
Now that these methods are no longer called, and none of them are a
public API or have @UnsupportedAppUsage, they can be removed.

inCryptKeeperBounce() actually had one known app user via reflection,
despite the method not having @UnsupportedAppUsage.  However, that user
only made the call if Build.VERSION.SDK_INT < VERSION_CODES.P, so it is
not being used anymore.

Bug: 208476087
Change-Id: Idc218e5f355bb61257b07cf5b5b6df5f4c6ece11
2022-04-07 16:38:36 +00:00
Ling Ma
18b4802337 Merge "setProperty check for byte limit" 2022-04-01 21:43:23 +00:00
Yi-Yo Chiang
c88a3d9be4 DSU service: Log insufficient storage space error
Log a specialized error message if installation task
failed due to insufficient storage space.
This helps the user to disgnose the source of error.

Bug: 200002443
Test: start DSU task and check logcat
Change-Id: Iabb3e0325ae99c343978ca6c35ab8378f20e0527
2022-03-31 18:38:00 +08:00
Treehugger Robot
004bb42f93 Merge "Added Java bindings to async trace functions with track argument" 2022-03-30 18:16:29 +00:00
Tim Murray
45f3622eb3 Merge "Update OWNERS for tracing, including the Java APIs." 2022-03-30 18:15:38 +00:00
Tim Murray
1c968c099f Update OWNERS for tracing, including the Java APIs.
Change-Id: I7b4f972f09695c68110ed09e3a75e35e40a61387
2022-03-30 11:10:21 -07:00
Ray Ye
420bd3c28a Added Java bindings to async trace functions with track argument
Bug: 22119585
Test: atest TraceDevTest
Change-Id: I0432763837670de97e6771a1d0fda33f8df14f39
2022-03-29 19:30:27 +00:00
Jooyung Han
906819c815 Fix Parcel.writeFixedArray javadoc
Reference to createFixedArray shoudl be escaped. Otherwise resulting
html renders as <s>(strikethrough) tag.

Bug: 227007069
Test: m online-sdk-docs
  and see if ./reference/android/os/Parcel.html works ok
Change-Id: I7a3b447cbeddd8d66ca1733dc8d115c61ece2509
2022-03-26 20:00:29 +09:00
Ling Ma
8c959cde94 setProperty check for byte limit
Test: manual
Bug: 210502588
Change-Id: I75a1e5bbd79814429dfac5b0b6449efd72176c2c
2022-03-25 10:41:59 -07:00
Jerome Gaillard
329f25d91a Merge "Read-only properties can have values of arbitrary length" 2022-03-23 10:21:15 +00:00
Jerome Gaillard
069f22cf0c Read-only properties can have values of arbitrary length
Read-only properties are defined by having a key starting with "ro.".

Bug: 226123443
Change-Id: Ic91e0b7d57e614b620e5147f96356ffd7154daa2
2022-03-22 15:16:45 +00:00
Eric Biggers
8f359f022a Stop using FDE-related constants from IVold
IVold.ENCRYPTION_STATE_* and IVold.PASSWORD_TYPE_* are values returned
by or accepted by FDE-specific vold methods, which are no longer used.
Stop using these constants so that we can remove them from IVold.aidl.

Notes on specific constants:

- Some constants have @UnsupportedAppUsage.  There is no reason why a
  non-system app should have been using these.  However, to avoid
  possibly breaking apps I just left these with hardcoded values.

- StorageManager.CRYPT_TYPE_* are used by
  LockscreenCredential.getStorageCryptType().  However, the caller of
  this method was removed by an earlier CL, so just remove this method.

- StorageManager.CRYPT_TYPE_* also have a user in
  packages/apps/Settings, but it is obsolete code that I'm removing in
  another CL.

Bug: 208476087
Change-Id: I41c684b69a97dbafac65d8f55db2c284d7a8dd70
2022-03-21 05:11:28 +00:00
Eric Biggers
bf9e19c56c Remove support for converting from FDE to FBE
Devices that launched with Android 10 or later require FBE (File Based
Encryption) from the beginning, so there's no need to support converting
to FBE after the fact anymore.  This was only ever a developer option,
so it probably wasn't used much.  And in any case, it's not used
anymore, as isConvertibleToFBE() is hard-coded to return false.  Besides
the fact that FBE has been required for several releases now, this
functionality was only ever available on devices that use FDE (Full Disk
Encryption), but FDE support has been removed from Android.

Therefore, remove this unused code.

Bug: 208476087
Change-Id: I1f56c8e05fb3fba09aab4bf5f8609b0f552b8999
2022-03-16 23:17:11 +00:00
Eric Biggers
6a8f891205 Merge changes from topic "remove-auth-token"
* changes:
  Remove HardwareAuthToken parameter from unlockUserKey
  Remove HardwareAuthToken parameter from clearUserKeyAuth
  Remove HardwareAuthToken parameter from addUserKeyAuth
  Don't pass HardwareAuthToken to unlockUser() in non-SP verifyCredential
  Remove non-SP based setLockCredentialInternal()
  Remove HardwareAuthToken support from FakeStorageManager
2022-03-15 21:33:26 +00:00
Eric Biggers
841350e6ac Merge changes from topic "remove-fde"
* changes:
  Remove unused FDE methods from StorageManager
  Stop checking FDE password cache
  Remove checks for FDE in 'adb backup'
2022-03-15 17:23:08 +00:00
Steven Moreland
180aa227f6 Merge "ParcelableHolder: assert stability on read" 2022-03-15 17:00:57 +00:00
Eric Biggers
95792478f1 Remove HardwareAuthToken parameter from unlockUserKey
Due to the migration to synthetic passwords, the 'token' parameter to
unlockUserKey() is no longer needed.  Remove it.

Note: I didn't change unlockUser() in IActivityManager because it is
marked with UnsupportedAppUsage, so it might not be safe to change the
method signature.  It now just ignores the 'token' parameter rather than
passing it down the stack.

Test: atest com.android.server.locksettings
Bug: 184723544
Change-Id: I35ce09412f47f2f2a17a371d518a0a518b70bfb6
(cherry picked from commit b1bcec9c7d)
Merged-In: I35ce09412f47f2f2a17a371d518a0a518b70bfb6
2022-03-15 01:26:01 +00:00
Eric Biggers
d04de5ce97 Remove HardwareAuthToken parameter from clearUserKeyAuth
Due to the migration to synthetic passwords, the 'token' parameter to
clearUserKeyAuth() is no longer needed.  Remove it.

Test: atest com.android.server.locksettings
Bug: 184723544
Change-Id: I739b519b0e91293acbf018020891d68b3090c175
(cherry picked from commit 2a8ab47782)
Merged-In: I739b519b0e91293acbf018020891d68b3090c175
2022-03-15 01:25:57 +00:00
Eric Biggers
5eb0659999 Remove HardwareAuthToken parameter from addUserKeyAuth
Due to the migration to synthetic passwords, the 'token' parameter to
addUserKeyAuth() is no longer needed.  Remove it.

Test: atest com.android.server.locksettings
Bug: 184723544
Change-Id: I06e7c36787cc7f384acb7742737c3b1cfa50f0ae
(cherry picked from commit 6b220a95e9)
Merged-In: I06e7c36787cc7f384acb7742737c3b1cfa50f0ae
2022-03-15 01:25:51 +00:00
Eric Biggers
0bc49e6fc3 Remove unused FDE methods from StorageManager
Now that FDE is no longer supported, remove the FDE-related methods from
StorageManager that are no longer called.

Bug: 208476087
Change-Id: Ic24a5b029bdf51dec622d1b70cef9ef26c3d54c5
(cherry picked from commit 41fa601601)
Merged-In: Ic24a5b029bdf51dec622d1b70cef9ef26c3d54c5
2022-03-14 23:04:00 +00:00
Bernardo Rufino
05f2831e1c Merge "Document when types are checked in Bundle" 2022-03-14 08:53:45 +00:00
Steven Moreland
f1010eb8ad ParcelableHolder: assert stability on read
The interface a ParcelableHolder is in determines its stability,
and it shouldn't change based on what is sent.

Bug: 215458170
Test: aidl_integration_test
Change-Id: I40239e14e59b3998ac19d140453eb29a298cdb76
2022-03-10 23:54:23 +00:00
Martijn Coenen
5a8d1b20b4 Add a new UID range for SDK sandbox processes.
These are processes that are spawned alongside regular app processes.
They have their own UID range, such that they can be properly isolated
from applications.

Add some APIs in Process that allows the system and mainline
modules to verify that a particular UID belongs to a sandbox
process, and to map between the sandbox process and the
corresponding app process.

Bug: 215012578
Test: N/A
Change-Id: I02aaaa1c2bcf9d141ddc97747eb6d7edd52d7b92
Merged-In: I02aaaa1c2bcf9d141ddc97747eb6d7edd52d7b92
2022-03-10 10:35:16 +01:00
Eric Biggers
b56960bc76 Merge changes Ib5bcfb6a,I46c2a472,If0c75774,Iab7ba8d3
* changes:
  Stub out some FDE methods in StorageManager
  Stop trying to update FDE password from LockSettingsService
  Remove clearEncryptionPassword() from LockPatternUtils
  Stop trying to get/set fields in FDE footer
2022-03-10 00:48:53 +00:00
Treehugger Robot
2794ff0ca8 Merge "IBinder.transact: clarify return" 2022-03-09 17:51:26 +00:00
Bernardo Rufino
f430745a51 Document when types are checked in Bundle
Test: Builds
Bug: 222087511
Change-Id: Ib844aa626529a4b9696447b22e7848488a0afe87
2022-03-09 14:22:57 +00:00
Eric Biggers
25bf2f8ae0 Stub out some FDE methods in StorageManager
Now that FDE is no longer supported, stub out some methods in
StorageManager that return FDE state.  This allows
StorageManager.getPasswordType() to be removed, and it prepares for
removing these methods later.

Bug: 208476087
Change-Id: Ib5bcfb6a0279150fec33f2c3edd0431b450c90f4
(cherry picked from commit 401bf8a176)
Merged-In: Ib5bcfb6a0279150fec33f2c3edd0431b450c90f4
2022-03-09 05:11:10 +00:00
Eric Biggers
56c37e5778 Merge "Remove broken code for mounting encrypted OBB files" am: a4f24f08b0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2003052

Change-Id: Id027c555af21e46922a1c0ce29195d95bb7bb876
2022-03-04 21:27:43 +00:00
Eric Biggers
8bc9340b4c Remove broken code for mounting encrypted OBB files
Mounting encrypted OBB files has never worked reliably across devices,
partly due to its reliance on Twofish encryption support in the kernel.
This is because Twofish support (CONFIG_CRYPTO_TWOFISH) has never been
required or even recommended for Android.  It has never been enabled in
GKI, but even before GKI it wasn't required or recommended.  Moreover,
this is now the only Android feature that still uses dm-crypt
(CONFIG_DM_CRYPT), and some devices don't have that enabled either.

Therefore, it appears that this feature is unused.  That's perhaps not
surprising, considering that the documentation for OBBs
(https://developer.android.com/google/play/expansion-files) says that
they are deprecated, and also it explains OBBs as being app files that
are opaque to the platform; the ability of the platform to mount OBBs
that happen to be in a particular format is never mentioned.  That means
that OBB mounting is probably rarely used even with unencrypted OBBs.
Finally, the usefulness of OBBs having their own encryption layer (in
addition to what the platform already provides via FBE) is not clear
either, especially with such an unusual choice of cipher.

To avoid the confusion that is being caused by having the broken code
for mounting encrypted OBBs still sitting around, let's remove it.

Test: atest StorageManagerTest # on Cuttlefish
Test: atest StorageManagerIntegrationTest # on Cuttlefish
Bug: 216475849
Change-Id: I6e6a6462ab8343299dc5e0145b87dc28b16b0bc1
2022-03-04 04:51:54 +00:00
Sandro Montanari
079b5b2e27 Merge "Add /metadata info on dumpsys diskstats and StatsPullAtomService" am: 31f779f949
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1993550

Change-Id: Iebb35e4099506f05f73c59dd689e84e75ae8756d
2022-03-02 18:47:03 +00:00
Sandro Montanari
31f779f949 Merge "Add /metadata info on dumpsys diskstats and StatsPullAtomService" 2022-03-02 18:22:28 +00:00
Bernardo Rufino
7f6ac3e820 Merge "Adjust Class<T> parameter bounds in new Bundle APIs" am: 15b7548d05
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2004350

Change-Id: I7beed95d36ba4a83c4e6460dc34d92bdd0873fc8
2022-03-02 17:32:29 +00:00
Bernardo Rufino
15b7548d05 Merge "Adjust Class<T> parameter bounds in new Bundle APIs" 2022-03-02 17:00:31 +00:00
sandrom
f76f5842a4 Add /metadata info on dumpsys diskstats and StatsPullAtomService
Bug: 208676063
Test: manual tests
Change-Id: Ice3b706222aa1f77beadb1b9f4ae93f0d796a0b0
2022-03-02 08:08:23 +00:00