Commit Graph

17228 Commits

Author SHA1 Message Date
Eric Biggers
77d147be49 Stop trying to get/set fields in FDE footer
Now that FDE is no longer supported, getting/setting FDE fields is
always a no-op, so there is no need to do so.

Bug: 208476087
Change-Id: Iab7ba8d36890daa0645b2cedf33e4bd177a86b63
(cherry picked from commit c6ce767e59)
Merged-In: Iab7ba8d36890daa0645b2cedf33e4bd177a86b63
2022-03-09 05:11:09 +00:00
Chiachang Wang
b8cda9d7e0 Merge "Set local routes exclusion in the networkAgent" am: 4734b5810b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1978095

Change-Id: I03eaf7cf1ffc7237f267a85d2d1a25d93afe3896
2022-03-07 07:46:21 +00:00
Chiachang Wang
4734b5810b Merge "Set local routes exclusion in the networkAgent" 2022-03-07 07:25:52 +00:00
Chiachang Wang
68e528d468 Set local routes exclusion in the networkAgent
Add a field in the VpnConfig to store local route exclusion
bit from VpnProfile, and set the value into the networkAgent
of VPN network.

Bug: 184750836
Test: atest FrameworksNetTests HostsideVpnTests
Change-Id: I22b9a5990a3dab0418b44ec19d2996ead6529231
2022-03-07 04:26:52 +00:00
Andrei-Valentin Onea
8ceedbd375 Merge changes from topic "ignore-vendor-apex-allowlists" am: a22612eb94
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926339

Change-Id: Ia43268fea619a0af6a39aef79cc52ed67e92ee99
2022-03-01 15:51:43 +00:00
Rhed Jao
e7be86fd15 Ignore prebuilt shared library if it doesn't exist on device am: 791eb6934d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926342

Change-Id: I63155e278047882b33af00e349d2a7a32099655c
2022-03-01 15:51:38 +00:00
Pedro Loureiro
be595a1cb7 Rename updatable-library to apex-library am: 1df9a1e8f5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1954037

Change-Id: I559fecd56edbc4fcf1047bb8ab9ec029e515e17f
2022-03-01 15:51:31 +00:00
Pedro Loureiro
7936aaf92e Parse new xml attributes used for updatable shared libraries am: 5c228ca3e9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926341

Change-Id: I2255f2357f4786cb8931e83cb007a2818a3ba720
2022-03-01 15:51:26 +00:00
Alex Buynytskyy
1adacbf9d7 Create XML parser only once. am: 66fc1f1941
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1926340

Change-Id: I83e8a593a251300aee1fa8d6d9002d22eabf6fc8
2022-03-01 15:51:14 +00:00
Andrei-Valentin Onea
a22612eb94 Merge changes from topic "ignore-vendor-apex-allowlists"
* changes:
  Ignore vendor apex priv-app permission allowlists
  Add test for parsing apex allowlists
  Ignore prebuilt shared library if it doesn't exist on device
  Rename updatable-library to apex-library
  Parse new xml attributes used for updatable shared libraries
  Create XML parser only once.
2022-03-01 15:15:56 +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
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
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
f584f880ab Merge "Add system_server to net_admin group" 2022-02-09 09:42:29 +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
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
81568fa22f Merge "Delete legacy fs-verity support" 2022-02-08 00:48:19 +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
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
513d8dd2ac Merge "[MS61] Remove NetworkManagementSocketTagger#install dependency" 2022-01-25 00:48:23 +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
Junyu Lai
5262c0eb82 [MS61] Remove NetworkManagementSocketTagger#install dependency
Expose TrafficStats#attachSocketTagger and use it instead.

Test: atest TrafficStatsTest
Bug: 204830222
CTS-Coverage-Bug: 214979748
Change-Id: I1748d349b499053ad08bd62202325fa759ad8da5
2022-01-22 13:51:55 +08:00
Dmitri Plotnikov
c4b9de7d95 Include saved battery history chunks into BatteryUsageStats parcel
Bug: 209297031
Test: Test: atest FrameworksCoreTests:BatteryUsageStatsTest FrameworksCoreTests:BatteryUsageStatsProviderTest
Merged-In: I369d863b6f6fd488030aa031cc465bef6ce99ab8
Change-Id: Ifc70a49b731b5510e7bcd049e0c12d9ac7f68f44
2022-01-21 22:44:46 +00:00
Dmitri Plotnikov
587eef25c9 Merge "Fix concurrency issue with BatteryUsageStats" 2022-01-21 22:44:28 +00:00
Phil Burk
f5bf153f13 Merge "Include MIDI service OWNERS for internal/midi" 2022-01-21 14:58:34 +00:00
Siim Sammul
42e84a4cc4 Move binder latency data logging to a background thread to improve performance of the main thread.
Bug: 213435093
Test: existing tests apply
Change-Id: Ic7a3a413d8e23c0405b4dd16f0b8c919a214eb32
2022-01-21 11:30:26 +00:00
Frank Li
a078c73c47 Merge "[DU07]Remove BatteryStatsImpl NetworkStats.subtract dependences" 2022-01-21 09:19:34 +00:00
lifr
20689682e5 [DU03-1]Remove INetworkStatsService from BatteryStatsImpl
Expose systemapi NetworkStats.getDetailedUidStats for use by
BatteryStats.

BatteryStatsImpl is using INetworkStatsService APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.

Bug: 210066922
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
            MobileRadioPowerCalculatorTest NetworkStatsServiceTest
CTS-Coverage-Bug: 213437796
Change-Id: I40d713923278f4654d67bb4d12155cea85c10447
2022-01-21 13:52:41 +08:00
Phil Burk
a4cc251eb8 Include MIDI service OWNERS for internal/midi
Change-Id: Icabeeab73b3106e87041a0a9149560ad691640f4
2022-01-20 23:34:39 +00:00
Dmitri Plotnikov
0856f76846 Fix concurrency issue with BatteryUsageStats
BatteryUsageStats is created under a BatteryStatsImpl lock.  One of
the elements of BatteryUsageStats is the battery history buffer Parcel.
Once the BatteryUsageStats object is created, the BatteryStatsImpl lock
is released and the history buffer parcel continues to be appended
by BatteryStatsImpl.  The Parcel may even be reset altogether if the
battery stats session is reset.  The BatteryUsageStats object is parceled
during the getBatteryUsageStats binder call. Any modification of the
history buffer concurrent with parceling causes a crash.

Bug: 194256984
Test: atest FrameworksCoreTests:BatteryUsageStatsTest FrameworksCoreTests:BatteryUsageStatsProviderTest
Change-Id: I262c4608cd02943f926e8daaf3e782c6fe6eaee7
Merged-In: Ifb03a32275dfbea172cd28309a42349d6dd4bcd5
2022-01-20 23:04:22 +00:00
Frank
77fb00ddde [DU07]Remove BatteryStatsImpl NetworkStats.subtract dependences
BatteryStatsImpl is using INetworkStatsService APIs, which
cannot be accessed after moving into the mainline module. So, replace
and remove those hidden API usages.

Bug: 213523117
Test: atest BatteryStatsImplTest WifiPowerCalculatorTest
            MobileRadioPowerCalculatorTest
Change-Id: I9e8d94259ad9845d94bfd78d971ff1a2cd7bb38e
2022-01-20 20:08:19 +08:00
Mill Chen
7f4b8b1784 Enable nested scrolling for locale picker
This change is to make the locale picker list enable the nested
scrolling feature. It is necessay to enable this feature to be able to
work with CollapsingToolbarLayout.

Fixes: 207318265
Fixes: 213036789
Test: manual test
1. Verify the locale picker works with Activity
2. Verify the locale picker works with SettingsBaseActivity

Change-Id: Iaf90211da640cd265fc2b23dd34b3149c4406891
(cherry picked from commit fa861a6b5d)
Merged-In:Iaf90211da640cd265fc2b23dd34b3149c4406891
2022-01-20 00:46:32 +00:00
Rhed Jao
791eb6934d Ignore prebuilt shared library if it doesn't exist on device
Bug: 191232777
Test: atest PackageManagerTest
Test: atest SystemConfigTest
Change-Id: I756e2c909af6ad0dcf8f1857ba398cfe07862b29
Merged-In: I756e2c909af6ad0dcf8f1857ba398cfe07862b29
2022-01-19 13:11:32 +00:00
Andrei Onea
64a27bd856 Ignore vendor apex priv-app permission allowlists
Apexes contain the allowlists for privileged permissions used by their
respective apk's, however vendor (partner) apexes should be forbidden from
using this mechanism.

Test: atest FrameworksServicesTests:SystemConfigTest
Bug: 190375768
Change-Id: I34bf2a80fb66f2b2a732234111a338e3af1e919b
2022-01-19 13:11:32 +00:00
Andrei Onea
5765fa9fb8 Add test for parsing apex allowlists
Test: atest FrameworksServicesTests:SystemConfigTest
Bug: 190375768
Change-Id: Ia530a7b5b62774660c410ca8a9f49b18ff9b9b57
2022-01-19 13:11:32 +00:00
Pedro Loureiro
1df9a1e8f5 Rename updatable-library to apex-library
Mostly for consistency with the names used in related changes.

Test: atest com.android.server.pm.parsing.library.ApexSharedLibraryUpdaterTest com.android.server.systemconfig.SystemConfigTest

Bug: 191978330
Change-Id: Ic4ccc0fdca100b576e28bc0918d378cabae9ce61
Merged-In: Ic4ccc0fdca100b576e28bc0918d378cabae9ce61
2022-01-19 13:11:13 +00:00
Pedro Loureiro
5c228ca3e9 Parse new xml attributes used for updatable shared libraries
Attributes added to the `library` tag used in AndroidManifest.xml.
They allow to easily and transparently include/exclude a library from
apps for compatibility purposes.

Bug: 191978330
Test: atest com.android.server.pm.parsing.library.ApexSharedLibraryUpdaterTest com.android.server.systemconfig.SystemConfigTest
Change-Id: Ibdde742a05fd670a9aaee5ee77ae25b9c0801f53
Merged-In: Ibdde742a05fd670a9aaee5ee77ae25b9c0801f53
2022-01-19 11:59:35 +00:00
Alex Buynytskyy
66fc1f1941 Create XML parser only once.
This greatly cuts memory usage: 2.5M -> 0.5M (see bug for traces).

Bug: 200995209
Test: atest SystemConfigTest SystemConfigNamedActorTest
Change-Id: I0b76dc2610afaad3e418ef3115c5e54a05ab334e
Merged-In: I0b76dc2610afaad3e418ef3115c5e54a05ab334e
2022-01-19 11:59:34 +00:00