Commit Graph

10547 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Treehugger Robot
aaf1a497fa Merge "Add dipankarb to storage owners" am: 6b7ebbfd26 am: 053f3b9137
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2106664

Change-Id: I6a218ebe48fda341f13ee7036e8c41a3f27df209
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 18:42:29 +00:00
Treehugger Robot
053f3b9137 Merge "Add dipankarb to storage owners" am: 6b7ebbfd26
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2106664

Change-Id: I7f056b43ca1124f7ee7a824015c314e8f1f95533
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-25 18:24:15 +00: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
1346779747 Merge "Updating nativeAsyncTraceForTrackEnd to not require a name argument" am: fbc5263e1a am: 09953ea512
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2078718

Change-Id: If4a6d9efd16445a3188fff655158ecce86163e3e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 20:27:18 +00:00
Treehugger Robot
09953ea512 Merge "Updating nativeAsyncTraceForTrackEnd to not require a name argument" am: fbc5263e1a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2078718

Change-Id: I0bb1651bb4c6f86fb86a4ba923a6da06086206f8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-24 19:45:52 +00:00
Treehugger Robot
fbc5263e1a Merge "Updating nativeAsyncTraceForTrackEnd to not require a name argument" 2022-05-24 19:27:55 +00:00
Sanjana Sunil
29f8db1c9f Merge "Set correct volume storage path for SDK sandbox" into tm-dev am: 0b28d29298
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17983856

Change-Id: Iac8cc87bc207f6b50654f36159ec5bed417ea12f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 20:39:09 +00:00
TreeHugger Robot
b28a933452 Merge "Improve javadoc for Wi-Fi related policies" into tm-dev am: e51b62b2a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18374443

Change-Id: I869750bf175f17900d367cd891c5da980aa708b4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 20:29:15 +00:00
TreeHugger Robot
34485f0b9c Merge "Check sleep reason and time before cancelling vibrations" into tm-dev am: 79dc62bfef
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18280949

Change-Id: I40085bfaf5ff8ead0530037521e9406caf6c7616
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 20:28:57 +00:00
Treehugger Robot
e96c133793 Merge "Make binderDied(IBinder who) public API" am: dcbb21deaa am: 5b4764e7a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1916883

Change-Id: I5d40556a579454f06a1d3494d47b8e983f4883f3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 06:39:50 +00:00
Treehugger Robot
5b4764e7a1 Merge "Make binderDied(IBinder who) public API" am: dcbb21deaa
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1916883

Change-Id: I01aa64cd8cef1042c81eab891602c93a6b294b6d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-18 05:54:00 +00:00
Sanjana Sunil
0b28d29298 Merge "Set correct volume storage path for SDK sandbox" into tm-dev 2022-05-17 15:40:12 +00:00
TreeHugger Robot
e51b62b2a3 Merge "Improve javadoc for Wi-Fi related policies" into tm-dev 2022-05-16 22:04:37 +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
Sanjana Sunil
79241ae7d9 Set correct volume storage path for SDK sandbox
Context.getDataDir() for SDK sandbox incorrectly returns /data volume
path even if the actual storage is on another volume. This CL sets the
correct storage path by checking the uuid from the ApplicationInfo of
the client app and setting it to the same value.

Bug: 229736419
Test: atest
SdkSandboxStorageHostTest#testSdkSharedStorage_DifferentVolumeIsUsable

Change-Id: Ib72ea559363cdeb4b7cfcc2f48ca8ddace96e352
Merged-In: Ib72ea559363cdeb4b7cfcc2f48ca8ddace96e352
2022-05-16 15:43:37 +00:00
Rubin Xu
1638b20f44 Improve javadoc for Wi-Fi related policies
Bug: 226128486
Test: none
Change-Id: I21f0f0eb1f9a4754d42f4ae3c8e8a36865d58afa
2022-05-16 15:38:14 +00:00
Lais Andrade
c558857fc7 Check sleep reason and time before cancelling vibrations
Add a method PowerManagerInternal.getLastGoToSleep(), similar to
existing method getLastWakeup(), to retrieve global values for last go
to sleep events, including system uptime and reason.

Retrieve this data in VibratorManagerService before cancelling ongoing
vibrations by the broadcast of ACTION_SCREEN_OFF intents to indicate
that the screen was turned of when the vibration was still playing. This
new logic allows vibrations to continue in the following cases:

- the broadcasted event was triggered before the vibration started;
- there is already a wakeup event triggered by the time the screen off
  broadcast is being processed by the vibrator service;
- the screen off reason is in allowlist, indicating it's an
  automatically triggered event (screen timeout or user inattentive);

This should handle the following scenarios:

- delayed broadcasts of screen off events, that should not cancel
  vibrations that started when the screen was already off (e.g.
  notification or ringtone that are allowed to vibrate in that state);

- race conditions when the screen automatically turns off right after a
  ringtone/notification vibration starts, before the notification
  acquires a screen lock;

Fix: 219849350
Test: VibrationSettingsTest
Change-Id: I358327192196989a7d4fc49a96b2ab92ec677302
2022-05-13 19:53:43 +01:00
Samiul Islam
f218065761 Merge "Disallow external storage access without restricting other api calls" into tm-dev am: 5f0c868b6a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17940795

Change-Id: I9a4db80408b45f10602be6d68c26b1a1917f0b4d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-05 13:57:32 +00:00
Samiul Islam
5f0c868b6a Merge "Disallow external storage access without restricting other api calls" into tm-dev 2022-05-05 13:39:34 +00:00
Adam Bookatz
655c91a157 Merge "Ensure getUserName cannot return null" into tm-dev am: 1503b56202
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18126297

Change-Id: Id4c754cbba26b3774ad525b0aaccbec064c1df09
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 17:41:41 +00:00
Adam Bookatz
1503b56202 Merge "Ensure getUserName cannot return null" into tm-dev 2022-05-04 17:20:45 +00:00
Robert Horvath
e15e9f41c9 Merge changes I6a3f56bd,Ib5f39eb1 into tm-dev am: 1999fa1097
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17888925

Change-Id: Ied83e0ddcc2a563584825f10e2f912477c92c642
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-05-04 13:04:51 +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
Adam Bookatz
cd2466ee30 Ensure getUserName cannot return null
A user can be created with an explicitly null name, as happens in tests.
But getUserName claims to never return null. So we must do a null-check
here to prevent it.

Bug: 227624966
Test: atest UserManagerTest
Change-Id: Iea0e7b6292c6dd49df1bebc5467091a82ddaedb5
2022-05-02 20:18:54 +00:00
Robert Horvath
d112201586 Batch log access requests from same client
For multiple log access requests from the same client
(same UID + package name) within a short timeframe, show only one
confirmation prompt to the user.

When access has been approved/denied, further requests will
automatically be approved/denied until another timeout expires, after
which a new request will show a prompt again.

If the prompt is shown but the request isn't approved or denied within a
certain time, the client will automatically be denied access.

Moved the approve/decline methods out of ILogcatManagerService into a
local service, so that they can only be called from within the system
server.

Bug: 229976778
Test: atest FrameworksServicesTests:LogcatManagerServiceTest
Change-Id: I6a3f56bdcbb84e64b1b24e73476bd24f32b75f24
2022-05-02 15:19:43 +02:00
Samiul Islam
db9e238ec7 Disallow external storage access without restricting other api calls
Currently, sandbox cannot call any apis from StorageManager that checks
calling package has same uid as calling uid. This CL fixes that by using
pm.isSameApp() api.

Additionally, since Environment.java fetches the initial application
context, the uid for that does not fall under the sandbox uid range. It
falls under app uid range. We fix the problem by checking for
PROPERTY_NO_APP_DATA_STORAGE flag on the application.

Bug: 228424287
Test: atest CtsSdkSandboxInprocessTests (see ag/17657742)
Change-Id: I8d9fca369cfbed47b40a42a44a40ff73acb712ec
2022-04-28 15:39:26 +01:00