Commit Graph

214 Commits

Author SHA1 Message Date
Treehugger Robot
01ae289b3d Merge "Retry the call that fetches the tethering offload HAL." am: 094eafd471 am: 4664c0033e
Change-Id: I4e26a29bcddd04c3f7c93e754637f935746c30ff
2020-04-21 15:16:43 +00:00
Treehugger Robot
094eafd471 Merge "Retry the call that fetches the tethering offload HAL." 2020-04-21 14:45:39 +00:00
Lorenzo Colitti
e87bf543fb 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
Chalard Jean
0e73340084 Merge "[TNU06] Add roaming notification" am: 565160c302 am: cb8aaf7123
Change-Id: Ia02ca67be0a103e980be6a4c7a0ed66836716d51
2020-04-17 16:28:53 +00:00
paulhu
f98918fc2c [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
fc5e8196c9 Merge "[TNU05.1] Address aosp/1237036 leftover comments" am: 0ca532a78c am: 130ce39732
Change-Id: I56a0ce98beed6797486e26a5148ee3685a3ae0ef
2020-04-16 09:04:57 +00:00
Paul Hu
0ca532a78c Merge "[TNU05.1] Address aosp/1237036 leftover comments" 2020-04-16 08:25:24 +00:00
paulhu
dc5c86ddd9 [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
1cf03a9d5e Merge "Remove sendMessage inside EntitlementManager" am: c826614862 am: 920af5bc91
Change-Id: Ia582129af14366051e81f3d5b77cb018f453a2ee
2020-04-16 02:47:22 +00:00
Mark Chien
c826614862 Merge "Remove sendMessage inside EntitlementManager" 2020-04-16 02:07:55 +00:00
Paul Hu
ae92667709 Merge "[TNU05] Add no upstream notification" am: cef08983cf am: eabd2c388f
Change-Id: Ib65eeed784189e669cc5c22537671deb8d35a9e5
2020-04-16 01:59:03 +00:00
Paul Hu
cef08983cf Merge "[TNU05] Add no upstream notification" 2020-04-16 01:31:06 +00:00
Mark Chien
ac468a11d7 Merge "Do not stop IpServer when recieve wifi ap disabling state." am: 197e35198d am: 46061cdb7a
Change-Id: Ia0e60d2e72e2fe94ea14e30cb80a4c24e9b7b75c
2020-04-15 17:28:27 +00:00
markchien
f4b6ca7ac9 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
481512a6b0 [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
3086b477d5 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
714e647af3 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
8cedb513b6 Merge "Don't crash when receiving an RTM_DELNEIGH or NUD_FAILED." am: 17917f7bb0 am: 54d650a492
Change-Id: Ie7060e6408acd73f1a5d2456d030a1958df32847
2020-04-14 09:21:19 +00:00
Lorenzo Colitti
17917f7bb0 Merge "Don't crash when receiving an RTM_DELNEIGH or NUD_FAILED." 2020-04-14 08:22:30 +00:00
Lorenzo Colitti
210ac1e145 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
711d8b4e4a 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
Xiao Ma
0ca38750ed Merge "Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic." am: 4af7c5e2cb am: 64a5d7989b
Change-Id: Ib5be6794077c5e932fdf4bfc93fab822e6cb70d7
2020-04-06 11:24:48 +00:00
Xiao Ma
4af7c5e2cb Merge "Rename IDhcpLeaseCallbacks to IDhcpEventCallbacks for more generic." 2020-04-06 10:43:28 +00:00
Lorenzo Colitti
81bdec9867 Merge "Migrate to TetherOffloadRuleParcel in IpServer" am: 74107e4dd1 am: d1c693e740
Change-Id: I8257dacfb734e03b52d447a0b658ce372eb46fb0
2020-04-06 09:19:57 +00:00
Lorenzo Colitti
74107e4dd1 Merge "Migrate to TetherOffloadRuleParcel in IpServer" 2020-04-06 08:40:51 +00:00
Paul Hu
a6f442db97 Merge "Fix EntitlementManager issues" am: 14a8cf0f5e am: 633130f68f
Change-Id: I0fef76b2fa00757afc1db9a073ad9e912ca98b19
2020-04-06 08:33:31 +00:00
Paul Hu
14a8cf0f5e Merge "Fix EntitlementManager issues" 2020-04-06 07:33:26 +00:00
Xiao Ma
31853376a4 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
dbd215ede1 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
0ab66f6cd0 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
d187ac9cec Merge "Assign specific client address to dhcp server" am: 390f5b3bec am: 02fb8acf27
Change-Id: Ia0e4a913faa5eac5d5ccba837eb7774d59670d27
2020-03-30 04:23:55 +00:00
Treehugger Robot
390f5b3bec Merge "Assign specific client address to dhcp server" 2020-03-30 03:38:46 +00:00
Remi NGUYEN VAN
c6ab1a994f Merge "Create a builder for NetworkCapabilities." 2020-03-30 02:58:45 +00:00
Mark Chien
6e85472ee7 Merge "Register callback and receiver after tethering is created" am: 8211dbba72 am: 5a52d0c4d7
Change-Id: Ifc4846347326ce5e18a2f8f1ac060febc0cbd486
2020-03-27 08:55:32 +00:00
Mark Chien
8211dbba72 Merge "Register callback and receiver after tethering is created" 2020-03-27 08:31:11 +00:00
markchien
031d34c1f6 Register callback and receiver after tethering is created
Tethering service is created after boot complete which means most of
the services are ready before tethering. Once tethering register the
callback, callback event may come-in immediately. Make sure all of
tethering related object is created, then register the callback,
receiver, or listener.

Bug: 149965121
Test: atest TetheringTests
      manual on/off tethering

Change-Id: I3941a186770679e7b476073d774e2310e25e44c6
2020-03-27 08:13:28 +00:00
Treehugger Robot
3984360f64 Merge "Update connected clients when a downstream disappears." am: 5c1ded75db am: 182a648bb1
Change-Id: I542acb7f50b1891b89f5fe495c3f58456dbd8d91
2020-03-25 15:32:41 +00:00
Treehugger Robot
5c1ded75db Merge "Update connected clients when a downstream disappears." 2020-03-25 15:00:43 +00:00
Lorenzo Colitti
fc6e7252c4 Update connected clients when a downstream disappears.
Otherwise, if another downstream of the same type reappears, the
code would fire a callback with the previous list of clients.

Bug: 150644681
Test: atest TetheringIntegrationTests:EthernetTetheringTest --rerun-until-failure 100
Change-Id: I6b34ea747ae1831001077f44879bb6828dcecc96
2020-03-25 22:14:46 +09:00
Paul Hu
2716152cc2 Merge "[TNU04] Add tethering restricted notification" am: d91b3319e5 am: 3eea7b199e
Change-Id: Iad59bdf6b3c5b3ce059d7c01c7396866aab85767
2020-03-25 12:03:10 +00:00
Paul Hu
d91b3319e5 Merge "[TNU04] Add tethering restricted notification" 2020-03-25 11:30:41 +00:00
Paul Hu
4f4440f8f7 Merge "[TNU03] Add TetheringNotificationUpdaterTest" am: 35cae460e4 am: 1132f5cdaf
Change-Id: I1085dceb190b32122416d0240275d7ecb81aa627
2020-03-25 07:15:31 +00:00
Paul Hu
35cae460e4 Merge "[TNU03] Add TetheringNotificationUpdaterTest" 2020-03-25 06:45:14 +00:00
Paul Hu
a2de1e7135 Merge "[TNU02] Update tethering notification by active data subid" am: ab29d21f93 am: e4507ebfab
Change-Id: I2e1555972d9217fa689b10b23525fa5ba12c373b
2020-03-25 05:37:05 +00:00
Paul Hu
ab29d21f93 Merge "[TNU02] Update tethering notification by active data subid" 2020-03-25 04:53:32 +00:00
Chalard Jean
9274cc5057 Create a builder for NetworkCapabilities.
Bug: 151322799
Test: FrameworksWifiTests
Change-Id: I69c00c9e3963950e55d7105d8825f7d3a3ec9b2f
Merged-In: I06eb97e50d5583579b3c26d1365d2dbaec8bfc99
(cherry picked from commit 9771f34dae9cdeb857636cac2b3c2d473713914e)
2020-03-25 13:27:04 +09:00
Chalard Jean
b2b692e157 Merge "Expose netId by adding getter API" 2020-03-25 02:23:03 +00:00
Treehugger Robot
e6b8ded812 Merge "Add a log message if enabling Ethernet tethering if it is already enabled." am: abe9621f7f am: ee5c1678a6
Change-Id: Ibe0d3567185b4dfbfd73d085080ca90594120c1f
2020-03-24 15:23:51 +00:00
Lorenzo Colitti
2688e9f238 Add a log message if enabling Ethernet tethering if it is already enabled.
Test: builds
Bug: 150644681
Change-Id: I68123e6dd04ccae5da2ecd7526c11d9f835d1d57
2020-03-24 13:28:53 +00:00
markchien
b6858e5919 Expose netId by adding getter API
Bug: 151156820
Test: m
      atest TetetheringTests

Clean CP from ag/10747732

Change-Id: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899
Merged-In: Ieb1483c146aa2f7d8f251157e6e81d71c44ae899
2020-03-24 09:19:26 +00:00