Commit Graph

10381 Commits

Author SHA1 Message Date
TreeHugger Robot
951aa29f72 Merge "Fix memory flags in external services and secondary zygotes." into tm-dev 2022-03-02 00:57:51 +00:00
Colin Cross
4c7fba2811 Merge "Add Build.Version.RELEASE_OR_PREVIEW_DISPLAY" am: a789b92644 am: e3086a9896 am: ffa0f38936
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2003053

Change-Id: I21f5874867e74ca12334711adf1fbc6938c1a3ff
2022-03-02 00:55:39 +00:00
Colin Cross
e3086a9896 Merge "Add Build.Version.RELEASE_OR_PREVIEW_DISPLAY" am: a789b92644
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2003053

Change-Id: Iab0ad2e55f21ba464ae1b7d4c3ac3252638f711b
2022-03-02 00:13:00 +00:00
Colin Cross
a789b92644 Merge "Add Build.Version.RELEASE_OR_PREVIEW_DISPLAY" 2022-03-02 00:01:05 +00:00
Neil Fuller
ca67d53303 Merge "Add explicit OWNERS for SystemClock and related classes" am: c740b09828 am: 1cd597ccd1 am: f0454c198f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2003870

Change-Id: I1c5e525b23ae2622c79c32f05113f78b9180d084
2022-03-01 18:42:28 +00:00
Evgenii Stepanov
fe85ed2ef5 Fix memory flags in external services and secondary zygotes.
This change fixes a number of interconnected issues in memory safety
(MTE, GWP-ASan, nativeHeapZeroInit) runtime flags.

* Exported services use the hosting app UID to locate the process
  definition, and fail 100% of the time. Use the defining app UID and
  package name instead.
* Isolated services process name does not match the name in the defining
  app manifest, because it includes a class name and an instance number.
  Pass the defining process name in HostingRecord to address this.
* Exported service ApplicationInfo.packageName refers to the hosting
  app, again. As a result, wrong compat feature overrides are applied.
  This has been fixed before for AppZygote services; extend the fix to all
  external services.
* Pass correct memory runtimeFlags to WebViewZygote. This is important
  because both MTE and GWP-ASan have a one-way disable switch; they are
  enabled in the Zygote and disabled in the apps that do not opt-in.
  Passing 0 runtimeFlags to WebViewZygote (and AppZygote) makes it
  impossible to enable these features later in their child processes.

This change moves runtimeFlags logic from ProcessList to os.Zygote to
make it available to WebViewZygote.

Bug: 208910418
Test: CtsTaggingHostTestCases
Test: atest in frameworks/base
Test: CtsWebkitTestCases
Test: manual install WebView with android:memtagMode tag

Change-Id: I232d35344f4cd34226ff11324421904b35251525
2022-03-01 18:23:28 +00:00
Neil Fuller
1cd597ccd1 Merge "Add explicit OWNERS for SystemClock and related classes" am: c740b09828
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2003870

Change-Id: Id14bf9d6a5eb3bc9f740e4c4a86fcc71d6ba4741
2022-03-01 17:59:02 +00:00
Nikita Ioffe
8056335fcd Merge "Rename SupplementalProcess to SdkSandbox" into tm-dev 2022-03-01 17:07:16 +00:00
TreeHugger Robot
9870b8a5f4 Merge "Fix vibration effect segment validation regression on allocation count" into tm-dev 2022-03-01 15:30:57 +00:00
Neil Fuller
014549b0a0 Add explicit OWNERS for SystemClock and related classes
Bug: 213393821
Bug: 189810551
Change-Id: Ie0736e54f56bb749eff669ea42c25ce70ef4deb4
2022-03-01 11:12:08 +00:00
Lais Andrade
9721eda984 Fix vibration effect segment validation regression on allocation count
Change validation of user input parameters to create a VibrationEffect
to avoid build the error message string unless the validation fails, do
fix regression on allocation count perf metric.

Fix: 215985428
Test: fixed regression on metric
Change-Id: Ibbcfd450f0b25b88e071f3781952f24a72473575
2022-03-01 10:39:52 +00:00
Colin Cross
ef48689e32 Add Build.Version.RELEASE_OR_PREVIEW_DISPLAY
Build.Version.RELEASE_OR_PREVIEW_DISPLAY propagates a string that
contains a user-friendly version name for preview releases, or the
Build.Version.RELEASE version for final releases.

Test: manual
Bug: 221950960
Change-Id: I31f8f67996e3e5e7edc00704b16b8df0db17d3a3
2022-02-28 18:02:59 -08:00
Hao Ke
7cff84a534 Merge "Changing readParcelableList's API." am: 0b340743a6 am: 91117c2cfd am: 35ce6344cf
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1998972

Change-Id: I3f49c826a50a8b28f20d4d8f9913b35f4fa0b4ae
2022-02-28 21:04:28 +00:00
Hao Ke
dbb831447c Merge "Update JavaDoc to replace deprecated Parcel read APIs." am: 06ee57cda1 am: d1fdbdff31 am: d38ca191d5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1977155

Change-Id: I7572a1f8842f45ec3b748b8dda3bba0d19626077
2022-02-28 21:03:49 +00:00
Nikita Ioffe
df5971335b Rename SupplementalProcess to SdkSandbox
Bug: 218314884
Bug: 220320098
Test: presubmit
Test: atest PackageManagerShellCommandTest
Test: atest SdkSandboxPermissionTest
Change-Id: I9fb98e0caee75bdaaa35d11d174004505f236799
2022-02-28 17:29:55 +00:00
Hao Ke
91117c2cfd Merge "Changing readParcelableList's API." am: 0b340743a6
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1998972

Change-Id: I83c21117a7f4c64471cf23bed566973b9bb1f4db
2022-02-25 18:26:42 +00:00
Hao Ke
d1fdbdff31 Merge "Update JavaDoc to replace deprecated Parcel read APIs." am: 06ee57cda1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1977155

Change-Id: I0159f60033909eb953744479d5eefbf4457197ab
2022-02-25 18:26:13 +00:00
Hao Ke
0b340743a6 Merge "Changing readParcelableList's API." 2022-02-25 18:14:41 +00:00
Hao Ke
06ee57cda1 Merge "Update JavaDoc to replace deprecated Parcel read APIs." 2022-02-25 18:04:42 +00:00
Hao Ke
0641e854a6 Changing readParcelableList's API.
Signature of readParcelableList() new API is inconsistent with rest,
Changing it to allow using Child class as the required type.

Bug: 221069460
Test: Build and boot.
Change-Id: Ic01c9c8011977d75e3be73f55597dd1bfcd524da
2022-02-24 22:31:11 +00:00
Treehugger Robot
57ef6a2de3 Merge "Clear BCB if space allocation failed" am: b667621f8b am: b83bb72fb7 am: 0bbc41378b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1997490

Change-Id: Ia8aa6e797c1d59385b2762a788770478737e158f
2022-02-24 20:27:54 +00:00
Treehugger Robot
b83bb72fb7 Merge "Clear BCB if space allocation failed" am: b667621f8b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1997490

Change-Id: Id9e3f312578a322784d8e80025ee72ac1419bf57
2022-02-24 19:31:36 +00:00
Treehugger Robot
b667621f8b Merge "Clear BCB if space allocation failed" 2022-02-24 18:58:21 +00:00
Hao Ke
66cd477d77 Update JavaDoc to replace deprecated Parcel read APIs.
Bug: 195622897
Change-Id: I5f6444dcc87ad76bf6f6312eea68891aa07604cb
Test: None
2022-02-24 13:13:48 +00:00
Kweku Adams
872eecc6a7 Merge "Open up getCloudMediaProvider to mainline modules." into tm-dev 2022-02-23 18:28:44 +00:00
Kelvin Zhang
c256798220 Clear BCB if space allocation failed
setupBcb() is called before allocating space, if space allocation
failed, we should clearBcb() to properly release resources.

Test: th
Bug: 221001516
Change-Id: Idce67925503cf910ab226b193a4387c32225c0bb
2022-02-23 08:55:25 -08:00
Philip Junker
eefc676fd2 Merge "Deprecate ACQUIRE_CAUSES_WAKEUP flag." into tm-dev 2022-02-23 15:56:07 +00:00
Kweku Adams
fdae3e8060 Open up getCloudMediaProvider to mainline modules.
Bug: 220890919
Test: atest CtsPhotoPickerTest
Change-Id: I2933b622eede53f87baff94da12cc9b3cc532456
2022-02-22 20:08:56 +00:00
Bernardo Rufino
854cd54abd Merge "Add safer Bundle APIs and deprecated old ones" am: c5589d2c92 am: ce09bba3fc am: aed366dc04
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988908

Change-Id: I684471f938a4400fae3309ad2c9759d808075aea
2022-02-22 14:31:52 +00:00
Bernardo Rufino
ce09bba3fc Merge "Add safer Bundle APIs and deprecated old ones" am: c5589d2c92
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988908

Change-Id: Iadab8b0106bf99b9c6fbdeca6cc020e1d909ae1a
2022-02-22 13:50:00 +00:00
Bernardo Rufino
486bd1e357 Merge "Add @hide Bundle.getParcelable() with explicit type" am: 58b4c57393
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988907

Change-Id: I64dcfca33f85e355346b0fe6880ba58413a98308
2022-02-21 13:31:47 +00:00
Philip Junker
1c82568b6c Deprecate ACQUIRE_CAUSES_WAKEUP flag.
Bug: 216114297
Test: javadocs only, no tests were run
Change-Id: Iba8521e47151b84e4a59f32884041ea13f82e36b
2022-02-21 10:10:42 +00:00
Bernardo Rufino
cccb1b78d9 Add safer Bundle APIs and deprecated old ones
Add safer Bundle APIs that take an extra Class<T> argument that checks
that the type about to be deserialized is a child of the type passed in
parameter *before* actually deserializing it, while also deprecating old
APIs.

This allows use to reap the benefits of the new typed Parcel APIs and
enhances security.

Only the APIs that could involve custom object injection are modified.
So, besides the obvious ones that have that design (eg.
readParcelableList()), subtler cases such as readIntegerArrayList()
could result in custom object deserialization, and since it's all
generics, even the casting inside Bundle wouldn't fail, only after the
client unpacked the list items would it blow up. Now those are checked
beforehand.

Since Bundle always calls Parcel.readValue() under the hood (instead of
specialized APIs such as readParcelable() etc), we had to augment that
method (that's used by LazyValue when retrieving the item) to accept
item types now for containers, which I implemented as a vararg of
Class<?> parameters (this is all private/@hide). This way we could
retrieve a list of intents like readValue(.., List.class, Intent.class),
or a map of string to intents like readValue(.., Map.class,
String.class, Intent.class). For non-container items, we can just pass
no arguments for the vararg. This is explained in internal javadocs.

Inside readValue() now, we also check the container types before
calling the internal methods for deserialization. So, if the thing on
the wire is a VAL_MAP and we know the method we're about to call will
return a HashMap, we verify that the type passed in parameter is a super
type of that (if it's non-null, if it's null it means "perform no
check").

Now, LazyValue became a BiFunction<Class<?>, Class<?>[], Object> to
receive those extra "item types" for containers. The reason for
separating the first from the rest is that the first defines the return
type in the new APIs and inside Parcel, so we need the T from Class<T>
to ensure type-safety.

(I was torn here between using BiFunction or just exposing LazyValue as
@hide for Bundle since it feels like we're missing meaning/abstraction,
but end up leaving this way, advise if you'd prefer the other way)

There was a bit of a refactor in Parcel so readValue() could call
internal methods that accepted nullable Class<?> parameters with the
meaning that null = "no verification"  and non-null = "check against
type provided" (because the external APIs all require non-null
parameters).

Now we can return null in all cases when there is a type mismatch. Note
that the Bundle APIs catch ClassCastException to return null, but that
only works for non-generic types (eg. getSizeF()). For generic types
wrapping "return (T) o" with try-catch doesn't work because the type
gets erased to its bound at runtime, so the type mismatch escapes that
try-catch to the caller, potentially causing a crash. Now they happen
inside the getters, as the non-generic ones.

Test: Boots for now
Test: Working on CTS
Test: atest -d android.os.cts.ParcelTest android.os.cts.BundleTest android.os.BundleTest android.os.ParcelTest
CTS-Coverage-Bug: 219980813
Change-Id: Ifcbeb34b4684d7de105756b9d414162a9205ffaa
2022-02-19 14:10:29 +00:00
Wei Wang
43243e35d9 Merge "Add systrace tag for thermal" 2022-02-17 19:27:12 +00:00
Bernardo Rufino
32b2842e07 Add @hide Bundle.getParcelable() with explicit type
Provider a type-safer API getParcelable() that takes a Class<?>
parameter.

Test: Manual (tested downstream)
Bug: 213169612
Bug: 212804042
Bug: 212803946
Bug: 210885162
Merged-In: Ieebc044043e0776e71d35c1cc11be9299f972c45
Change-Id: I76f9558bfa1525877bec15cfc43abdc43cba0f24
2022-02-16 20:16:44 +00:00
Wenhao Wang
31603e398f LogcatManagerService: Update AIDL file
1. add comments
2. add "oneway" modifier.

Bug: 197901557
Test: manually
Ignore-AOSP-First: pending fix for logcat privacy issue
Change-Id: I7a0217d76183ebc7609ab776cc8b8dcc1cd0d2ee
2022-02-16 12:14:51 -08:00
Simon Bowden
1d8030a182 Merge "Update vibrator javadoc formatting." 2022-02-15 22:41:33 +00:00
Sudheer Shanka
cfe627f236 Merge "Cache IAlarmManager binder handle." 2022-02-15 21:39:43 +00:00
TeYuan Wang
3b09ac0c9e Add systrace tag for thermal
Bug: 218939123
Test: python systrace.py thermal -o test.html
Change-Id: Ib77f7364e9c491238116240e84cdde420a6e1a11
Ignore-AOSP-First: conflict in vendor/google_arc, need master first
2022-02-15 15:46:04 +00:00
Simon Bowden
447f56e5e9 Update vibrator javadoc formatting.
After reviewing rendered docs, adding missing paragraph markers
and some small typos, as well as fixing code snippets to be inside a <pre> block. At the
moment, trailing newlines get picked up so it's also necessary to
terminate the code and pre blocks on the actual last line of code.

Test: built docs and manually reviewed site
Change-Id: I327b146eaae20fa3a2e8cf066e211e14cb165c51
2022-02-15 11:56:14 +00:00
Neharika Jali
8c4113ea51 Merge "Clarification to incorporate API review feedback" 2022-02-15 04:07:46 +00:00
Xin Li
a6a261b1be Merge "Merge sc-v2-dev-plus-aosp-without-vendor@8084891" into stage-aosp-master 2022-02-14 17:30:12 +00:00
Neharika Jali
1f65ee7946 Clarification to incorporate API review feedback
Bug: 210990627
Test: manual build succeeds
Change-Id: I62332fb462810050ed5baac3fecd559a4c28165a
2022-02-14 16:44:42 +00:00
Artur Satayev
2dcdd39194 Merge "Use ro.build.version.known_codenames sysprop for KNOWN_CODENAMES." am: 19c5ee8bf1 am: 247988066c am: c8d4c8faf8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978331

Change-Id: I1062423fe2b0c8af78e7826c123a7d547704edcd
2022-02-14 12:59:21 +00:00
Artur Satayev
c8d4c8faf8 Merge "Use ro.build.version.known_codenames sysprop for KNOWN_CODENAMES." am: 19c5ee8bf1 am: 247988066c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978331

Change-Id: Ifb3aec2d1e7aeb5aa24b6d1bf70ba6cd4fa987ed
2022-02-14 12:43:40 +00:00
Artur Satayev
19c5ee8bf1 Merge "Use ro.build.version.known_codenames sysprop for KNOWN_CODENAMES." 2022-02-14 12:08:04 +00:00
Kweku Adams
7dd1109928 Merge "Exempt backup jobs for media cloud provider." 2022-02-12 01:55:53 +00:00
TreeHugger Robot
92adbe6a25 Merge "Added RemoveResult annotation to RemoveUserWhenPossible call" 2022-02-12 00:05:39 +00:00
Adam Bookatz
aa804f9749 Merge "UserManager.getProfileType hidden API and caching" 2022-02-11 23:58:05 +00:00
Sudheer Shanka
7cbad8a063 Cache IAlarmManager binder handle.
Bug: 218909495
Test: treehugger
Change-Id: Ib73dac85999311993fa9f0d552609065c24a155c
2022-02-11 15:47:24 -08:00