Commit Graph

739 Commits

Author SHA1 Message Date
Paul Hu
2026b5addb Merge "[TNU08] Remove the "tethering is on" notification" am: 3680357420 am: 6296583f61
Change-Id: Ie49b39eaf0170ecb74043dfba2cdc5b115a1477d
2020-04-22 06:05:12 +00:00
Paul Hu
3680357420 Merge "[TNU08] Remove the "tethering is on" notification" 2020-04-22 05:37:17 +00:00
Treehugger Robot
a533866d24 Merge "Retry the call that fetches the tethering offload HAL." am: 70ad9d4161 am: 9a3b6faf37
Change-Id: I4e26a29bcddd04c3f7c93e754637f935746c30ff
2020-04-21 15:16:43 +00:00
Treehugger Robot
70ad9d4161 Merge "Retry the call that fetches the tethering offload HAL." 2020-04-21 14:45:39 +00:00
Lorenzo Colitti
06e440101b Retry the call that fetches the tethering offload HAL.
The CL that moved the initialization of the tethering offload
config HAL from C++ to Java caused the code not to retry
fetching the service if it is not ready when tethering is
started. This is because the C++ version of getService() retries,
but the Java version only retries if getService(true) is called.

Make the new code retry as well.

b/152430668#comment4 asserts that the fetch will be retried only
if the service is installed on the device, so the retries should
be attempted (and thus should not have any startup time impact)
on devices that do not support tethering offload.

Bug: 152430668
Test: builds, boots, tethering offload works
Change-Id: I093f127d90b2aa1b13eb0748378a24726d419472
2020-04-21 22:22:54 +09:00
Philip P. Moltmann
64343b0b8d Set attributionTag for noteOp(WRITE_SETTINGS) calls
Test: atest FrameworksNetTests TetheringTests:TetheringServiceTest
Bug: 136595429
Merged-In: I33f787644c44d7b0e5ce17a433820cfcd985cdfb
Change-Id: Ic3d937e7bb5141798234ed5b2852c1f768e97495
2020-04-20 18:00:03 -07:00
paulhu
57f26333a8 [TNU08] Remove the "tethering is on" notification
All carriers discarded the requirement to put up a standing
notification when tethering is on. Thus, remove the "tethering
is on" notification.

Bug: 154438388
Test: atest TetheringTests
Change-Id: Ife3915837b6b7b83d3eaaa84b71b6409ff37b71c
2020-04-20 16:10:08 +08:00
Chalard Jean
4580c83253 [TNU06] Add roaming notification
Warn user of potential data charges if the backhaul is
cellular and user is roaming.

Bug: 145629001
Test: atest TetheringTests
Change-Id: I74b4f87c2f6aad09e05d3f2a779f880396885953
Merged-In: I74b4f87c2f6aad09e05d3f2a779f880396885953
(cherry picked from commit 1af69e5b8f339bde5b70886d80960ce22c847245, aosp/1237026)
2020-04-17 17:14:12 +00:00
Chalard Jean
bc380e0215 Merge "[TNU06] Add roaming notification" am: 565160c302 am: 8f365b0b13
Change-Id: Ia02ca67be0a103e980be6a4c7a0ed66836716d51
2020-04-17 16:28:53 +00:00
paulhu
1f66261a3c [TNU06] Add roaming notification
Warn user of potential data charges if the backhaul is
cellular and user is roaming.

Bug: 145629001
Test: atest TetheringTests
Change-Id: I74b4f87c2f6aad09e05d3f2a779f880396885953
2020-04-17 21:25:54 +08:00
Paul Hu
5e9c40c012 [TNU05.1] Address aosp/1237036 leftover comments
Bug: 147818698
Test: atest TetheringTests
Change-Id: Ife738339aeae00d2063fea6918b50204daef24fc
Merged-In: Ife738339aeae00d2063fea6918b50204daef24fc
(cherry picked from commit c638ae6436509df092ab8814bb5b64591878229d, aosp/1287133)
2020-04-16 16:51:00 +00:00
Mark Chien
f9a1c42408 Merge "Remove sendMessage inside EntitlementManager" into rvc-dev 2020-04-16 09:57:22 +00:00
Paul Hu
eef15b96ac Merge "[TNU05.1] Address aosp/1237036 leftover comments" am: 14fb7f6fac am: a91e5e5da6
Change-Id: I56a0ce98beed6797486e26a5148ee3685a3ae0ef
2020-04-16 09:04:57 +00:00
Paul Hu
14fb7f6fac Merge "[TNU05.1] Address aosp/1237036 leftover comments" 2020-04-16 08:25:24 +00:00
Mark Chien
30c0da71b0 Remove sendMessage inside EntitlementManager
EntitlementManager and its callers(Tethering and UpstreamNetworkMonitor)
run in the same threads.

Bug: 141256482
Test: atest TetheringTests
Merged-In: I0a376d28b123eaab2e8d00a98a4719ce983d3bb2
Change-Id: I0a376d28b123eaab2e8d00a98a4719ce983d3bb2
2020-04-16 08:08:04 +00:00
Paul Hu
af6a2a33f5 [TNU05] Add no upstream notification
Reminder user of unavailable tethering status if there is no
internet access.

Bug: 147818698
Test: atest TetheringTests
Change-Id: Ic6557f9f7703337596100cd6a477fd7239217166
Merged-In: Ic6557f9f7703337596100cd6a477fd7239217166
(cherry picked from commit ac1b098acc504b60e85b3dcd22941f4e293865ae, aosp/1237036)
2020-04-16 06:43:19 +00:00
paulhu
1317e27e91 [TNU05.1] Address aosp/1237036 leftover comments
Bug: 147818698
Test: atest TetheringTests
Change-Id: Ife738339aeae00d2063fea6918b50204daef24fc
2020-04-16 14:39:12 +08:00
Mark Chien
d8a80a418d Merge "Remove sendMessage inside EntitlementManager" am: b4624df935 am: 2acc78a6a9
Change-Id: Ia582129af14366051e81f3d5b77cb018f453a2ee
2020-04-16 02:47:22 +00:00
Mark Chien
8c98b3d35e Do not stop IpServer when recieve wifi ap disabling state.
This is used to fix the race when quickly OFF/ON wifi tethering.
When IpServer is started/stopped, there is callback update tethering
interface status. Before this change, IpServer is stopped when wifi
ap is disabling. Then the next startTethering may fail in wifi because
wifi is in disabling state.
Error pattern: WifiService: Tethering is already active.
No unitest for this CL but it fixed the CtsTetheringTest flakty rate
than around 30% to 0 for more than 100 runs.

Bug: 153925821
Test: atest CtsTetheringTest --iteration 100
Merged-In: I8b65f621abe20799a3a0d410ba1f06368746ee49
Change-Id: I8b65f621abe20799a3a0d410ba1f06368746ee49
2020-04-16 02:09:48 +00:00
Mark Chien
b4624df935 Merge "Remove sendMessage inside EntitlementManager" 2020-04-16 02:07:55 +00:00
Paul Hu
7c789f41eb Merge "[TNU05] Add no upstream notification" am: b353c7eac3 am: 7cda806393
Change-Id: Ib65eeed784189e669cc5c22537671deb8d35a9e5
2020-04-16 01:59:03 +00:00
Paul Hu
b353c7eac3 Merge "[TNU05] Add no upstream notification" 2020-04-16 01:31:06 +00:00
Mark Chien
b90f7a5c5c Merge "Do not stop IpServer when recieve wifi ap disabling state." am: 197e35198d am: 7018843a2e
Change-Id: Ia0e60d2e72e2fe94ea14e30cb80a4c24e9b7b75c
2020-04-15 17:28:27 +00:00
markchien
a1a0be93f0 Remove sendMessage inside EntitlementManager
EntitlementManager and its callers(Tethering and UpstreamNetworkMonitor)
run in the same threads.

Bug: 141256482
Test: atest TetheringTests
Change-Id: I0a376d28b123eaab2e8d00a98a4719ce983d3bb2
2020-04-15 02:29:21 +00:00
paulhu
648fc2c8ea [TNU05] Add no upstream notification
Reminder user of unavailable tethering status if there is no
internet access.

Bug: 147818698
Test: atest TetheringTests
Change-Id: Ic6557f9f7703337596100cd6a477fd7239217166
2020-04-15 01:25:37 +08:00
markchien
1acfb0125c Change tethering file structure to respect its package name
Bug: 145099347
Test: atest TetheringTests
      atest CtsTetheringTest
Change-Id: I544ab9480bbaa5e18e030d21a28ab4c4a7265795
2020-04-14 12:25:03 +00:00
markchien
bdf1003c3b Do not stop IpServer when recieve wifi ap disabling state.
This is used to fix the race when quickly OFF/ON wifi tethering.
When IpServer is started/stopped, there is callback update tethering
interface status. Before this change, IpServer is stopped when wifi
ap is disabling. Then the next startTethering may fail in wifi because
wifi is in disabling state.
Error pattern: WifiService: Tethering is already active.
No unitest for this CL but it fixed the CtsTetheringTest flakty rate
than around 30% to 0 for more than 100 runs.

Bug: 153925821
Test: atest CtsTetheringTest --iteration 100
Change-Id: I8b65f621abe20799a3a0d410ba1f06368746ee49
2020-04-14 10:42:32 +00:00
Lorenzo Colitti
6f532ba30f Don't crash when receiving an RTM_DELNEIGH or NUD_FAILED.
These events don't have MAC addresses, so the code attempts to
create an Ipv6ForwardingRule with a null MAC address. This
crashes when attempting to get the raw MAC address bytes to send
to netd in the TetherOffloadRuleParcel.

This was not caught by unit tests because the test exercise this
code path in a way that is not correct (by sending RTM_DELNEIGH
and NUD_FAILED events with MAC addresses). Fix the unit tests to
properly pass in null MAC addresses for these events.

Bug: 153697068
Test: fixed existing tests to be more realistic
Merged-In: I26d89a81f1c448d9b4809652b079a5f5eace3924
Change-Id: I26d89a81f1c448d9b4809652b079a5f5eace3924
2020-04-14 09:55:17 +00:00
Lorenzo Colitti
dd43e05b6e Merge "Don't crash when receiving an RTM_DELNEIGH or NUD_FAILED." am: 941a53ce91 am: 81dd21611d
Change-Id: Ie7060e6408acd73f1a5d2456d030a1958df32847
2020-04-14 09:21:19 +00:00
Lorenzo Colitti
941a53ce91 Merge "Don't crash when receiving an RTM_DELNEIGH or NUD_FAILED." 2020-04-14 08:22:30 +00:00
markchien
7dc2dcc37a Change tethering file structure to respect its package name
Bug: 145099347
Test: atest TetheringTests
      atest CtsTetheringTest
Change-Id: I7401c550fbafd17a5ed2d925b5d0e17e358af467
Merged-In: I7401c550fbafd17a5ed2d925b5d0e17e358af467
2020-04-14 14:33:45 +08:00
Lorenzo Colitti
330a9b9fa7 Don't crash when receiving an RTM_DELNEIGH or NUD_FAILED.
These events don't have MAC addresses, so the code attempts to
create an Ipv6ForwardingRule with a null MAC address. This
crashes when attempting to get the raw MAC address bytes to send
to netd in the TetherOffloadRuleParcel.

This was not caught by unit tests because the test exercise this
code path in a way that is not correct (by sending RTM_DELNEIGH
and NUD_FAILED events with MAC addresses). Fix the unit tests to
properly pass in null MAC addresses for these events.

Bug: 153697068
Test: fixed existing tests to be more realistic
Change-Id: I26d89a81f1c448d9b4809652b079a5f5eace3924
2020-04-14 15:02:17 +09:00
markchien
d995566700 Change tethering file structure to respect its package name
Bug: 145099347
Test: atest TetheringTests
      atest CtsTetheringTest
Change-Id: I7401c550fbafd17a5ed2d925b5d0e17e358af467
2020-04-14 02:09:51 +00:00
Treehugger Robot
5da1070d8f Assign specific client address to dhcp server
Bug: 141256482
Test: manual
      atest TetheringTests

Merged-In: Ief76c98c843ba5420224cbf0f34464f366c891b7
Change-Id: Ief76c98c843ba5420224cbf0f34464f366c891b7
2020-04-10 10:03:20 +00:00
Paul Hu
aaf92e5165 Merge "Fix EntitlementManager issues" into rvc-dev 2020-04-07 04:37:30 +00:00
Xiao Ma
210adac5fa Merge "Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic." into rvc-dev 2020-04-07 02:50:41 +00:00
Xiao Ma
06c8ba0cd7 Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic.
Bug: 130741856
Test: atest TetheringTests
Merged-In: I66614fbf67fba1e7dab0b8a2d41bc30a726e4f38
Change-Id: I66614fbf67fba1e7dab0b8a2d41bc30a726e4f38
2020-04-07 01:26:50 +00:00
Paul Hu
bd8d7a8208 Fix EntitlementManager issues
1. Add TETHERING_ETHERNET to vaild downstream type. So starting
   ethernet tethering will do entitlement check as well.
2. Ignore request with invalid downstream type on
   handleRequestLatestTetheringEntitlementValue()

Bug: 152828758
Bug: 152828142
Test: atests TetheringTests CtsTetheringTest

Change-Id: Id0cb59cc4681f5ffbde7be54de05a05e46f0ffb8
Merged-In: Id0cb59cc4681f5ffbde7be54de05a05e46f0ffb8
(cherry picked from commit c502e050fd9543e8bde45014dd66ea1be91c90ef)
2020-04-07 01:23:49 +00:00
Lorenzo Colitti
e6107d2466 Migrate to TetherOffloadRuleParcel in IpServer
The netd tethering offload IPCs are changing from taking a list
of primitives to taking a TetherOffloadRuleParcel. Modify their
only caller.

Bug: 140541991
Test: atest IpServerTest
Merged-In: I83718c80ef9d31199c87021b4dd5821717fd5ba5
Change-Id: I83718c80ef9d31199c87021b4dd5821717fd5ba5
2020-04-06 15:45:58 +00:00
Xiao Ma
9558865f76 Merge "Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic." am: a73e5c5c18 am: d0b65f11be
Change-Id: Ib5be6794077c5e932fdf4bfc93fab822e6cb70d7
2020-04-06 11:24:48 +00:00
Xiao Ma
a73e5c5c18 Merge "Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic." 2020-04-06 10:43:28 +00:00
Lorenzo Colitti
dc25174ebe Merge "Migrate to TetherOffloadRuleParcel in IpServer" am: b22a70d7c8 am: 2aea86b521
Change-Id: I8257dacfb734e03b52d447a0b658ce372eb46fb0
2020-04-06 09:19:57 +00:00
Lorenzo Colitti
b22a70d7c8 Merge "Migrate to TetherOffloadRuleParcel in IpServer" 2020-04-06 08:40:51 +00:00
Paul Hu
784b7a6925 Merge "Fix EntitlementManager issues" am: 943af02d92 am: 7f05bb9b2d
Change-Id: I0fef76b2fa00757afc1db9a073ad9e912ca98b19
2020-04-06 08:33:31 +00:00
Paul Hu
943af02d92 Merge "Fix EntitlementManager issues" 2020-04-06 07:33:26 +00:00
Xiao Ma
49889dd4c0 Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic.
Bug: 130741856
Test: atest TetheringTests
Change-Id: I66614fbf67fba1e7dab0b8a2d41bc30a726e4f38
2020-04-06 15:59:22 +09:00
Lorenzo Colitti
beb28405b1 Migrate to TetherOffloadRuleParcel in IpServer
The netd tethering offload IPCs are changing from taking a list
of primitives to taking a TetherOffloadRuleParcel. Modify their
only caller.

Bug: 140541991
Test: atest IpServerTest
Change-Id: I83718c80ef9d31199c87021b4dd5821717fd5ba5
2020-04-04 16:24:58 +09:00
paulhu
4175676eab Fix EntitlementManager issues
1. Add TETHERING_ETHERNET to vaild downstream type. So starting
   ethernet tethering will do entitlement check as well.
2. Ignore request with invalid downstream type on
   handleRequestLatestTetheringEntitlementValue()

Bug: 152828758
Bug: 152828142
Test: atests TetheringTests CtsTetheringTest

Change-Id: Id0cb59cc4681f5ffbde7be54de05a05e46f0ffb8
2020-03-31 18:01:54 +08:00
Treehugger Robot
a3fbca5f60 Merge "Assign specific client address to dhcp server" am: 037becbf64 am: 815ab636c3
Change-Id: Ia0e4a913faa5eac5d5ccba837eb7774d59670d27
2020-03-30 04:23:55 +00:00
Treehugger Robot
037becbf64 Merge "Assign specific client address to dhcp server" 2020-03-30 03:38:46 +00:00