Commit Graph

10594 Commits

Author SHA1 Message Date
Steven Moreland
6c700dd35a Merge "Binder: clearCallingIdentity is kernel binder" am: bc67752894 am: eddf8c7625 am: 4b295a3e22 am: e43b9a5748
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2147360

Change-Id: I32d921041e0109f90e5b0627a11e8c1bd9c812b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 01:20:32 +00:00
Steven Moreland
4b295a3e22 Merge "Binder: clearCallingIdentity is kernel binder" am: bc67752894 am: eddf8c7625
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2147360

Change-Id: I331269726340c8d83d4486123743bdace740ddd3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 00:46:43 +00:00
Steven Moreland
eddf8c7625 Merge "Binder: clearCallingIdentity is kernel binder" am: bc67752894
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2147360

Change-Id: Ic6643d23d94fe5673243c46663a3ac7a42235734
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-07 00:26:42 +00:00
Steven Moreland
5d7100a43b Binder: clearCallingIdentity is kernel binder
This method clears the calling identity of a kernel
binder call. However, there is now a generic API to
disallow the use of kernel binder calling identities.
This is used by RPC binder calls in order to ensure
that code doesn't accidentally assume the default
(<pid>, <uid>) calling identity means that the call
originated from another process.

In the C++ layer, this API is attached to
IPCThreadState. In the future, we could consider
expanding the scope of this API to code and restore
many types of calling IDs, but the current return
type may not have enough space, and I want to
push people away from thread locals (globals)
for now.

Bug: 237245600
Test: N/A
Change-Id: I6e293814769cbd3c41e72afd95385af31ceb099f
2022-07-06 21:48:46 +00:00
Hani Kazmi
48e0ac1311 Merge "Parcel.java: Fix bug where non-nested creators threw NullPointer" am: 97211945a8 am: 715e417609 am: d74c99a05f am: 5005c4a93d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2139755

Change-Id: I92798cf63fdff3ea5163137740286a2e1b66ad2b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 12:18:03 +00:00
Hani Kazmi
d74c99a05f Merge "Parcel.java: Fix bug where non-nested creators threw NullPointer" am: 97211945a8 am: 715e417609
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2139755

Change-Id: I5b2d68cebbff65183c9c854d43bd1da817fe8eea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 11:36:59 +00:00
Hani Kazmi
715e417609 Merge "Parcel.java: Fix bug where non-nested creators threw NullPointer" am: 97211945a8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2139755

Change-Id: I0c74786d36b73d8c7812750dac5b6af55fb96ff9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-05 11:11:31 +00:00
Hani Kazmi
03c34f57c0 Parcel.java: Fix bug where non-nested creators threw NullPointer
Upon deserialization, various APIs would check that the passed in class
was assignable from the creator's enclosing class - which was assumed to
always be the Parcelable type.

This assumption is not always true, so updating the check to explicitely
store the parcelable type

Fix: 232589966
Test: m && atest ParcelTest && atest BundleTest
Change-Id: I59b650a854944e9020615a65798c5e54f5540aaa
2022-06-30 13:04:11 +00:00
Hani Kazmi
ace5dfd5d1 Merge "BaseBundle.java: Adding tests for 'Recycle underlying parcel for bundle'" into tm-dev am: 6b07af5e83 am: c388f2b9d0 am: ad4244ec44
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18929334

Change-Id: I6885f5c782117963028be3404ce49dbf0f8b8697
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 11:58:43 +00:00
Hani Kazmi
ad4244ec44 Merge "BaseBundle.java: Adding tests for 'Recycle underlying parcel for bundle'" into tm-dev am: 6b07af5e83 am: c388f2b9d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18929334

Change-Id: Iee33adbe2a5efcdad1b18bac03b2cae81ebda658
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 11:42:12 +00:00
Hani Kazmi
bfa7ecc279 Merge "BaseBundle.java: Adding tests for 'Recycle underlying parcel for bundle'" into tm-dev am: 6b07af5e83
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18929334

Change-Id: I5f81f71ccdd368a37653e31399d435570870350f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-29 10:58:29 +00:00
Xin Li
14543d1ec7 Merge tm-dev-plus-aosp-without-vendor@8763363
Bug: 236760014
Merged-In: I5705ac7586cb73b7bc2bd60bb792d0a0a951ed74
Change-Id: I59a4fd917c95c8c9e258cd743cee2d950a46d9cd
2022-06-28 21:24:28 +00:00
Treehugger Robot
16f0c1c426 Merge "Update VibrationAttributes javadocs for FLAG_BYPASS_INTERRUPTION_POLICY" am: c3560c6c68 am: fb98ab119d am: 1c88dd6b6d am: 27ea0bba2e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2133773

Change-Id: I8839c903b24dcdf67fb6e1a526489980dad67e67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-27 20:00:59 +00:00
Steven Moreland
6db478c840 Merge "Parcel: better debug recycle" 2022-06-24 21:53:32 +00:00
Steven Moreland
710f817286 Parcel: better debug recycle
Detect recycle called twice always (and when DEBUG_RECYCLE is on, we
detect recycle called twice or called zero times, and we show a stack).

Bug: 231799394
Test: manual (calling recycle twice)
Change-Id: I1dd9f392ee916edd9c598085a1c19dbdd3ce957f
Merged-In: I1dd9f392ee916edd9c598085a1c19dbdd3ce957f
2022-06-24 20:43:45 +00:00
Treehugger Robot
1c88dd6b6d Merge "Update VibrationAttributes javadocs for FLAG_BYPASS_INTERRUPTION_POLICY" am: c3560c6c68 am: fb98ab119d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2133773

Change-Id: I46739270ddbd6d5b7354bfa4878be1fabad52835
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-24 19:35:42 +00:00
Hani Kazmi
621dc99968 BaseBundle.java: Adding tests for 'Recycle underlying parcel for bundle'
Follow up to ag/18795008. Adding tests for new behaviour.

As it is not possible to directly check on the bundle if the parcel has been recycled,
we inject a spy into it. Mocking static methods is not possible in
FrameworkCoreTests, so we introduce a new test class in
FrameworksMockingCoreTests which is run when any parcel or bundle source
file changes.

Bug: 233216232
Test: atest BundleRecyclingTest

Change-Id: If691b68a8db1f0110d131ec620935f566cc9367b
2022-06-24 12:07:29 +00:00
Lais Andrade
2d6c839d89 Update VibrationAttributes javadocs for FLAG_BYPASS_INTERRUPTION_POLICY
Add clarification that this flag can only be applied by privileged apps, and will be ignored otherwise.

Bug: 236932598
Change-Id: I78db484b9d479abed67689c827707b6f141b2c00
Test: N/A
2022-06-23 13:13:42 +00:00
Chris Wailes
80f33ec0a9 Merge "Add System Properties based settings for USAPs" am: a2143c07bb am: 6cb0a4dd92 am: ca5df431c5 am: 8b193879c6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2043395

Change-Id: Icdf31b641bec9b3f39591586086640868c30f9ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 23:45:53 +00:00
Steven Moreland
0812da1a82 Merge "Parcel: better debug recycle" into tm-dev-plus-aosp am: fc6b6d35b4 am: 19ea3d8b46
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18973047

Change-Id: Iaaadfdf50a3420261226a6fe7d7bddcd5396620e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 23:45:21 +00:00
Chris Wailes
ca5df431c5 Merge "Add System Properties based settings for USAPs" am: a2143c07bb am: 6cb0a4dd92
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2043395

Change-Id: I98e8a58abbbc5ac8ba5b8caad4dcb365495209c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-21 23:08:53 +00:00
Steven Moreland
00fe31defd Parcel: better debug recycle
Detect recycle called twice always (and when DEBUG_RECYCLE is on, we
detect recycle called twice or called zero times, and we show a stack).

Bug: 231799394
Test: manual (calling recycle twice)
Change-Id: I1dd9f392ee916edd9c598085a1c19dbdd3ce957f
2022-06-17 19:32:23 +00:00
Chris Wailes
e05e1ffffe Add System Properties based settings for USAPs
This CL updates the configuration handling for USAP system properties.

Test: Build; flash; set property; check device state
Bug: 161725679
Change-Id: Ia1f6c4f4f7b8798d9c906953629bed61ce618f54
2022-06-17 10:49:17 -07:00
Xin Li
195b02b570 Merge "Merge Android 12 QPR 3" 2022-06-16 18:51:54 +00:00
Jooyung Han
fab0dc0d32 Merge "Unhide Parcel.writeTypedList() with additional flag" am: a4d51305f7 am: 2f831b08ca am: dc9b9f6d83 am: 92b6b4d408
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2107830

Change-Id: If621d256967d1b335cd8ae138c38b42650b94f0c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 15:43:58 +00:00
Jooyung Han
dc9b9f6d83 Merge "Unhide Parcel.writeTypedList() with additional flag" am: a4d51305f7 am: 2f831b08ca
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2107830

Change-Id: I1e24dc9b7d861bf77fd90f25a9184fa5f4be9dd1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 15:07:54 +00:00
Hani Kazmi
34b061c00a Merge "BaseBundle.java: Recycle underlying parcel when bundle is cleared." 2022-06-15 09:51:53 +00:00
Jooyung Han
2f831b08ca Merge "Unhide Parcel.writeTypedList() with additional flag" am: a4d51305f7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2107830

Change-Id: If36533484f1f90c57b6799d086fa5e9b7beba35e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-15 01:32:14 +00:00
Jooyung Han
a4d51305f7 Merge "Unhide Parcel.writeTypedList() with additional flag" 2022-06-15 01:02:07 +00:00
Hani Kazmi
788eb8c7ed BaseBundle.java: Recycle underlying parcel when bundle is cleared. am: 2685de9862 am: 8883e5d5ee am: 18dc8b369d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18795008

Change-Id: Ib6bb732162894015f7d63213c23251e05fb4a35e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 16:03:42 +00:00
Hani Kazmi
2b13efde11 BaseBundle.java: Recycle underlying parcel when bundle is cleared. am: 2685de9862 am: 28752b7242
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18795008

Change-Id: I799f8cda2fc1c794bfdfa7b945306a7f73709107
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 12:43:49 +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
Hani Kazmi
8883e5d5ee BaseBundle.java: Recycle underlying parcel when bundle is cleared. am: 2685de9862
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18795008

Change-Id: I0586da9a07484043a4247f1d53793321d829f670
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-14 09:29:03 +00:00
Hani Kazmi
2685de9862 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
2022-06-14 09:10:53 +00:00
Steven Moreland
fe307539da Merge "Parcel: warnings for 'REPLY' statuses" am: d36a3f33e2 am: 69f8011ec8 am: d31a688700 am: f73ad3377a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2117786

Change-Id: I80e563a5eba084ea8ae66af590560e6a4c07b905
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 21:30:38 +00:00
Steven Moreland
d31a688700 Merge "Parcel: warnings for 'REPLY' statuses" am: d36a3f33e2 am: 69f8011ec8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2117786

Change-Id: Icb969ef001eacba25d74a9d3d2b586783436793e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 20:07:25 +00:00
Steven Moreland
69f8011ec8 Merge "Parcel: warnings for 'REPLY' statuses" am: d36a3f33e2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2117786

Change-Id: I953c099b4cdbc971362220ade5b2b9130c9edad0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 19:40:22 +00:00
Steven Moreland
d36a3f33e2 Merge "Parcel: warnings for 'REPLY' statuses" 2022-06-10 17:40:52 +00:00
Max Bires
4638b2a66d Merge "Fix comment in docs about ID attestation." am: 5592977b0f am: 215389da4b am: 5a18b93b6c am: af5774c90b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2116413

Change-Id: Ifba8b11cd4b89ec902de9b6b79f84c6d3f4d1a8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 01:03:08 +00:00
Max Bires
5a18b93b6c Merge "Fix comment in docs about ID attestation." am: 5592977b0f am: 215389da4b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2116413

Change-Id: Ia3c99d4c41fe26efabecfb4547afae4100ca10da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 00:26:27 +00:00
Max Bires
215389da4b Merge "Fix comment in docs about ID attestation." am: 5592977b0f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2116413

Change-Id: Ia4a4520e7ac1b2fa038b4f366c84a8b6fd6ee8bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-10 00:00:12 +00:00
Max Bires
5592977b0f Merge "Fix comment in docs about ID attestation." 2022-06-09 23:42:03 +00:00
Eric Biggers
9cbfe71d40 Merge "Remove obsolete support for emulated FBE" am: d96c8701dd am: 5f2aa0bd19 am: cb6e4d4cda am: 1e53fd6a71
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2101871

Change-Id: I9710158133d592158ad8992f1edc1e5b5cee92c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 20:03:37 +00:00
Eric Biggers
cb6e4d4cda Merge "Remove obsolete support for emulated FBE" am: d96c8701dd am: 5f2aa0bd19
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2101871

Change-Id: Idd5e502f12216c2de212b68682fb97a4bb28e874
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 19:52:48 +00:00
Eric Biggers
5f2aa0bd19 Merge "Remove obsolete support for emulated FBE" am: d96c8701dd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2101871

Change-Id: Ie9d19eb2636e4a81478305631adea335a076f96e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-06-09 18:59:35 +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