Commit Graph

17103 Commits

Author SHA1 Message Date
Treehugger Robot
cdeb61ebb7 Merge "Add a runtime check to ensure that system server jars are prefetched." am: 990ac01f71 am: a80c2cd027
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925695

Change-Id: I38f4a3f9f523fc2a59c0dd9569870c0a7de7379f
2022-02-25 14:35:25 +00:00
Treehugger Robot
a80c2cd027 Merge "Add a runtime check to ensure that system server jars are prefetched." am: 990ac01f71
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925695

Change-Id: I90d1b85718c49e772107724aea59155dbe0bf8d1
2022-02-25 14:10:46 +00:00
Treehugger Robot
990ac01f71 Merge "Add a runtime check to ensure that system server jars are prefetched." 2022-02-25 13:44:34 +00:00
Jiakai Zhang
8db9757f08 Add a runtime check to ensure that system server jars are prefetched.
We prefetch standalone system server jars in ZygoteInit based on the
STANDALONE_SYSTEMSERVER_JARS environment variable, so that they can take
the advantage of AOT compilation. This CL adds a check to disallow jars
that are not prefetched, which reminds developers to make appropriate
changes so that their jars will be in the environment variable.

Bug: 203198541
Test: 1. Build a system image.
  2. The device boots.
Test: 1. Remove an entry from PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS
  2. Build a system image.
  3. The device does not boot and encounters the following error:
     java.lang.RuntimeException: Creating a ClassLoader from /apex/com.android.wifi/javalib/service-wifi.jar is not allowed. Please make sure that the jar is listed in `PRODUCT_APEX_STANDALONE_SYSTEM_SERVER_JARS` in the Makefile and added as a `standalone_contents` of a `systemserverclasspath_fragment` in `Android.bp`.
Change-Id: I275d75ac37194a4d8fd491529b7cdb697dc04e37
Merged-In: I275d75ac37194a4d8fd491529b7cdb697dc04e37
(cherry picked from commit 418ab8212c)
2022-02-24 16:21:28 +00:00
Bernardo Rufino
aed366dc04 Merge "Add safer Bundle APIs and deprecated old ones" am: c5589d2c92 am: ce09bba3fc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1988908

Change-Id: I2f821d9de45980035ae3b4f36d83b36ad859568e
2022-02-22 14:10: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
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
Xin Li
2b87be68b8 Merge SP2A.220305.012
Bug: 219523960
Merged-In: I748fdd49626acaa0e986a9d8038039cada6faa60
Change-Id: I67693156d705f2488fe18149d2dd02d529f009ff
2022-02-14 20:06:38 +00:00
Xin Li
5ad6db7742 Merge sc-v2-dev-plus-aosp-without-vendor@8084891
Bug: 214455710
Merged-In: I8cfa435bb6233818adb9cc99dadeeb06a03443d5
Change-Id: Ib93992d88fd1704179009a3872798b9e7b83a6d1
2022-02-11 07:25:43 +00:00
Treehugger Robot
94c6cdf4fb Merge "[MS70] Have BatteryStatsImpl use the public NetworkStats API" am: 8bbb5be10e am: 6a48a6d6f2 am: acc12c32f4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978092

Change-Id: Ib55e46bdb2679fea42d37a4858accd4c41d86d51
2022-02-10 18:49:56 +00:00
Treehugger Robot
acc12c32f4 Merge "[MS70] Have BatteryStatsImpl use the public NetworkStats API" am: 8bbb5be10e am: 6a48a6d6f2
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978092

Change-Id: I81ad272bcfd09eaf9da4dbcaf2e5b56c73eba5ea
2022-02-10 18:34:14 +00:00
Treehugger Robot
8bbb5be10e Merge "[MS70] Have BatteryStatsImpl use the public NetworkStats API" 2022-02-10 18:04:39 +00:00
Junyu Lai
571e216af5 [MS70] Have BatteryStatsImpl use the public NetworkStats API
Test: BatteryStatsManagerTest
Bug: 204830222
  (cherry-picked from ag/16713581)
Change-Id: I35dd909b5da563cea27d8a81a81fe472c59e9b17
Merged-In: I35dd909b5da563cea27d8a81a81fe472c59e9b17
2022-02-09 22:04:45 +08:00
Ken Chen
d13163b7a5 Merge "Add system_server to net_admin group" am: f584f880ab am: 0cd6e77d0e am: 18a04ccda5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978086

Change-Id: Iee69ac1cace716b3fa457518db7c97b9a7731285
2022-02-09 10:24:30 +00:00
Ken Chen
18a04ccda5 Merge "Add system_server to net_admin group" am: f584f880ab am: 0cd6e77d0e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978086

Change-Id: Ied6448fb2f73d8867463357d6eacc7fbe00ddaea
2022-02-09 10:12:53 +00:00
Ken Chen
f584f880ab Merge "Add system_server to net_admin group" 2022-02-09 09:42:29 +00:00
Jeff Chang
4436955d35 [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity am: 9c5c42ad03 am: 0281b203d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16743243

Change-Id: I9833001187073a9a148690e34c0960fc687a6022
2022-02-09 09:26:33 +00:00
Jeff Chang
0281b203d8 [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity am: 9c5c42ad03
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16743243

Change-Id: I36a91c0de0d6a072f930277c0f235177b7822d33
2022-02-09 09:09:08 +00:00
Jeff Chang
aa0349bc78 [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity am: f36b7b9f80
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16742068

Change-Id: I32f44bfc27e8086a2937112851989c1160877b39
2022-02-09 08:45:52 +00:00
Jean Chalard
aac1b3a307 Merge "Allow VPN apps to ask for running the validation checks" am: cbb2fa2f00 am: 64ba50411e am: 1f929d9bd5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1962928

Change-Id: Ie35764f5a4d7f9c1d3765a73331687450bbdbaf5
2022-02-09 06:56:37 +00:00
Jean Chalard
1f929d9bd5 Merge "Allow VPN apps to ask for running the validation checks" am: cbb2fa2f00 am: 64ba50411e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1962928

Change-Id: I8dcb813cfe589411da7345bc2c4308e9f149b275
2022-02-09 06:38:31 +00:00
Jean Chalard
cbb2fa2f00 Merge "Allow VPN apps to ask for running the validation checks" 2022-02-09 06:03:45 +00:00
Ken Chen
5c5b682b6d Add system_server to net_admin group
This allows system_server to search/read skfilter BPF programs. Skfilter
BPF programs status were previously dumped by Netd. In Android T, the
related code are mainlined and dumped by system_server process.
system_server needs to be in net_admin group so that it can read program
status.

$ adb root; adb shell ls -l /sys/fs/bpf/
-r--r----- 1 root net_admin ... prog_netd_skfilter_allowlist_xtbpf
-r--r----- 1 root net_admin ... prog_netd_skfilter_denylist_xtbpf
-r--r----- 1 root net_admin ... prog_netd_skfilter_egress_xtbpf
-r--r----- 1 root net_admin ... prog_netd_skfilter_ingress_xtbpf

Bug: 202086915
Test: test in Ib0e935ee2b714ac61daceba6d13fa7a20f97f68f
Change-Id: I8c48230a5da6873eee7d0ba183cb83e1d92cd8f6
2022-02-09 03:47:18 +00:00
Felipe Leme
cc98604cbe Merge "Adds OWNERS to com.androd.internal.util.Dump*" am: 0b6e3a959b am: 2727d1af13 am: a9428c51ac
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1976675

Change-Id: I613dd7d9e8e246aef420bda8c79817685a690be1
2022-02-08 19:22:08 +00:00
Felipe Leme
a9428c51ac Merge "Adds OWNERS to com.androd.internal.util.Dump*" am: 0b6e3a959b am: 2727d1af13
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1976675

Change-Id: I9094e6421123193cc474520d43c00f299e64a3ac
2022-02-08 19:05:18 +00:00
Felipe Leme
0b6e3a959b Merge "Adds OWNERS to com.androd.internal.util.Dump*" 2022-02-08 18:14:23 +00:00
Chiachang Wang
3fc98d5ebd Allow VPN apps to ask for running the validation checks
Expose an API to allow VPNs app to ask for running the validation
check on the VPN network built from Ikev2VpnProfile.

Bug: 184750836
Test: New test in Ikev2VpnTest
      Also FrameworksNetTests
Change-Id: I385bb887b6c697d8f5d87af750dbd2aab44afca6
CTS-Coverage-Bug: 184750836
 (but CTS is in the same topic, just not detected by the tool)
2022-02-09 02:19:15 +09:00
Felipe Leme
3c5dea3fe4 Adds OWNERS to com.androd.internal.util.Dump*
Test: no, thanks
Bug: 149254050

Change-Id: I1dbb8a4c04817f39de147927c26c14e461eb564b
2022-02-08 08:50:43 -08:00
Treehugger Robot
ed3eb039b8 Merge "Delete legacy fs-verity support" am: 81568fa22f am: b4661e274c am: b754030dbe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1966068

Change-Id: If68ccff8bad40fd9c74f38a7cd935a00c1575ba8
2022-02-08 01:50:05 +00:00
Treehugger Robot
b754030dbe Merge "Delete legacy fs-verity support" am: 81568fa22f am: b4661e274c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1966068

Change-Id: I797f197a29a811795fc5be5339be1afbde2e5fcd
2022-02-08 01:26:39 +00:00
Felipe Leme
77d989649b Merge "Adds OWNERS to com.androd.internal.util.dump" am: 5f09bb49f0 am: 4019688e39 am: 72c121d807
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1975006

Change-Id: I95b4f23001815a4d3423a779a4427656199e9a3e
2022-02-08 01:02:47 +00:00
Treehugger Robot
81568fa22f Merge "Delete legacy fs-verity support" 2022-02-08 00:48:19 +00:00
Felipe Leme
72c121d807 Merge "Adds OWNERS to com.androd.internal.util.dump" am: 5f09bb49f0 am: 4019688e39
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1975006

Change-Id: Ic92a701e2fe530cad0f74e0cc5bb28dc67df9b2d
2022-02-08 00:45:31 +00:00
Felipe Leme
5f09bb49f0 Merge "Adds OWNERS to com.androd.internal.util.dump" 2022-02-08 00:24:38 +00:00
Felipe Leme
16c1aedbf3 Adds OWNERS to com.androd.internal.util.dump
Test: no, thanks
Bug: 149254050

Change-Id: I7af006ffdfa768b887ff2c7bde970efbc1b1f297
2022-02-07 09:42:26 -08:00
Victor Hsieh
e97a8700b0 Delete legacy fs-verity support
The "legacy" fs-verity was introduced in P in Pixel 3 kernel. During
fs-verity upstream to Linux, the API has changed. During Pixel 4 / Q
development, fs-verity was upstreamed to Linux kernel. By setting
ro.apk_verity.mode = 2, device vendors such as Pixel 4 can opt in to
enable the support. The feature has become mandatory for new devices
shipped with R.

Since Pixel 3 family is no longer supported, it's time to remove the
dead code.

Bug: 120629632
Test: m
Test: TH
Change-Id: I6dacd9bbd38b502ee510ff12970e76342d7b72dd
Merged-In: I6dacd9bbd38b502ee510ff12970e76342d7b72dd
2022-02-01 23:09:43 +00:00
Jeff Chang
f36b7b9f80 [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity
A malicious application could overlay the activity. The overlay is
able to be tapped through, which can trick the user into starting a
harmful activity.

The CL added the flag SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS for
the activity to prevent the tapjacking/overlay attack.

Bug: 205595291
Test: atest CtsHarmfulAppWarningHostTestCases
Change-Id: Ia1a1ae0dc451e04bf5c31e3cb8cf30a0d8e32991
(cherry picked from commit a04b3666b8)
2022-01-28 04:46:20 +00:00
Jeff Chang
9c5c42ad03 [RESTRICT AUTOMERGE] Add hide-non-system-overlay flag for HarmfulAppWarningActivity
A malicious application could overlay the activity. The overlay is
able to be tapped through, which can trick the user into starting a
harmful activity.

The CL added the flag SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS for
the activity to prevent the tapjacking/overlay attack.

Bug: 205595291
Test: atest CtsHarmfulAppWarningHostTestCases
Change-Id: Ia1a1ae0dc451e04bf5c31e3cb8cf30a0d8e32991
(cherry picked from commit a04b3666b8)
2022-01-28 03:19:44 +00:00
Treehugger Robot
eb94286598 Merge "Have BatteryStatsImpl use the public NetworkStats API" am: 25d96f8d4d am: f566c778a7 am: 35802e3cf5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1955879

Change-Id: I042d2e008c113735c0b9e7a13da3b33927ea3e64
2022-01-25 08:49:44 +00:00
Treehugger Robot
35802e3cf5 Merge "Have BatteryStatsImpl use the public NetworkStats API" am: 25d96f8d4d am: f566c778a7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1955879

Change-Id: Ic25cef9d6ce7904bf818dcfd38aa924fac21fd6f
2022-01-25 08:33:00 +00:00
Treehugger Robot
25d96f8d4d Merge "Have BatteryStatsImpl use the public NetworkStats API" 2022-01-25 07:58:21 +00:00
Chalard Jean
bda5db8cb8 Have BatteryStatsImpl use the public NetworkStats API
Test: BatteryStatsManagerTest
Change-Id: I0bfb4df45e373aa3907b07a382ba8edd07c73895
Merged-In: I0bfb4df45e373aa3907b07a382ba8edd07c73895
2022-01-25 06:39:29 +00:00
Junyu Lai
0c8b1eed04 Merge "[MS61] Remove NetworkManagementSocketTagger#install dependency" am: 513d8dd2ac am: c756efe7bd am: 211ee3e066
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952099

Change-Id: Ia76d1cf3d75f1189be719a9ded3d107ce1fd8221
2022-01-25 01:36:05 +00:00
Junyu Lai
211ee3e066 Merge "[MS61] Remove NetworkManagementSocketTagger#install dependency" am: 513d8dd2ac am: c756efe7bd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1952099

Change-Id: I6f031219bcd375b0ac4ec0819ae3c8341819f555
2022-01-25 01:24:35 +00:00
Junyu Lai
513d8dd2ac Merge "[MS61] Remove NetworkManagementSocketTagger#install dependency" 2022-01-25 00:48:23 +00:00
Siim Sammul
4e38ab22c6 Merge "Move binder latency data logging to a background thread to improve performance of the main thread." am: 3af0c6a106 am: b24b15c6f9 am: 1f0a6f7d4e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1942954

Change-Id: I047b1a6e06a35e4f8fdd7be363e30c59982e0cee
2022-01-24 14:22:12 +00:00
Siim Sammul
1f0a6f7d4e Merge "Move binder latency data logging to a background thread to improve performance of the main thread." am: 3af0c6a106 am: b24b15c6f9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1942954

Change-Id: I3fd253bc0e023a3aa05222ef8c7105f26b6f95fe
2022-01-24 14:11:30 +00:00
Siim Sammul
3af0c6a106 Merge "Move binder latency data logging to a background thread to improve performance of the main thread." 2022-01-24 13:40:33 +00:00
Dmitri Plotnikov
d012a49df3 Merge "Include saved battery history chunks into BatteryUsageStats parcel" am: 2f7508a404 am: 587f8cec3d am: 4c21515da7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1928178

Change-Id: I283453f3391287e7c2d672db178acbdd57fe715f
2022-01-22 07:10:25 +00:00
Dmitri Plotnikov
4c21515da7 Merge "Include saved battery history chunks into BatteryUsageStats parcel" am: 2f7508a404 am: 587f8cec3d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1928178

Change-Id: I3f3d98d9e44f2807c5558127f84838f40c612297
2022-01-22 06:52:51 +00:00