Commit Graph

205 Commits

Author SHA1 Message Date
Automerger Merge Worker
b499ecedc6 Merge "p2p: revise tethering handler for shared group interface support" am: 0bbf289b09 am: bbbe6f7ba5 am: c9bde4be72
Change-Id: I512a950fc395518bc46dd99590bfdcbe3b10bed3
2020-01-17 21:48:36 +00:00
Jimmy Chen
ea902f6f2a p2p: revise tethering handler for shared group interface support
When leaving a group, all information are erased and no group interface
is passed to tethering service.
For separate group interface, tethering could be stopped
on p2p group interface removed. For shared group interface,
i.e. management interface and group interface share one
interface, ex. p2p0, tethering has no chance to be stopped since management
interface won't be removed after leaving a group.

Bug: 141382930
Test: atest FrameworksNetTests
Test: atest FrameworksWifiTests
Test: atest TetheringTests
Change-Id: Ib611018b67c76ff79c7e6658136721090feb145b
2020-01-16 14:33:32 +08:00
Treehugger Robot
81369f59d2 Merge "TetheringTests: Stop using @hide Wifi P2P APIs" 2020-01-16 05:51:49 +00:00
Automerger Merge Worker
6d22290067 Merge "Tethering: remove redundant source code" am: 18401e3bb0 am: 69c72da2c7 am: 00356b8d79
Change-Id: Ifb9903a985090e85d85e642bd3e6d5a1d68b6bfb
2020-01-15 12:34:28 +00:00
Mark Chien
18401e3bb0 Merge "Tethering: remove redundant source code" 2020-01-15 11:51:07 +00:00
Automerger Merge Worker
afae2bad30 Merge "Allow opening tethering when data saver ON" am: 99c7c0fe87 am: 80cc1ede37 am: dbefc5e6ac
Change-Id: I24a842de6918ccd0eb1dc60161854ea25528dff5
2020-01-15 07:29:40 +00:00
Mark Chien
99c7c0fe87 Merge "Allow opening tethering when data saver ON" 2020-01-15 06:58:29 +00:00
Automerger Merge Worker
96d7b00caf Merge "Tethering: switch to use tethering package resources" am: 4cefaf8bc8 am: 01224e019f am: f1e67d5b17
Change-Id: I3f3ba0792f2ac0c4137381cbb6e49d533a136845
2020-01-15 06:44:39 +00:00
Mark Chien
4cefaf8bc8 Merge "Tethering: switch to use tethering package resources" 2020-01-15 06:17:06 +00:00
Automerger Merge Worker
4d4aaaf243 Merge changes from topic "sp06-offloadcontroller" am: 01d30a4ce0 am: b61116705a am: c6a841b77b
Change-Id: I4e7924ebb2d37ecffb8facce0ec51643afb12264
2020-01-15 05:33:32 +00:00
markchien
4ddf692e11 Tethering: remove redundant source code
Bug: 143195885
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I92cbb51a0d4fb048aa75ba9932e3b106d181bad9
2020-01-15 04:33:10 +00:00
David Su
d124508c2d Merge changes from topics "frameworkswifiapitests-jacoco", "settingsunittests-wifi-systemapi", "sl4a-access-wifi-hidden-apis"
* changes:
  Remove FrameworksWifiApiTests jacoco exclude_filter
  FrameworksWifiApiTests: build against framework-wifi (Attempt 2)
  Convert FrameworksWifiApiTests mk to bp (Attempt 2)
  Give SL4A access to @hide Wifi APIs
  Expose WifiInfo & NetworkSelectionStatus Builders for SettingsUnitTests
  Expose WifiEnterpriseConfig.getClientPrivateKey() for WifiConfigurationProviderTest
  Expose ScanResult constructor for SettingsLibRoboTests
  SettingsLibTests: grant access to Wifi @hide APIs
  TetheringTests: Stop using @hide Wifi P2P APIs
2020-01-14 18:06:27 +00:00
markchien
eaaebd1f0f Allow opening tethering when data saver ON
When data saver enabled, tethering would be OFF.
Currently settings would not allow user to turning tethering back.
After aosp/1181583 is merged, user can turn tethering back without
turning data saver OFF.

Bug: 145711175
Bug: 142374233
Test: atest TetheringTests
      OFF/ON tethering when data saver ON

Change-Id: I59e662ba771a563f5f1766ba29e05246b8280220
2020-01-14 20:15:31 +08:00
junyulai
f858a57887 [SP09] Remove NetworkStatsService @hide usage in Tethering
Test: atest TetheringTest
Bug: 130855321
Change-Id: I0260524c57f7c0aa738eaff07f9b0ae8e785ed63
2020-01-14 20:15:19 +08:00
junyulai
5864a3f0aa [SP07] Remove reference of NetworkStatsService in IpServer
Currently NetworkStatsService is notified when downstream is
updated. However, it seems unnecessary given that tether stats
is persist since boot, and there is no any upstream change when
downstream is changed.

Test: atest NetworkStatsServiceTest IpServerTest
Bug: 130855321
Change-Id: Ie300bfeb0a04678fcfcf300843b6f859af9df91d
2020-01-14 20:14:59 +08:00
junyulai
b7da74af88 [SP06] Use system API to communicate with NSS in OffloadController
Test: atest FrameworksNetTests OffloadControllerTest TetheringTest
Bug: 130855321

Change-Id: I294be3a2874f8c8120857e308e629199af014fcd
2020-01-14 20:14:33 +08:00
markchien
873c64ab8f Tethering: switch to use tethering package resources
Bug: 147399354
Test: build
Change-Id: I482788cdc8be3d34c9a922bfa7eb053f0aa87c96
2020-01-14 09:48:02 +00:00
David Su
dd66bcd894 TetheringTests: Stop using @hide Wifi P2P APIs
Instead use Mockito to achieve the same thing.

Bug: 138801922
Test: atest TetheringTests
Change-Id: I41edd697017f4ce59e6707302bebc0da3d75831d
Merged-In: I41edd697017f4ce59e6707302bebc0da3d75831d
2020-01-13 13:15:14 -08:00
David Su
5479a4e669 TetheringTests: Stop using @hide Wifi P2P APIs
Instead use Mockito to achieve the same thing.

Bug: 138801922
Test: atest TetheringTests
Change-Id: I41edd697017f4ce59e6707302bebc0da3d75831d
2020-01-13 12:49:21 -08:00
Automerger Merge Worker
2246030518 Merge "Migrate legacy dhcp server config to DeviceConfig" am: 63647c2d7a am: 08e7ddcbfb am: 803fd24c79
Change-Id: I43a2a55077bfd1da96c72e76b5289334ab22f2ea
2020-01-13 19:38:44 +00:00
markchien
9a0b95d294 Migrate legacy dhcp server config to DeviceConfig
Legacy dhcp server can also be enabled by resource config.

Bug: 144814607
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I8ae5fa3d5bbd88129bd0890f71be6f8a1bfec0eb
2020-01-13 15:07:03 +00:00
Automerger Merge Worker
01a77dc5e9 Merge changes I0c45635b,I2201d0e4 am: 5b55209300 am: fbec51123c am: 6f9a1f9f75
Change-Id: I5a43f1653959b7765727f2c2371709bb7ba2f65a
2020-01-13 12:36:23 +00:00
paulhu
ffa6e34395 Replace PendingIntent/NotificationManager @hide APIs
Tethering used some PendingIntent/NotificationManager @hide APIs
but they are not able to call now. Replace them with similar
System APIs.

Bug: 122085773
Test: atest TetheringTests
Change-Id: I2201d0e44a6356b8b1974ce0ed80d9913a7aeff5
2020-01-13 15:29:12 +08:00
Automerger Merge Worker
11d33c2784 Merge "Fix hidden usage of networkCapabilitiesForType" am: 73661b9a3d am: 2d4fe8afc8 am: dd605f0c0d
Change-Id: I1182b6969487cea599a52d5b77630c55ffdc3842
2020-01-10 11:46:07 +00:00
markchien
3470487207 Fix hidden usage of networkCapabilitiesForType
After this change, tethering only support below legacy type:
  - TYPE_BLUETOOTH
  - TYPE_ETHERNET
  - TYPE_MOBILE
  - TYPE_MOBILE_DUN
  - TYPE_MOBILE_HIPRI
  - TYPE_WIFI

Bug: 144753389
Test: build
Change-Id: I394c8306d9f88a6648580b3b410069ad219f0074
2020-01-10 14:55:54 +08:00
Automerger Merge Worker
05b8363d38 Merge "Fix some @hide usage in Tethering(Cont.)" am: 4a12a12918 am: 389c46b7cb am: 777ca2c5d2
Change-Id: Ia889b93625bbe2ec24b634ac25ca72cb1b44a3de
2020-01-09 09:41:18 +00:00
Automerger Merge Worker
2a17fa5fae Merge "Replace ConnectivityManager constants to TetheringManager" am: 0728d22b39 am: 13a0da47dc am: 66ba1fb6aa
Change-Id: I0180fe011062a11d7cc925bced8d8178fa3dcc63
2020-01-09 07:25:42 +00:00
markchien
b799fa3e95 Fix some @hide usage in Tethering(Cont.)
Using alternative way to fix @hide usage. Do not have API change.

Bug: 144814072
Test: buid
Change-Id: Ia23e319ad3779318471d01cbfa17b8c6df4960d3
2020-01-09 05:40:42 +00:00
markchien
9b4d7577d8 Replace ConnectivityManager constants to TetheringManager
Replace some ConnectivityManager constants as TetheringManager inside
tethering module. No API change, will have follow up CL to delete
@hide tethering constants in ConnectivityManager and replace caller
to using TetheringManager.

Bug: 144753389
Test: build
Change-Id: Ia1b963669722c32d147375763205ed2f3af52fed
2020-01-08 15:06:09 +00:00
markchien
12c5bb8103 [Tether09] Use INetd to call netd directly
- Using INetd to communicate with netd directly instead of using
NetworkManagementService which is a wrapper of INetd and don't have plan
to be updatable.
- Also replace InterfaceConfiguration by InterfaceController.
- Remove redundant interface flags. Only set interface up/down flag to
netd because netd only use these two flags for INetd#interfaceSetCfg.
- Note that tethering still use NetworkManagementService
to register tethering stats provider and it would also be replaced with
other way in follow up change.

Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I4ab0ad387d4bd1773ff94d3b380c1720df07f8d5
Merged-In: I4ab0ad387d4bd1773ff94d3b380c1720df07f8d5
2020-01-08 12:33:58 +00:00
markchien
dac2826929 [Tether09] Use INetd to call netd directly
- Using INetd to communicate with netd directly instead of using
NetworkManagementService which is a wrapper of INetd and don't have plan
to be updatable.
- Also replace InterfaceConfiguration by InterfaceController.
- Remove redundant interface flags. Only set interface up/down flag to
netd because netd only use these two flags for INetd#interfaceSetCfg.
- Note that tethering still use NetworkManagementService
to register tethering stats provider and it would also be replaced with
other way in follow up change.

Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I4ab0ad387d4bd1773ff94d3b380c1720df07f8d5
2020-01-08 20:07:04 +08:00
Automerger Merge Worker
0b4fd06744 Merge "Fix some @hide usage in Tethering" am: e13d884aa3 am: aff6974b16 am: b43f5315ca
Change-Id: I94fc3652055c3ddbeb807c88b70d7fc833d69c3b
2020-01-08 01:27:25 +00:00
Mark Chien
e13d884aa3 Merge "Fix some @hide usage in Tethering" 2020-01-08 00:37:43 +00:00
Automerger Merge Worker
fe8928e7b7 Merge "Both build 32 and 64 architecture for TetheringTests" am: 10f50b79fd am: 6aca95071a am: a4ea319b72
Change-Id: I1b7c1a0ce9102af988b4ddb6ffd174d5800f7e5a
2020-01-07 21:28:37 +00:00
Treehugger Robot
10f50b79fd Merge "Both build 32 and 64 architecture for TetheringTests" 2020-01-07 20:30:15 +00:00
markchien
6cf0e550c7 Fix some @hide usage in Tethering
Using alternative way to replace some @hide API.

Bug: 144814072
Test: build, flash, boot
      atest TetheringTests

Change-Id: I1e12d69db1ad91dff553e142e17c6a70808e1639
2020-01-07 21:29:52 +08:00
markchien
2d4cd2d8bd Both build 32 and 64 architecture for TetheringTests
Compile as multilib is neccessary, otherwise mts-tethering-coverage
test plan will fail on armeabi-v7a because of failing to extract
native libraries. This change also add mts tag to TetheringTests.

Bug: 145490751
Test: -atest TetheringTests
      -m mts && mts-tradefed run mts-tethering-coverage

Change-Id: I6425c135ca17213bcdd5198177993daf8280504e
2019-12-24 10:21:15 +00:00
Automerger Merge Worker
9605040e31 Merge "Add UpstreamNetworkState for tethering" am: 9b141cc23c am: 5c351eb894 am: ad929e93e2
Change-Id: I530e4c189bf238cf9f4bc6b430c4cee724634840
2019-12-24 06:05:38 +00:00
markchien
c6485f8368 Add UpstreamNetworkState for tethering
Previous tethering use NetworkState to encapsulate network states.
But NetworkState is hide API and Tethering just use NetworkState
locally that it don't interact with other module by NetworkState.
To avoid hide API accessing and reduce dependency, replace
NetworkState as UpstreamNetworkState in tethering.

Bug: 144758082
Test: atest TetheringTests
     OFF/ON hotspot

Change-Id: Ia1837b6ed983a64c3ed72ecf0e6f46d91b3af7da
2019-12-23 17:38:40 +08:00
markchien
e7ccfca9da [Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
2019-12-20 10:31:31 +08:00
markchien
9d3538260b [Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
2019-12-19 20:53:06 +08:00
markchien
8f831c09e5 Change Tethering package name
".apex" is easy to confuse.
Rename as below:
apex: com.android.tethering.apex -> com.android.tethering
apk: com.android.tethering -> com.android.networkstack.tethering

Bug: 146471733
Test: build

Change-Id: I2c7647abb996539a3af6cfe0e0214a5e8927c0d6
Merged-In: I2c7647abb996539a3af6cfe0e0214a5e8927c0d6
2019-12-19 13:06:50 +08:00
markchien
eda5d30035 Change Tethering package name
".apex" is easy to confuse.
Rename as below:
apex: com.android.tethering.apex -> com.android.tethering
apk: com.android.tethering -> com.android.networkstack.tethering

Bug: 146471733
Test: build

Change-Id: I2c7647abb996539a3af6cfe0e0214a5e8927c0d6
2019-12-19 12:57:39 +08:00
lesl
44d5357a67 tether: Use new API: startTetheredHotspot to enable hotspot
Bug: 146180860
Test: atest TetheringTests
Change-Id: I14be9c446319fad0706bf8c20faaba7801d638a2
2019-12-13 11:00:24 +08:00
markchien
147186daff [Tether10]Remove UserManagerInternal usage in Tethering
To be the unbundled application, tethering can not use UserManagerInternal
method anymore. Replace it by listening user restriction change intent.

Also fix some cleanup from
https://android-review.googlesource.com/c/platform/frameworks/base/+/1131002

Bug: 143195885
Test: -build, flash, boot
      -atest TetheringTests
      -manual test. Add a trigger point to call
       UserManager.setUserRestriction(DISALLOW_CONFIG_TETHERING) from
       Settings. Open hotspot -> restrict tethering from new adding trigger
       point -> hotspot is OFF and Tethering settings are not available.

Change-Id: I4ed08d20f8b7476b8ecd5d018b75806dd2f22cc1
Merged-In: I4ed08d20f8b7476b8ecd5d018b75806dd2f22cc1
2019-11-30 10:06:23 +00:00
markchien
ee6ad37837 [Tether07] Migrate Tethering into module
Now tethering would be run in dedicated service.
TetheringManager is the interface used to communicate with
TetheringService. The new call flow would be: ConnectivityManager
-> ConnectivityService -> TetheringManager -> TetheringService.
Note: the return value of #tether(), #untether() and #setUsbTethering()
APIs would always be no error. Client can use #getLastTetherError()
or #getTetheredIfaces or listen tether state change to check
status of corresponding interface.

Bug: 136040414
Bug: 144742179
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
Merged-In: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
2019-11-30 10:03:08 +00:00
markchien
499c4a8c75 [Tether10]Remove UserManagerInternal usage in Tethering
To be the unbundled application, tethering can not use UserManagerInternal
method anymore. Replace it by listening user restriction change intent.

Also fix some cleanup from
https://android-review.googlesource.com/c/platform/frameworks/base/+/1131002

Bug: 143195885
Test: -build, flash, boot
      -atest TetheringTests
      -manual test. Add a trigger point to call
       UserManager.setUserRestriction(DISALLOW_CONFIG_TETHERING) from
       Settings. Open hotspot -> restrict tethering from new adding trigger
       point -> hotspot is OFF and Tethering settings are not available.

Change-Id: I4ed08d20f8b7476b8ecd5d018b75806dd2f22cc1
2019-11-29 07:07:11 +00:00
markchien
2c4cc6f514 [Tether07] Migrate Tethering into module
Now tethering would be run in dedicated service.
TetheringManager is the interface used to communicate with
TetheringService. The new call flow would be: ConnectivityManager
-> ConnectivityService -> TetheringManager -> TetheringService.
Note: the return value of #tether(), #untether() and #setUsbTethering()
APIs would always be no error. Client can use #getLastTetherError()
or #getTetheredIfaces or listen tether state change to check
status of corresponding interface.

Bug: 136040414
Bug: 144742179
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: I7e78c0e0a3e70f940a749ba2a39ece7c7ec5b9b3
2019-11-29 07:05:21 +00:00
SongFerngWang
e544517ee7 isTetherApnRequired api rename as isTetheringApnRequired
Bug: 144455789
Test: Build pass.
      atest TetheringConfigurationTest (PASS)

Change-Id: I9ab4c7b3aef0619046d7e3d711683dbe1f31bb50
2019-11-15 14:50:52 +08:00
SongFerngWang
7757ed3e3d [mainline] Expose getTetherApnRequired API as system API
1. getTetherApnRequired API rename to isTetherApnRequired.
2. Expose isTetherApnRequired API as system API.

Bug: 142365448
Test: Build pass.
      atest TetheringConfigurationTest (PASS)

Change-Id: Iafb2e4fbddb0251e23673742d990ad098a8ae375
Merged-In: Iafb2e4fbddb0251e23673742d990ad098a8ae375
2019-11-08 19:28:33 +08:00