Commit Graph

739 Commits

Author SHA1 Message Date
Automerger Merge Worker
f944fd49d2 Merge "Expose some tethering constants in Settings" am: 50bd8a4938 am: 2173a4d07e am: b8a97000e9
Change-Id: I0a6e91e6f33924ef181033faeb755c8cc123b94b
2020-01-09 12:27:08 +00: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
22791153e7 Merge "[SP01] Add NetworkStats to system API" am: 2073d24a99 am: b340068a3e am: e4601e0a58
Change-Id: I1bb272727cbaec0102669b3f3b8141994f8e1f9a
2020-01-09 09:37:50 +00:00
markchien
5ea11dbcdc Expose some tethering constants in Settings
Make some tethering constants @systemApi because tethering
cannot use hide Api.

Bug: 144814607
Test: build, flash, boot
Change-Id: I8b46e2483eec575cddaad392d055551b75ca71ef
2020-01-09 08:48:55 +00:00
Mark Chien
4a12a12918 Merge "Fix some @hide usage in Tethering(Cont.)" 2020-01-09 08:47:07 +00:00
Junyu Lai
2073d24a99 Merge "[SP01] Add NetworkStats to system API" 2020-01-09 08:33:24 +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
junyulai
c244d7a660 [SP01] Add NetworkStats to system API
In order to let external module report their network stats,
expose necessary APIs to construct NetworkStats object.

Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: m doc-comment-check-docs
Bug: 130855321
Change-Id: Id3ec8aaff3df67948c25eac2319a74cf33a27979
2020-01-09 03:11:22 +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
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
Automerger Merge Worker
facb4766b1 Merge "Change tetheroffloadjni to tetheringutilsjni" am: b2bb37098f am: 75b0369615 am: ef581020d3
Change-Id: I2069561edb05b53e565563c8419c689531ff9571
2020-01-07 09:38:44 +00:00
Treehugger Robot
b2bb37098f Merge "Change tetheroffloadjni to tetheringutilsjni" 2020-01-07 09:05:43 +00:00
markchien
f87ebdcbb4 Change tetheroffloadjni to tetheringutilsjni
Rename tetheroffloadjni to tetheringutilsjni and move setupRaSocket
jni method from NetUtils into tetheringutilsjni.

Bug: 143195885
Test: -build, flash, boot
      -atest TetheringTests
      -Off/On hotspot with ipv6 upstream

Change-Id: Ib68eb6999bbe2d3ca97e68712f22b105311ef800
2020-01-07 07:42:13 +00:00
Automerger Merge Worker
c784683a0f Merge "Remove FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT in tethering" am: 2bc689c178 am: cb3d93d558 am: 0105d9666f
Change-Id: I5343382f412251aebd0c56670918a96bf871aff0
2020-01-07 03:42:56 +00:00
markchien
d67c55642e Remove FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT in tethering
Tethering is started after system ready that AMS is ready to deal with
intent broadcast, mProcessesReady is true.

Bug: 143195885
Test: build, flash, boot
Change-Id: Ib9a6008654267b6d0fca78923247c336e90b5534
2020-01-06 14:42:52 +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
paulhu
8224d9f2af Migrate tethering notification resources
Migrate the resources which are only used by tethering notification
from framework/base/core/res to tethering package resource
folder.

Bug: 122085773
Bug: 139763854
Test: build pass
Change-Id: I832103090d500fd8e2e2efb9dc7151426da3f88d
Merged-In: I832103090d500fd8e2e2efb9dc7151426da3f88d
2019-12-04 14:29:38 +08:00
paulhu
0988213c60 Migrate tethering notification resources
Migrate the resources which are only used by tethering notification
from framework/base/core/res to tethering package resource
folder.

Bug: 122085773
Bug: 139763854
Test: build pass
Change-Id: I832103090d500fd8e2e2efb9dc7151426da3f88d
2019-12-03 02:32:06 +00: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
markchien
6aa388904e [Tether06] Migrate tether offload controller into module
The tether offload JNI library in this patch still have many dependencies
with internal libraries. Will have follow up changes to cut the
dependencies to let it be a unbundled library.

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

Change-Id: Iacf8e0b94135e35672de3ee77c474ee39a00c591
2019-11-05 12:49:50 +09:00
markchien
f11a5da0d5 [Tether05] Migrate UpstreamNetworkMonitor into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ic1d9deecb66aaba0a4264a57f2e6579ea491ac9b
2019-10-30 12:42:42 +00:00
markchien
dd6177b501 [Tether04] Migrate EntitlementManager into module
Bug: 136040414
Test: -build, flash, boot
      -atest TetheringTests
      -atest FrameworksNetTests

Change-Id: Ifdfc6cd95377351c37946a146b60896f07ece59d
Merged-In: Ifdfc6cd95377351c37946a146b60896f07ece59d
2019-10-30 11:06:28 +00:00
markchien
74a4fa9b37 [Tether03] Migrate IpServer into module
Add IpServer which is used to serve ip configuration, dhcp, dns proxy
and nat for downstream interface.

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

Change-Id: I23652ae0b9509abe7d38da96d523eb22ab00a343
2019-10-24 14:20:52 +08:00
markchien
43e97e01b7 [Tether02] Migrate TetheringConfiguration into module
TetheringConfiguration is a utility class to encapsulate the various
configuration elements.

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

Change-Id: I9434ab213bc5e0fca59f14a6c8cea554abefc3a4
2019-10-24 14:00:05 +08:00