Commit Graph

2000 Commits

Author SHA1 Message Date
Cody Kesting
08efffc46e Merge "Fix javadoc build break s/line/link/" 2020-01-24 18:37:51 +00:00
Qingxi Li
78433a68ee Merge "Add API for apps to check if they are the network owner" 2020-01-24 18:12:52 +00:00
Nathan Harold
74f0fb8d4e Fix javadoc build break s/line/link/
Bug: 148248781
Test: compilation
Change-Id: I9df208a9b063b71b2f6cc3099005d1ab38044cd2
Merged-in: I9df208a9b063b71b2f6cc3099005d1ab38044cd2
2020-01-24 09:43:03 -08:00
Qingxi Li
bb8da980ae Add API for apps to check if they are the network owner
This CL extends NetworkCapabilities#mEstablishingVpnAppUid
to the network owner app UID and introduces a new public API
to get this owner app's UID.

Bug: 142072839
Test: atest FrameworksNetTests
Change-Id: Id83cdea62b89b586aff74e51e3fee60e53d37d4c
2020-01-24 17:28:23 +00:00
Cody Kesting
680cce79b9 Merge "Add AIDL for registering ConnectivityDiagnosticCallbacks." 2020-01-24 16:38:22 +00:00
Cody Kesting
54600d7b00 Merge "Define ConnectivityDiagnosticsCallback IBinder impl." 2020-01-24 16:38:08 +00:00
Lorenzo Colitti
6a0bafdb58 Merge changes I7065d081,Ic7c3a331,Ia432057b
* changes:
  Add API for tethering clients change
  Allows the caller to specify configuration by TetheringRequest
  Make TetheringManager to system API
2020-01-24 16:23:18 +00:00
markchien
91c78e57df Allows the caller to specify configuration by TetheringRequest
This is initial work to allow caller to pass their prefered
configuration to start tethering. Caller may able to specify the
downstream interface ipv4 address with dhcp server disabled for
static IP configuration, or able to exempt entitlement check if
they have permission in follow up CL.

Bug: 141256482
Test: -atest TetheringTest
      -ON/OFF wifi tethering

Change-Id: Ic7c3a33195bbd7e72f9b8e73fa148be476b87bf3
Merged-In: Ic7c3a33195bbd7e72f9b8e73fa148be476b87bf3
2020-01-24 23:39:50 +09:00
markchien
6ae63e5232 Make TetheringManager to system API
Also deprecated tethering APIs in ConnectivityManager.
Will have follow up change to remove @hide tethering function in
ConnectivityManager.

Bug: 145093446
Bug: 148038547
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ia432057bf9056727c4a0ca97d160a49274d33581
Merged-In: Ia432057bf9056727c4a0ca97d160a49274d33581
2020-01-24 23:39:49 +09:00
Cody Kesting
d199a9db39 Add AIDL for registering ConnectivityDiagnosticCallbacks.
ConnectivityService needs to allow for registering and unregistering
ConnectivityDiagnosticsCallbacks as part of ConnectivityDiagnostics API.
These methods will be used by ConnectivityDiagnosticsManager so that
privileged applications can receive notifications on network events by
the system.

Bug: 146444622
Test: compiles
Change-Id: Id00b30af5692db5eef47d0d948897148578d3b32
2020-01-23 11:30:04 -08:00
Cody Kesting
3e7fb38355 Define ConnectivityDiagnosticsCallback IBinder impl.
An IBinder implementation of the ConnectivityDiagnosticsCallback AIDL is
needed so that apps can receive notfications with their registered
callbacks for callbacks coming from ConnectivityService.

Bug: 143187964
Bug: 147848028
Test: compiles
Test: atest FrameworksNetTests
Change-Id: Ie62678f794d81e1edee68977ec684a911b5070b7
2020-01-23 11:30:04 -08:00
Cody Kesting
452ccae317 Merge "Add list of Administrator UIDs to NetworkCapabilities." 2020-01-23 17:52:58 +00:00
Nathan Harold
eedaa1f471 Merge "Define Bundle keys for ConnectivityDiagnostics." 2020-01-23 16:34:16 +00:00
Cody Kesting
d6ad3365fa Define Bundle keys for ConnectivityDiagnostics.
ConnectivityDiagnosticsManager defines several callbacks that can be
invoked for registered ConnectivityDiagnosticsCallback instances.
onConnectivityReport and onDataStallSuspected include ConnectivityReport
and DataStallReport, respectively, both of which contain a
PersistableBundle to be used for passing information from the
NetworkStack module to the registered callback. When values will be
consistently passed inside these bundles, their keys are defined inside
ConnectivityReport and DataStallReport.

Bug: 147249364
Test: compiles
Test: atest FrameworksNetTests
Change-Id: Icc6bd4337865692b6ca7c18eacabff59ba3a5bb9
2020-01-23 00:49:17 -08:00
Cody Kesting
896939854b Add list of Administrator UIDs to NetworkCapabilities.
Adds a list of administrator UIDs to NetworkCapabilties. The carrier
privilege permission model allows multiple uids to be granted
network-management privileges via certificates stored on a SIM card or
in CarrierConfigManager. The current NetworkCapabilities only allows a
single uid to be stored to track the owner of the network - this change
remedies that discrepancy.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: I3169d31e0270c976a720e80363cb268cbafd0455
2020-01-22 23:59:56 -08:00
Treehugger Robot
7e5cce2c67 Merge "Fix generic inferred type argument." 2020-01-23 06:39:57 +00:00
Cody Kesting
ec88fda4a8 Fix generic inferred type argument.
Test: compiles.
Test: atest FrameworksNetTests
Change-Id: I0dffb3f44fb465ac8bae3c41f26176e86f65e825
2020-01-22 20:26:08 -08:00
Benedict Wong
5642043367 Add Ikev2VpnProfile as public API
This change adds configuration classes for Platform VPNs, with the
extensibility for further platform VPNs to be added in future.

Profile validity is checked upon construction, and upon changing
conversion from VpnProfile instances. Internal storage and method calls
all use VpnProfiles to allow for reuse of existing infrastructure.
However, when Platform VPN implementations are started, the internal
VpnProfile will be converted back into the respective
PlatformVpnProfile for validity checking.

Bug: 143325939
Test: Compiles, FrameworksNetTests passing.
Change-Id: I3c375fb08c132fc062e893c375f5c36460122162
2020-01-22 19:23:01 -08:00
Cody Kesting
880e0654e7 Merge changes from topic "connectivity-diagnostics-system-server"
* changes:
  Add ConnectivityDiagnosticsManager to System Server.
  Make DataStallReport Parcelable.
  Make ConnectivityReport Parcelable.
2020-01-23 01:56:33 +00:00
Remi NGUYEN VAN
1c42b174ed Merge "Add API for CaptivePortalData" 2020-01-22 15:55:17 +00:00
Treehugger Robot
7c25b78583 Merge "Add NetworkCapabilities#getSSID to SystemApi" 2020-01-22 15:23:07 +00:00
Remi NGUYEN VAN
ca455afb4d Add NetworkCapabilities#getSSID to SystemApi
setSSID was added to the API, so it makes sense to have getSSID be part
of the API as well.

Test: m
Bug: 139268426
Change-Id: I6fa9c513ce4fb8ce1e3530776ce8fd5b2e77055e
2020-01-22 22:52:53 +09:00
Remi NGUYEN VAN
0a65eeda32 Add API for CaptivePortalData
CaptivePortalData will be used to hold data advertised by the network
following RFC7710bis.

To fetch the CaptivePortalData, the API URL is added to LinkProperties,
to be provided by the NetworkAgent.

Because CaptivePortalData can be used to guess user location (especially
from the URLs provided by the portal), it is only exposed to
applications that have privileged permissions.

Test: atest FrameworksNetTests
Bug: 139269711
Change-Id: I341175b5fece8ee00e19898af5e8eabe66cefbf3
2020-01-22 22:27:44 +09:00
Chiachang Wang
239fb6480f Merge changes from topic "networkagent"
* changes:
  Add a Builder to NetworkAgentConfig, and make it SystemApi.
  Rename NetworkMisc to NetworkAgentConfig.
2020-01-22 05:27:51 +00:00
Chiachang Wang
f1449b0ba5 Merge "Make NetworkAgent stop subclassing Handler." 2020-01-22 04:33:31 +00:00
Cody Kesting
fa7693d4f9 Add ConnectivityDiagnosticsManager to System Server.
ConnectivityDiagnosticsManager should be accessed through
Context#getService. In order for this to be possible, it needs to be
defined as a service inside SystemServiceRegistry.

Bug: 146444622
Test: compiles.
Test: CTS testing in aosp/1211164
Change-Id: I6fe29441ecc9967a04ceb394b3bbe54830bef079
2020-01-21 08:31:56 -08:00
Remi NGUYEN VAN
2812b46691 Merge "Add NetworkRequest#satisfiedBy to SystemApi" 2020-01-21 14:12:27 +00:00
Lorenzo Colitti
8f304608c7 Add a Builder to NetworkAgentConfig, and make it SystemApi.
Currently, only support the three elements in the config that are
known to be used.

Bug: 138306002
Test: builds, boots
Test: atest FrameworksTelephonyTests
Change-Id: I1d231ec2ddcff97c039bcbc815a39c1d3e26c410
Merged-In: I1d231ec2ddcff97c039bcbc815a39c1d3e26c410
2020-01-21 13:12:15 +00:00
Lorenzo Colitti
ab2fed7241 Rename NetworkMisc to NetworkAgentConfig.
NetworkMisc is not really an appropriate name for a system API.

Bug: 138306002
Test: builds, boots, wifi works, telephony works
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee
Merged-In: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee
2020-01-21 12:57:27 +00:00
Lorenzo Colitti
cbd8f2a7a3 Make NetworkAgent stop subclassing Handler.
Subclassing Handler is not appropriate for a system API because
it is an implementation detail and allows users of this class to
post messages to the handler in ways that allow inappropriate
access to internals that aren't part of the API contract.

Also fix some lint errors.

Test: builds
Bug: 138306002
Change-Id: I79478ceff6bbcae879d1025098d177de0d15dbee
Merged-In: I79478ceff6bbcae879d1025098d177de0d15dbee
2020-01-21 12:55:29 +00:00
Remi NGUYEN VAN
59917caa0e Add NetworkRequest#satisfiedBy to SystemApi
The API is useful for NetworkFactories to select requests based on
capabilities.
This mirrors NetworkCapabilities#satisfiedByNetworkCapabilities

Test: m
Bug: 138306002
Merged-In: I1d4a928256951397cabde5c352a872fd48d85859
Change-Id: I1d4a928256951397cabde5c352a872fd48d85859
(clean cherry-pick from internal branch)
2020-01-21 12:11:52 +09:00
Cody Kesting
3d97b5e635 Make DataStallReport Parcelable.
DataStallReport is defined inside ConnectivityDiagnosticsManager. In
order for DataStallReport to be used in aidls, it must implement the
Parcelable interface.

Bug: 143187964
Test: compiles
Test: atest FrameworksNetTests
Change-Id: Idbb4885e2f67fb3f85d406a622ae45d34492dca4
2020-01-20 18:02:09 -08:00
Cody Kesting
beb41b5457 Make ConnectivityReport Parcelable.
ConnectivityReport is defined inside ConnectivityDiagnosticsManager. In
order for ConnectivityReport to be used in aidl interfaces, it must
implement the Parcelable interface.

Bug: 143187964
Test: compiles
Test: atest FrameworksNetTests
Change-Id: I8e862c78bd84b5da14203f61ce44beb1ca4a623d
2020-01-20 18:02:09 -08:00
Chalard Jean
f78c964538 Have registerNetworkAgent return a Network.
This is more useful.

Bug: 135998869
Test: FrameworkNetTests FrameworksWifiTests
Change-Id: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669
Merged-In: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669
2020-01-20 16:22:06 +08:00
Rambo Wang
b2ff467a3a Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer" 2020-01-15 17:45:58 +00:00
Treehugger Robot
7916449753 Merge "Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi" 2020-01-15 11:42:11 +00:00
paulhu
e102b0bb49 Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests

Change-Id: I77cb45e6b2aaf4ab2c457cb59ccf77b1b8c01fa9
2020-01-15 15:38:23 +08:00
Mark Chien
a64019915e Merge "Unhide NetworkRequest API which use legacy type" 2020-01-15 06:49:33 +00:00
Treehugger Robot
4ed1963c4a Merge "Expose SocketKeepalive#SUCCESS as SystemApi" 2020-01-15 05:01:04 +00:00
paulhu
2f7c345d56 Expose SocketKeepalive#SUCCESS as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests
Change-Id: I94171b2dc4f26442df918547bf8bc40953f63f2e
Merged-In: I94171b2dc4f26442df918547bf8bc40953f63f2e
2020-01-15 02:45:43 +00:00
Rambo Wang
582ba554de Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer
StringNetworkSpecifier is widely used to specify subscription id for
the NetworkRequest. The raw string field introduce ambiguity and leave
large space for bugs. With TelephonyNetworkSpecifer, we are able to
settle down the type and value of the fields (although currently only
one) and introduce validation to detect the bug in the beginning.

Bug: 145993724
Test: atest FrameworksNetTests FrameworksTelephonyTests &
      make offline-sdk-docs
Change-Id: Iefbad9b1deb3de2c0b262d9ce5ae0704a50d08a6
2020-01-14 10:51:11 -08:00
Aaron Huang
9fef5a5cf0 Merge "Make NattKeepalivePacketData @SystemApi" 2020-01-14 14:36:09 +00:00
Lorenzo Colitti
baf25cde90 Merge "Expose ConnectivityManager#TYPE_NONE as SystemApi" 2020-01-14 05:30:14 +00:00
markchien
d6eeffd079 Unhide NetworkRequest API which use legacy type
Bug: 144753389
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I349da06769e9ffcee6bb42f51ab454e0ef774fb3
Merged-In: I349da06769e9ffcee6bb42f51ab454e0ef774fb3
2020-01-14 04:56:54 +00:00
paulhu
74357e70a8 Expose ConnectivityManager#TYPE_NONE as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests
Change-Id: Ia496aaeaf74fa44764640fd2b97c417509e040aa
2020-01-14 10:02:30 +08:00
Chiachang Wang
254c3d830e Merge "Support reevaluation request from captive portal app" 2020-01-14 01:42:22 +00:00
Aaron Huang
aead9c64fa Make NattKeepalivePacketData @SystemApi
Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests

Change-Id: I687f1a8a4b82cb7e4a0dfeb24f0b23a4de6d5287
2020-01-14 01:45:28 +08:00
Chiachang Wang
938bfba0c3 Support reevaluation request from captive portal app
CaptivePortalLogin use similar way to validate the network as
NetworkMonitor. Provide API to reuse NetworkMonitor facilities
for consistent captive portal detection.

Bug: 134892996
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Test: manually test with captive portal Wi-Fi
Test: make system-api-stubs-docs-update-current-api \
      test-api-stubs-docs-update-current-api
Change-Id: I6f039eae7ceb18eb6c3cf15587cdc27a7fe35b00
2020-01-13 14:28:02 +08:00
Lorenzo Colitti
a86fae785a Stop using NetworkFactory in connectivity code.
Bug: 138306002
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: I6b9979f343108c0c077abd86ae1c21e5ece0cccc
2020-01-12 17:40:02 +09:00
Treehugger Robot
0e82d1c50d Merge "Add NetworkCapabilities#deduceRestrictedCapability" 2020-01-10 09:27:31 +00:00