Commit Graph

651 Commits

Author SHA1 Message Date
Lorenzo Colitti
48a67aa5e8 Merge "Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"" am: 32141be3dd am: 99c7e943ca am: bb7214697a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1564979

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Id8e99aeefffddf88240cf5f1d7117e022242708f
2021-02-01 17:12:33 +00:00
Lorenzo Colitti
32141be3dd Merge "Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"" 2021-02-01 15:33:11 +00:00
Remi NGUYEN VAN
6e69f1704c resolve merge conflicts of 80f288a715 to sc-dev
Bug: None, merge conflict
Change-Id: Id07440d6a55111a1a7ddbf3df306f4466073fd1d
2021-02-01 11:29:28 +00:00
Lorenzo Colitti
388f41621f Revert "Expose IPsec tunnel APIs from @SystemApi to public APIs"
This reverts commit 160aac3fa0.

Reason for revert: not necessary, since VCN already has access to system APIs

Bug: 174606949
Test: revert with no conflicts
Change-Id: Ife2d0fc08c540265d52cdf930d0b6df005990ac8
2021-02-01 08:13:32 +00:00
Remi NGUYEN VAN
b71fc45e17 Move module sources to packages/Connectivity
Files that are planned to be part of the connectivity module are grouped
in packages/Connectivity, so they can be built separately and moved in
one operation with their history into packages/modules/Connectivity.

This places the files in the existing framework-connectivity-sources
filegroup instead of the current framework-core-sources filegroup. Both
are used the same way in framework-non-updatable-sources.

Bug: 171540887
Test: m
Change-Id: I62d9d91574ace6f5c4624035d190260c3126b91e
2021-02-01 11:52:14 +09:00
Junyu Lai
5905a23e64 Merge "[FUI04] Refactor VpnInfo" am: 561626b20d am: a109d80a47 am: f9445c8a07
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1537211

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icfa9918e41fc3f952a23956108df4db449741364
2021-01-29 23:38:06 +00:00
junyulai
0592b920cb [FUI04] Refactor VpnInfo
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
  1. Change raw arrays into lists according to API guidelines.
  2. Write test.
  3. Rename class to UnderlyingNetworkInfo.
  4. Rename vpnIface to iface.
  5. Make underlyingIfaces @NonNull in order to adapt new
     unparceling code.
  6. implement equals and hashCode for testing.

Test: atest android.net.UnderlyingNetworkInfoTest
Bug: 174123988

Change-Id: I405c21e57c4af8a12a9dd0a1749b9e6690f87045
2021-01-29 17:44:32 +08:00
Treehugger Robot
a3eaf95b98 Merge "[FUI03] No-op refactoring of VpnInfo" am: f9dbe61693 am: 9a9c17579a am: 9f37e0e929
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547637

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I05e6b14fca44919610317831c147413b0a431224
2021-01-27 14:16:00 +00:00
Chiachang Wang
64dc55bfb8 Merge "Expose UdpEncapsulationSocket.getResourceId()" am: 8dc248c84a am: 569e241d5c am: 9ee71fd652
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1547642

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I67420def56b12c3008daaa001b8f09680439d940
2021-01-27 08:05:05 +00:00
Treehugger Robot
93f61ef742 Merge changes I713bc2ec,Ib9ab07c9 am: 6fe4b878e5 am: db887739f9 am: 1ec09a7e48
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1537264

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4b291a4e82b89d3808e9bcd980d5b2aa4d2b1b71
2021-01-27 07:53:30 +00:00
Yan Yan
9d5f64d15f Merge "Expose IPsec tunnel APIs from @SystemApi to public APIs" am: 5b8a0c8d89 am: a1c981966e am: db45d09925
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1517517

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie6f17fde71e1c7ca36e88e554874939cfc9e78ab
2021-01-27 07:51:43 +00:00
junyulai
67c69ad73f [FUI03] No-op refactoring of VpnInfo
As a preparation of exposing system API. This patch does some
harmless refactoring, which includes:
  1. Move VpnInfo to android.net
  2. Add nullability annotations
  3. Make members final

Bug: 174123988
Test: TH
Change-Id: I1530bb45d0e84c28c6deac33596bc686058afc0d
2021-01-27 15:03:06 +08:00
Chiachang Wang
a034331a56 Expose UdpEncapsulationSocket.getResourceId()
ConnectivityManager.createSocketKeepalive() will need to get
the socket resource ID as a parameter for creating a new
NattSocketKeepalive. ConnectivityManager is a part of incoming
ConnectivityService mainline, so expose getResourceId() as an
API since the hidden APIs are not accessible for a mainline
module. This API should not be exposed to apps, so make it a
MODULE_LIBRARIES system API.

Bug: 172183305
Test: make update-api
Change-Id: Ic0722352ea186fcb18a2d91cc3969f771fde9e86
2021-01-27 09:27:26 +08:00
Treehugger Robot
6fe4b878e5 Merge changes I713bc2ec,Ib9ab07c9
* changes:
  [FUI05] Remove wimax data usage unit test
  [FUI14] Get SSID from NetworkCapabilities
2021-01-26 13:13:24 +00:00
junyulai
c44d11ccec [FUI14] Get SSID from NetworkCapabilities
This allows subsequent patches to remove the need of exposing
SSID in NetworkState.

Test: atest NetworkStatsServiceTest
Bug: 174123988
Change-Id: Ib9ab07c9610954c9a5de035a3aefbf6d0bb0b53b
2021-01-22 23:58:14 +08:00
Yan Yan
160aac3fa0 Expose IPsec tunnel APIs from @SystemApi to public APIs
Since IKE APIs to negotiate IPsec tunnel migration (MOBIKE) are
public, all IPsec tunnel APIs should also be public so that public
callers are able to create, manage and migrate IPsec tunnels

Bug: 174606949
Test: atest IpSecManagerTunnelTest
Change-Id: I86aec334cfc937953f9c2b411cc55862032aae4d
2021-01-21 10:45:24 -08:00
Treehugger Robot
526490e269 Merge "Pivot network statistics to use DataInput/Output." am: 5b322f10be am: 84dee682ac am: 62876cef3d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1540224

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I44be7ea64d012f35d312ae3b039b0fd7e37e9d60
2021-01-08 11:49:37 +00:00
Jeff Sharkey
1f69d15939 Pivot network statistics to use DataInput/Output.
Using these generalized interfaces is more flexible, since it enables
us to pivot the implementation being used internally.  In particular,
an upcoming CL will pivot them to use a more efficient alternative.

This is a no-op refactoring.

Bug: 176777285
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Ibd4717174cf1f136e9d5d80172ecb6e493265306
2021-01-06 18:48:12 -07:00
Remi NGUYEN VAN
5c3d004904 Merge "Register ethernet listeners on specific Executors" am: be4248226c am: 9dd482d23b am: cf254d6cb3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513665

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ia74a0b6f967f75841e076bc6b825d7809460adc3
2020-12-28 09:12:36 +00:00
Remi NGUYEN VAN
be4248226c Merge "Register ethernet listeners on specific Executors" 2020-12-28 07:12:45 +00:00
Remi NGUYEN VAN
e3b99f106a Merge "Split NetworkUtils and NetworkUtilsInternal" am: 7adf0e84b8 am: d095d82c85 am: 9c2a2705c7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1513140

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ief9d6a1fae360dbe1c43d5d6bac4dad5850c004b
2020-12-23 02:22:35 +00:00
Remi NGUYEN VAN
55838a8292 Register ethernet listeners on specific Executors
Have users of EthernetManager#addListener specify an Executor instead of
running callbacks on ConnectivityThread.
For existing clients, run callbacks on the common BackgroundThread.

This change in behavior is fine because addListener is not an API, the
threading model in Q was to run callbacks on the looper of the thread
that first created EthernetManager (so there is already no guarantee on
which thread is used), and the only users are in Settings.

ConnectivityThread is moving to a connectivity-specific JAR, so it
should not be used by external classes.

Bug: 174436414
Test: Ethernet client / tethering working
      atest TetheringIntegrationTests
Change-Id: Ic9a959f89915329f79eeeaa0a210ad50811d1291
2020-12-15 17:57:32 +09:00
Remi NGUYEN VAN
8ce3c4680d Split NetworkUtils and NetworkUtilsInternal
NetworkUtils is planned to move to a dedicated JAR for connectivity
classes, while NetworkUtilsInternal would stay in the
frameworks-minus-apex JAR, in the com.android.internal.net package.

Bug: 171540887
Test: m, boots, wifi working
      atest FrameworksNetTests
Change-Id: I3d38d72ad23a4bf84af823c7baeb6fed25c0665f
2020-12-07 19:41:49 +09:00
Treehugger Robot
2385727caf Merge "Remove NATT keepalive from IpSecTransform" am: ef8a605c6f am: 1453310967 am: 702c455bae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512881

Change-Id: I53320999a962c12f7cef9fe804616e62071fce1f
2020-12-04 05:14:46 +00:00
Remi NGUYEN VAN
614a368f8d Merge "Set NetworkIdentity subscriberId on all networks" am: 1ded24221e am: f055bbd349 am: e0e8a8bf97
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512877

Change-Id: Iad1c4756611c3dfc76e2a19d7fb01079813c6783
2020-12-04 05:13:00 +00:00
Treehugger Robot
ef8a605c6f Merge "Remove NATT keepalive from IpSecTransform" 2020-12-04 02:07:56 +00:00
Remi NGUYEN VAN
542e8cb07c Merge "Remove hidden API usage in metrics toString" am: 179419f810 am: 9ae6c505e7 am: 533c8b181a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512876

Change-Id: Ifc7f3dc43a4bdea06e82ae18bd03fce0932ad927
2020-12-03 05:20:56 +00:00
Remi NGUYEN VAN
f565045348 Set NetworkIdentity subscriberId on all networks
Instead of setting NetworkIdentity.subscriberId only on telephony
networks, set it when provided on any network. At the moment only
telephony is expected to have a subscriberId in its NetworkState anyway,
and while there are plans for other network agents (wifi) to have a
subscriberId, it should also be set in that case.

This allows NetworkIdentity to stop depending on hidden network type
APIs to determine if the network is mobile.

Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I4f09987f8737d1801342eb5d6d7c2b9968b466b0
2020-12-02 18:11:16 +09:00
Remi NGUYEN VAN
25f710ae47 Remove hidden API usage in metrics toString
Remove usage of hidden NetworkType, transport APIs in toString()
implementations of metrics and data usage classes.

The toString implementations can log the transports or network type as
hex or raw indices. While slightly less readable, the metrics classes
and network type APIs are deprecated.

Bug: 174436414
Test: m
Change-Id: I79239a540b66dadd3bbe0a997960530878331358
2020-12-02 18:10:59 +09:00
Remi NGUYEN VAN
75244b7d08 Remove NATT keepalive from IpSecTransform
The code is unused, and based on ConnectivityManager#startNattKeepalive,
which is deprecated.

Bug: 174436414
Test: atest FrameworksNetTests
Change-Id: I08c6c1baec668a304d971bb6f2328891a5611e6a
2020-11-30 17:24:10 +09:00
Junyu Lai
94782c58aa Merge "Expose getTx/RxBytes in TrafficStats" am: 6ef6648cd9 am: 2cdfa304d2 am: 32833d5d5d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1440245

Change-Id: I755eb6294da6cba787f60d057997a4d239aaa095
2020-11-25 06:32:25 +00:00
junyulai
3154d517c9 Expose getTx/RxBytes in TrafficStats
Test: atest FrameworksNetTests TrafficStatsTest
      atest android.net.cts android.net.wifi.cts
Bug: 164965653
Change-Id: I17b9d0bc2404c5727d4c4530ad941439b7b71a54
2020-11-24 12:11:08 +08:00
Aurimas Liutikas
9de1e0e438 Remove legacy style metalava suppression
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.

sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java

Test: make
Exempt-From-Owner-Approval: No-op change
Merged-In: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
2020-11-12 18:30:12 -08:00
Aurimas Liutikas
7e8faaefbd Remove legacy style metalava suppression
@SuppressLint("Doclava125") is a legacy way of suppressing
RequiresPermission check. Updating to the new style of suppression
so metalava no longer has to support the legacy mode.

sed -i "s/@SuppressLint(\"Doclava125/@SuppressLint(\"RequiresPermission/" \
core/java/android/app/admin/DevicePolicyManager.java \
core/java/android/hardware/hdmi/HdmiControlManager.java \
core/java/android/hardware/location/ContextHubManager.java \
core/java/android/hardware/usb/UsbDeviceConnection.java \
core/java/android/net/TrafficStats.java \
core/java/android/os/RecoverySystem.java \
core/java/android/os/storage/StorageManager.java \
core/java/android/service/persistentdata/PersistentDataBlockManager.java \
location/java/android/location/LocationManager.java \
media/java/android/media/AudioManager.java \
telecomm/java/android/telecom/TelecomManager.java \
telephony/java/android/telephony/CarrierConfigManager.java \
telephony/java/android/telephony/TelephonyManager.java \
wifi/java/android/net/wifi/RttManager.java \
wifi/java/android/net/wifi/WifiScanner.java

Test: make
Exempt-From-Owner-Approval: No-op change
Change-Id: I6d5df95cfca2950ea86872d2f0afc1ba828841dc
2020-11-12 18:27:15 -08:00
Junyu Lai
2978147703 Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5 am: 07cfc92259 am: 24d691f04d am: 10656c3c44 am: bff31f6f47
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1490617

Change-Id: I2c5895c223a5843cfe11a1736a243b6847ad1b9a
2020-11-12 10:19:29 +00:00
Junyu Lai
07cfc92259 Merge changes I6a48d4db,I6741c41c,Ifec6bde5,Icd0717c5
* changes:
  Remove unused variables
  Return offloaded traffic when querying from TrafficStats API
  Add hardware tethering traffic in testTethering test
  Remove unused getTetherStats
2020-11-12 08:45:15 +00:00
junyulai
ea2363294f Return offloaded traffic when querying from TrafficStats API
TrafficStats API are being used for querying realtime network
statistics for years. However, on certain devices, some network
traffic are produced by hardware components and not be
able to seen by kernel counters.

Thus, include statistics for those missing network traffic is
necessary. Note that the included statistics might be stale
since polling newest stats from hardware might impact system
health and not suitable for TrafficStats API use cases.

Test: atest FrameworksNetTests TetheringTests
Bug: 16229221

Change-Id: I6741c41cb5145ca8748f9b083b9c15e7e2735681
2020-11-12 14:22:31 +08:00
Mathew Inwood
fe2fed741e Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a
Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
2020-11-04 09:45:53 +00:00
Mathew Inwood
2217f37fc7 Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

This is a resubmit of ag/12929664 with some APIs excluded that caused
test failures; see bugs 171886397, 171888296, 171864568.

APIs excluded:
Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord;
Landroid/os/Process;->myPpid()I
Landroid/os/SharedMemory;->getFd()I
Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I

Bug: 170729553
Test: Treehugger
Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
2020-10-29 11:51:12 +00:00
Hongwei Wang
2feaa993c2 Revert "Add maxTargetSdk restriction to unused APIs."
This reverts commit 3950aab83b.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
2020-10-28 20:16:22 +00:00
Mathew Inwood
3950aab83b Add maxTargetSdk restriction to unused APIs.
These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
2020-10-27 15:46:07 +00:00
Yan Yan
31faab358d Merge "Require devices with first sdk 0 or later to support mandatory algorithms" am: 27ef72a875 am: bf50daf5dd am: 29a46c9501 am: 796be74cd0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1468662

Change-Id: Ica06a3a4c3695052f554056caab603a857b4e9b2
2020-10-20 23:51:20 +00:00
Yan Yan
27ef72a875 Merge "Require devices with first sdk 0 or later to support mandatory algorithms" 2020-10-20 22:33:37 +00:00
Yan Yan
f62269e265 Require devices with first sdk 0 or later to support mandatory algorithms
It is safe because these mandatory algorithms are already required
before new algorithms are added

It is also a quick fix to unblock b/171279612, whose root cause is
the device first sdk is wrong

Bug: 171279612
Test: atest CtsNetTestCases:IpSecManagerTest
Change-Id: I5b9d85b2bc8f13f54467c97160d138a4628265f7
2020-10-20 15:12:30 -07:00
Anton Hansson
088a664274 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-20 09:04:03 +01:00
Anton Hansson
9001afc697 Remove @TestApi from @SystemApi symbols
I ran these commands:
    cd frameworks/base
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs'
    grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \
        's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs'

Bug: 171179806
Test: m checkapi
Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789
Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
2020-10-19 16:41:01 +01:00
Yan Yan
af9772371c Merge changes from topic "new-ipsec-api" am: 46f82d282a am: 2580e7a9f1 am: f769e1ecb0 am: 021a46ff4b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1398433

Change-Id: I18748127d0c97d9473c96678d556b03ad6048808
2020-10-17 00:09:20 +00:00
Yan Yan
4f86de5e54 Expose new algorithms as public API
Bug: 161716062
Test: FrameworksNetTests:IpSecAlgorithmTest
Change-Id: I5041c61ad5a4aa58b259e24de80a2c63d6b19dae
2020-10-16 17:53:37 +00:00
Yan Yan
21abcd0248 Add new mandatory IPsec algorithms
This CL adds new mandatory IPsec algorithms and allows
OEM to enable them on old devices using resource overlay

Bug: 161716062
Test: FrameworksNetTests:IpSecAlgorithmTest
Change-Id: Ib827b05ea27dbe61b14ad236e858f825293ed994
2020-10-15 17:35:17 -07:00
Roman Kalukiewicz
76a6131fdb Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the
https://checkerframework.org/ doesn't check inherited annotations
complaining about all equals() invocations that get nullable argument.

The change was generated by running

find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /'

in the frameworks/base directory and by automatically adding and
formatting required imports if needed. No manual edits.

Bug: 170883422
Test: Annotation change only. Should have not impact.
Exempt-From-Owner-Approval: Mechanical change not specific to any component.
Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
2020-10-15 10:48:01 -07:00