Commit Graph

16652 Commits

Author SHA1 Message Date
Junyu Lai
57c59fba4c [MS24] Remove FileUtils.sync dependencies
FileRotator will be built with Connectivity mainline module
while the file location will be kept inside platform.
Thus, hidden api usage needs to be addressed.

This change removes some dependencies by inlining the content
of FileUtils.sync to remove the dependency, and change the
Slog to Log.

Test: TH
Bug: 204830222
Change-Id: I6105850dd8311072fd8de2e2864d11fdb052f061
2022-01-19 07:07:34 +00:00
Treehugger Robot
296fbccd6e Merge "[DU03]Remove INetworkStatsService from BatteryStatsImpl" 2022-01-12 19:33:52 +00:00
Taras Antoshchuk
bc8f256721 Merge "Revert "Revert "Revert "Revert "Add APIs that allow to exclude r..."" 2022-01-12 15:27:30 +00:00
lifr
ca904a8ea8 [DU03]Remove INetworkStatsService from BatteryStatsImpl
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
CTS-Coverage-Bug: 213437796

  (cherry-picked from ag/16548638)

Change-Id: I584897ff8ba303c717a9df3756c9f6778c1cfb10
Merged-In: I584897ff8ba303c717a9df3756c9f6778c1cfb10
2022-01-12 07:28:55 +00:00
Artur Satayev
c89ed260a2 Add PACKAGE_MANAGER_OWNERS as owners of SystemConfig.java
Merged-In: Iabd1ee367d8234425c5770455a20a413cc37c6a7
Change-Id: Iabd1ee367d8234425c5770455a20a413cc37c6a7
2022-01-10 18:23:21 +00:00
Taras Antoshchuk
fe5a57e8c4 Revert "Revert "Revert "Revert "Add APIs that allow to exclude r..."
Revert "Revert "Revert "Revert "Add VpnServiceBuilderShim for Vp..."

Revert submission 1941195-revert-1931760-reland-vpn-impl-part-2-WGARECSJEM

Reason for revert: fixed merge conflict with aosp/1938197
Reverted Changes:
Ic25e5e4ea:Revert^2 "Revert "Add CTS tests for exclude VPN ro...
Ic72cafcf5:Revert "Revert "Revert "Add APIs that allow to exc...
I53802190a:Revert "Revert "Revert "Add VpnServiceBuilderShim ...

Change-Id: Id3e5f698cf8965fa8386a98bed1fd0170a9e0344
2022-01-10 10:20:29 +00:00
Matt Buckley
f7a327e8d5 Merge "Revert "Revert "Revert "Add APIs that allow to exclude routes fr..."" 2022-01-07 17:48:45 +00:00
Matt Buckley
7153b105e7 Revert "Revert "Revert "Add APIs that allow to exclude routes fr..."
Revert "Revert "Revert "Add VpnServiceBuilderShim for VpnService..."

Revert submission 1931760-reland-vpn-impl-part-2

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=test_suites_x86_64&lkgb=8053795&lkbb=8053908&fkbb=8053828, bug b/213588956.
BUG: b/213588956
Reverted Changes:
Ic8ed8fce7:Revert "Revert "Add CTS tests for exclude VPN rout...
I07104340a:Revert "Revert "Add VpnServiceBuilderShim for VpnS...
I7c69b7244:Revert "Revert "Add APIs that allow to exclude rou...

Change-Id: Ic72cafcf5c7e2c62236f1cef61b0764882bacaad
2022-01-07 17:44:52 +00:00
Taras Antoshchuk
f4177e94ee Merge "Revert "Revert "Add APIs that allow to exclude routes from VPN""" 2022-01-07 16:27:12 +00:00
Junyu Lai
b7d0199763 [MS22] Move NetworkManagementSocketTagger into the module
This is heavily used by TrafficStats, and no other modules
are using it. Hence it should be moved to the module as well.

Test: TH
Bug: 204830222

Change-Id: I7ea1ccb916e796c786c29d53e4ecf3970a8af6dd
2022-01-07 09:57:15 +00:00
Taras Antoshchuk
5b1d7c2ead Revert "Revert "Add APIs that allow to exclude routes from VPN""
This reverts commit 487b2e645a.

Reason for revert: failing build target configuration is fixed

Change-Id: I7c69b7244b4262336e427e4c671aaebb70ddc6ed
2022-01-06 14:49:02 +00:00
Junyu Lai
0cf9e87c79 [MS27] Expose noteUntaggedSocket SystemApi
While Data usage related codes are moving to mainline module,
StrictMode#vmUntaggedSocketEnabled() and onUntaggedSocket()
can no longer be accessed from NetworkManagementSocketTagger.

Thus, expose alternative SystemApi to allow invocations from
the module.

Test: TH
Bug: 204830222
Exempt-From-Owner-Approval: 1. Owner approved the change with
  explicitly granted submission after adderessing the
  straight-forward comment. 2. Owner is OOO for 3 months.
Change-Id: Ib54ff54ce3617ae0d04080a1740e78b086bbb039
2022-01-06 08:49:46 +00:00
Chiachang Wang
de8c621832 Add configuration whether to exclude local traffic in the VPN
Add a extra variable to store whether the local traffic is
exempted from the VPN.

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: I70301901c2374ded9fdf179d0ce64e7bb2d7b1ab
2021-12-28 11:14:01 +08:00
Junyu Lai
6ff6240694 Merge "[MS10.1] Move multiplySafeByRational to NetworkStatsUtils" 2021-12-21 01:22:14 +00:00
Junyu Lai
b241707f03 [MS10.1] Move multiplySafeByRational to NetworkStatsUtils
Since NetworkStats related code will be moved to the module.
multiplySafeByRational in the NetworkUtilsInternal cannot be
accessed after that. Thus, create another utils class that
will be moved with NetworkStats code and put the function
into it.

Test: atest NetworkStaticLibTests:com.android.net.moduletests.util.NetworkStatsUtilsTest
Bug: 204830222
Change-Id: I96f3ac02e57b7325ed53988285770f478dee529e
2021-12-20 09:12:13 +00:00
Hunter Knepshield
d54e1126ab Merge "Create CarrierPrivilegesListener callback." 2021-12-16 19:00:24 +00:00
Ayush Sharma
da37e0f471 Merge "Revert "Add APIs that allow to exclude routes from VPN"" 2021-12-16 15:01:30 +00:00
Ayush Sharma
487b2e645a Revert "Add APIs that allow to exclude routes from VPN"
Revert "Suppress NewApi warnings for @SystemApi -> public APIs"

Revert "Add VpnServiceBuilderShim for VpnService.Builder"

Revert submission 1551943-vpn-impl

Reason for revert: <DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=mainline_modules_x86_64-userdebug&lkgb=8007224&lkbb=8008168&fkbb=8007902 >, bug b/210979001
Reverted Changes:
I0e7aa077a:Add VpnServiceBuilderShim for VpnService.Builder
Ib12f5ab39:Suppress NewApi warnings for @SystemApi -> public ...
I59b9185cf:Unhide RouteInfo#getType and related fields
Ie5b62b2b2:Unhide IpPrefix(InetAddress, int)
I993a32d40:Add CTS tests for exclude VPN routes APIs
Ib24b2d3fb:Suppress NewApi warnings for @SystemApi -> public ...
Ic3b10464a:Add APIs that allow to exclude routes from VPN

Change-Id: I89209357ab4bb206d206adcf9fd6d3498ce6ef4c
BUG: 210979001
2021-12-16 14:40:13 +00:00
Taras Antoshchuk
55f030225b Merge "Add APIs that allow to exclude routes from VPN" 2021-12-16 11:13:33 +00:00
Rambo Wang
241b1fa964 Support CarrierService#notifyCarrierNetworkChange with subscription
Current APIs does not include subId or phoneId to locate which
carrier network reported the change. A patch based on carrier
privilege were deployed in Q to temprarily fix the issue.

However, multiple subscriptions which all have the carrier
privileges will all get notified, even only one of them
has the real change.

To throughly resolve the issue, the subscription is introduced
in the API to distinguish which network actually has the change.

Bug: 131697791
Test: atest TelephonyRegistryManagerTest CarrierServiceTest
Change-Id: Ie7ee25f53da605c15e1a9228482cc8c4e7406d2a
2021-12-15 17:35:52 +00:00
Treehugger Robot
e908851af5 Merge "Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value" 2021-12-15 17:00:15 +00:00
Treehugger Robot
373b687d96 Merge "Allow renounce location permission" 2021-12-15 00:35:20 +00:00
Yohei Yukawa
1fdc14b8a9 Fix an off-by-one bug in EditableInputConnection#endBatchEdit() return value
This is a follow up CL to our previous CL [1], which had an off-by-one
bug when determining the return value of

   EditableInputConnection#endBatchEdit().

According to the API document of InputConnection#endBatchEdit(), the
following test should pass.

   EditText editText = new EditText(context);
   EditorInfo editorInfo = new EditorInfo();
   InputConnection editableInputConnection =
           editText.onCreateInputConnection(editorInfo);
   assertThat(editableInputConnection.beginBatchEdit()).isTrue();
   assertThat(editableInputConnection.beginBatchEdit()).isTrue();
   assertThat(editableInputConnection.endBatchEdit()).isTrue();
   assertThat(editableInputConnection.endBatchEdit()).isFalse(); // (*)
   assertThat(editableInputConnection.endBatchEdit()).isFalse();

However, the last assertion marked with (*) actually fails due to an
off-by-one bug.  This CL finally fixes it.

The risk of app compat breakages because of fixing this long standing
bug is supposed to be low, mainly because:

 * the system has not relied on this return value yet.
 * Widgets like WebView have correctly implemented this API.
 * IME has always received true no matter what the app returned, which
   is the same behavior as other async InputConnection APIs.

This CL adds several notes to InputConnection#endBatchEdit() document
to help developers correctly implement and use this API.

 [1]: I1ec5518fdc16fb0551fbce9d13f5d92eb4bc78c0
      c478c171e9

Fix: 209958658
Fix: 210165648
Test: atest -c CtsInputMethodTestCases:EditTextImeSupportTest
Change-Id: Ibc40072fa11a4d6e3c24b8d7860c914ccdbcbc8a
Merged-In: Ibc40072fa11a4d6e3c24b8d7860c914ccdbcbc8a
(cherry picked from commit beda2b7f76)
2021-12-14 15:15:54 -08:00
Sooraj Sasindran
5d02dbb7bf Allow renounce location permission
Allow renounce location permission

Bug: 198533763
Test: CTS
Merged-In: I10872f34603441da2cf80f1f2976f3f3ca0ff6c2
Change-Id: I10872f34603441da2cf80f1f2976f3f3ca0ff6c2
2021-12-14 13:25:04 -08:00
Xin Li
85d715bac3 Merge "Merge Android 12 QPR1" 2021-12-14 20:25:23 +00:00
Kalesh Singh
3f73570646 Merge "Add system_server to readtracefs group" 2021-12-14 19:37:02 +00:00
Taras Antoshchuk
59073f0652 Add APIs that allow to exclude routes from VPN
Add new methods to VpnService.Builder that allow to specify network
routes that should bypass the VPN. Implemented by using RTN_THROW
routes.

Bug: 186082280
Test: atest HostsideVpnTests
Test: atest VpnServiceBuilderTest
Change-Id: Ic3b10464a53a8b56334589acec8f27acdc180ff7
2021-12-13 11:11:00 +01:00
Hunter Knepshield
866d3a4d03 Create CarrierPrivilegesListener callback.
This callback will allow privileged components to listen to changes
around carrier privileged apps in a way that is aware and accounts for
SIM profile switches. This callback will be backed by
CarrierPrivilegesTracker as a follow-up change.

Bug: 205736323
Test: atest android.telephony.cts.TelephonyRegistryManagerTest
Change-Id: I432ed00be16c68303bf5c8e074fb9d6cf83e82c9
2021-12-08 15:53:33 -08:00
Jiakai Zhang
16895824d0 Merge "Prefetch standalone system server jars before switching domain." am: 04b45b74a1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1909973

Change-Id: I1c66a904c3688717853ce34a2952d976960b21a7
2021-12-08 22:56:25 +00:00
Jiakai Zhang
405fb6dee9 Prefetch standalone system server jars before switching domain.
In b/203198541, we start to compile standalone system server jars, but
the SELinux policy doesn't allow system_server to load the compiled code
at runtime. As a solution, this change creates class loaders for
standalone system server jars and caches them before switching to the
"system_server" SELinux domain, which essentially loads the jars and
compiled code into the memory.

Bug: 203198541
Test: manual -
  1. Patch aosp/1874113, aosp/1876173, aosp/1906158 (in order to have
     odrefresh compile a standalone system server jar).
  2. Build a system image and flash it to a device.
  3. Run "adb shell cat /proc/`adb shell pidof system_server`/maps" and
     see "apex@com.android.wifi@javalib@service-wifi.jar@classes.odex"
     being mmap'ed.
  4. Run "adb logcat | grep avc" and see no denial.
  5. atest odsign_e2e_tests

Change-Id: I27fbdaadae2b6f50989b4c534f7fbc80044a6685
Merged-In: I365be766cfb77c6e240d5871f1b3d8ed7abae6f5
(cherry picked from commit 281a2dfaa1)
2021-12-08 09:47:38 +00:00
Kalesh Singh
57bbd0099e Add system_server to readtracefs group
This allows system_server to search/read tracefs entries. It is needed
for attaching cpu timeinstate bpf programs to tracepoints.

Bug: 208892266
Bug: 209513178
Test: libtimeinstate_test
Change-Id: I4139605eb7c5277887092b3d6a3fb26bf4f8f171
2021-12-07 23:48:08 +00:00
Andrei-Valentin Onea
1c565d5b4b Merge "Allow privapp permission allowlist in apex" am: e978ec5b07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1766011

Change-Id: I3bb67e833b6c167ba24b974abcce9cde75317a89
2021-12-07 15:46:06 +00:00
Andrei Onea
95ecac506d Allow privapp permission allowlist in apex
Read priv-app permission allowlists from APEX file and warn if
they're in the /system partition instead.

Test: boots
Bug: 190375768
Change-Id: I37d6deb60f0dffb75dd634075cd95bcf7ddf9684
Merged-In: I37d6deb60f0dffb75dd634075cd95bcf7ddf9684
2021-12-03 18:19:00 +00:00
Treehugger Robot
9078248b75 Merge "Fix an issue when empty the usap pool." am: faf1b1cf0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1893002

Change-Id: I6d5e04471f756ee5544bb1f77cf1927f44d7715a
2021-11-29 08:00:57 +00:00
Treehugger Robot
faf1b1cf0b Merge "Fix an issue when empty the usap pool." 2021-11-29 07:46:36 +00:00
zhangjianqiu
1bc2b9c612 Fix an issue when empty the usap pool.
When empty the usap pool, the usap processes may be blocked by
usapPoolSocket.accept(), which cause the usap process fail to kill
immediately. So we can move the position of blockSigTerm after
usapPoolsSocket.accept() and delele the old blockSigTerm in the while
loop.

Test: manual test.
1.setprop persist.device_config.runtime_native.usap_pool_enabled true.
After 1 min, trigger fill usap pools.
2.setprop persist.device_config.runtime_native.usap_pool_enabled false.
After 1 min, trigger empty usap pools.
3.repeat step 1.

Signed-off-by: zhangjianqiu <zhangjianqiu@oppo.com>
Change-Id: I657940b30f71cdc717c673be6d70738e61e2bb68
2021-11-24 09:48:01 +08:00
Treehugger Robot
1f479b99ce Merge "Framework and system_server classes can access public vendor libraries" am: 8cb6d28329
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1885792

Change-Id: Ia8fe285e3668fac4c2d6ca8ffff2976df88f90c3
2021-11-19 00:29:06 +00:00
Treehugger Robot
8cb6d28329 Merge "Framework and system_server classes can access public vendor libraries" 2021-11-19 00:08:57 +00:00
Xin Li
10d9972786 Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918
Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
2021-11-18 17:00:37 +00:00
Jiyong Park
24c57c33ea Framework and system_server classes can access public vendor libraries
This CL fixes a regression caused by [1] which introduced
<uses-native-library> tag [2]. With the change, public vendor libraries
[3] became accessible only when they are listed in the caller's
AndroidManifest.xml using the new tag. However, this caused a problem to
the places where AndroidManifest.xml doesn't exist: framework and
system_server classes. For those cases, [1] incorrectly used a null list
as the requested native libraries, and as a result, no public vendor
libraries were accessible.

This CL fixes the issue by not doing the filtering for the class loaders
created for non-app contexts like zygote or system_server. Specifically,
it uses the magic keyword "ALL" which let libnativeloader.so
accept all public vendor libraries.

[1] 6a5b8b1f6d
[2] https://developer.android.com/guide/topics/manifest/uses-native-library-element
[3] https://source.android.com/devices/tech/config/namespaces_libraries#adding-additional-native-libraries

Bug: 205164833
Test: libcuttlefish_fs.so is loaded when built with the other CLs in the
same topic

Change-Id: Id92c59642773851d70d05a05f43eb5873e9de86b
2021-11-18 23:09:27 +09:00
Maciej Żenczykowski
7069443319 switch to using OWNERS from master branch of Connectivity module
Test: N/A
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifa4a38522ac3aa830e2a7f8b23ad190a334458bc
2021-11-17 00:37:40 -08:00
Treehugger Robot
b2f814064e Merge "Fix typo in BaseIWindow.java owners file" 2021-11-16 17:57:38 +00:00
Vishnu Nair
8cd9256c50 Fix typo in BaseIWindow.java owners file
Change-Id: I7ea7fb4a9fc16aa007e4a6970d550f906da202f7
2021-11-15 23:38:05 +00:00
Maciej Żenczykowski
cb6164c141 remove PROP_QTAGUID_ENABLED
Remaining hits:
  $ repo grep 'net.qtaguid_enabled|PROP_QTAGUID_ENABLED' | egrep -v '^external/cpuinfo/test/mock/'
  art/Binary file tools/ahat/etc/L.hprof matches
  cts/Binary file tools/release-parser/tests/resources/boot-framework.art matches
  external/cpuinfo/test/dmesg/oppo-r9.log:2212:<14>[   12.785966] (6)[1:init]init: [PropSet]: pid:887 uid:1000 gid:1000 set net.qtaguid_enabled=1
  prebuilts/runtime/appcompat/hiddenapi-flags.csv:412141:Lcom/android/server/NetworkManagementSocketTagger;->PROP_QTAGUID_ENABLED:Ljava/lang/String;,blocked

Bug: 161325508
Test: atest, TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Ifa30a7549396312a970fc07c37e8fa8ed85abec0
2021-11-10 15:52:30 -08:00
satayev
73c5df816c Update compat owners.
Bug: N/A
Test: N/A
Change-Id: I548b7310c7b77fbcdf3c6f7d85bde8d0129cf460
2021-11-10 15:35:30 +00:00
kwekua
5aacac2a71 Create dedicated long variables.
Bug: 194532703
Bug: 204459169
Change-Id: Ic4c57d3797b19869e5c9151ccb183543ba5f6df0
2021-10-28 19:33:25 +00:00
Brad Stenning
89dfd0902e Allow a shared library to be positioned after the application on the classpath
This is useful if/when it's desired that an application contains the same
fully qualified class name that's also in the library.

The shared libraries that are treated in this manor are controlled by the resource
com.android.internal.R.config_shared_libraries_loaded_after_app

Bug: 179429740

Test: atest SharedLibraryLoadingTests

Change-Id: Ia37ff9bd545918d1e0f1f38548dcd86f177559d5
2021-10-27 10:06:16 -07:00
Daniel Norman
653a1c1a28 Fix RRO loading from inside APEXes.
APEXes can already contain RRO APKs by using the 'rro' apex Soong
module field. However, these RROs were not being loaded properly by
Zygote or PackageManagerService.

For all RROs inside APEXes, the RRO uses the same overlay config that
is used for other RROs on the APEX's preinstalled partition.

For RROs targeting 'android', which are installed by Zygote
using AssetManager:
1. OverlayConfig looks for active APEXes in the apex-info-list file,
   which is already accessible to Zygote.
2. OverlayConfig passes the APEX module names to OverlayConfigParser,
   for each preinstalled-partition.
3. OverlayConfigParser uses OverlayScanner to scan the
   each /apex/<APEX>/overlay directory.

For other RROs:
1. PackageManagerService already parses and provides RROs inside APEXes
   to OverlayConfig.
2. RROs inside APEXes used to have no config rule applied because their
   path prefix (/apex/) did not match any partition rule. Now, their
   preinstalled path is used instead.

Bug: 199200417
Test: Define a static RRO targeting 'android' inside a /vendor APEX.
      Define a static RRO for settings provider inside a /vendor APEX.
      Observe APEXes are enabled by default.
Test: Make a change to an RRO inside a /vendor APEX.
      m <apex>; adb install <apex artifact>; adb reboot;
      Observe change has taken effect.
Change-Id: I2bce9bc704789329b8c6aac6d476f17ff6718e0f
Merged-In: I2bce9bc704789329b8c6aac6d476f17ff6718e0f
2021-10-25 13:04:24 -07:00
Etienne Ruffieux
d372361fe3 Adding @SystemApi annotation to Bluetooth energy stats.
Added @SystemApi annotation to BluetoothActivityEnergyInfo
and UidTraffic getters for mainline compatibility. Replaced
raw array by List. Deleted unused constructors.

Tag: #feature
Bug: 200201373
Test: Manual
Change-Id: Id93215f48bf08d31ac269af9e064cf598f50b6d3
2021-10-21 20:39:31 +00:00
TreeHugger Robot
bfe149f2ed Merge "Zero out WiFi duration and power if ControllerActivityCounter is null" into sc-qpr1-dev am: c410f29893
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15934611

Change-Id: Iee9dbf00b4568400c319a348587018bfa3e6fb77
2021-09-29 00:43:25 +00:00