To exempt from entitlement check, caller need to hold TETHER_PRIVILEGED
permission.
Bug: 141256482
Test: atest TetheringTests
Change-Id: I2eb37f5e92f5f5150a7fb7c25b945e28704d27a0
1. Change ArraySet usage to BitSet
2. Change mCellularUpstreamPermitted to mLastCellularUpstreamPermitted.
Before this change:
a member variable(mCellularUpstreamPermitted) is
used to check whether cellular upstream is permitted, the code must
ensure to update this variable once entitlement result is changed or the
entitlement check is triggered but does not have a result yet.
In this change:
Instead of storing the information about whether cellular is permitted in
a member variable. The information is recalculated every time when user
call isCellularUpstreamPermitted(). Now isCellularUpstreamPermitted() is
always be used to check whether cellular upstream is permitted no matter
inside or outside EntitlementManager.
This make the code be easier to maintain that we do not need to care
when mCellularUpstreamPermitted need to be updated because the
information would be recalculated every time. And the recalculation is
lock free because this is only used inside tethering while running in
the same thread.
Bug: 141256482
Test: atest TetheringTests
Merged-In: Ic83f42ff4eec38adf039d55d80fcb9b0f16373cc
Change-Id: Ic83f42ff4eec38adf039d55d80fcb9b0f16373cc
If BPF offload device config is not enabled:
- Does not add/remove offload forwarding rules through disabling IP
neighbor monitor.
- Does not apply the RA MTU reduction.
Bug: 149997301
Test: atest IpServerTest
Change-Id: I2d6f80f0229f580c4b16243a064e889a6c37f77a
The tether bpf offload can be enabled by resource config and
device config. The device config has higher priority and it
could override this config which is set by resource config.
Bug: 149997301
Test: -build, flash, boot
-atest TetheringConfigurationTest
Change-Id: I9c26852d2c926786e141ece6da53df3801c049b2
1. Change ArraySet usage to BitSet
2. Change mCellularUpstreamPermitted to mLastCellularUpstreamPermitted.
Before this change:
a member variable(mCellularUpstreamPermitted) is
used to check whether cellular upstream is permitted, the code must
ensure to update this variable once entitlement result is changed or the
entitlement check is triggered but does not have a result yet.
In this change:
Instead of storing the information about whether cellular is permitted in
a member variable. The information is recalculated every time when user
call isCellularUpstreamPermitted(). Now isCellularUpstreamPermitted() is
always be used to check whether cellular upstream is permitted no matter
inside or outside EntitlementManager.
This make the code be easier to maintain that we do not need to care
when mCellularUpstreamPermitted need to be updated because the
information would be recalculated every time. And the recalculation is
lock free because this is only used inside tethering while running in
the same thread.
Bug: 141256482
Test: atest TetheringTests
Change-Id: Ic83f42ff4eec38adf039d55d80fcb9b0f16373cc
In order to mock constant in unit test, a dependency object is
introduced with minimum code change to achieve this.
Test: atest TetheringTests
Bug: 149467454
Change-Id: I38628daddcb7be7c74846e78d36dc88f065b97d9
Merged-In: I38628daddcb7be7c74846e78d36dc88f065b97d9
(cherry picked from commit 29aee20bfa)
The OEM implemented tether offload does not support
data warning since the HAL only tells the hardware about data limit
but not warning. However, to add such interface in HAL needs OEM to
comply and implement in hardware.
Thus, as a short-term solution, polls network statistics from HAL
and notify upper layer when it reaches the alert quota set by
NetworkStatsService.
Note that when CPU is sleeping, the data warning of tethering offload
will not work since the polling is also suspended.
Test: manual
Test: atest OffloadControllerTest
Bug: 149467454
Change-Id: I2467b64779b74cd5fec73b42fb303584f52cb1cb
Merged-In: I2467b64779b74cd5fec73b42fb303584f52cb1cb
(cherry picked from commit 93660e382c)
In order to mock constant in unit test, a dependency object is
introduced with minimum code change to achieve this.
Test: atest TetheringTests
Bug: 149467454
Change-Id: I38628daddcb7be7c74846e78d36dc88f065b97d9
The OEM implemented tether offload does not support
data warning since the HAL only tells the hardware about data limit
but not warning. However, to add such interface in HAL needs OEM to
comply and implement in hardware.
Thus, as a short-term solution, polls network statistics from HAL
and notify upper layer when it reaches the alert quota set by
NetworkStatsService.
Note that when CPU is sleeping, the data warning of tethering offload
will not work since the polling is also suspended.
Test: manual
Test: atest OffloadControllerTest
Bug: 149467454
Change-Id: I2467b64779b74cd5fec73b42fb303584f52cb1cb
Address issues found during AIDL review:
- Rename clientAddr to singleClientAddr
- Do not use a ParcelableBundle for notifyNetworkTested or
notifyDataStallSuspected; instead use AIDL parcelables for stronger
backwards compatibility guarantees.
Test: atest NetworkMonitorTest ConnectivityServiceTest
ConnectivityServiceIntegrationTest, manual
Bug: 153500847
Merged-In: Id9b71784e5f6294d203230e57737979e063ff0f8
Change-Id: Id9b71784e5f6294d203230e57737979e063ff0f8
Stop depending on Preconditions that is not released on the same cadence
as the module, and is maintained as part of the framework.
Bug: 148636687
Test: atest TetheringTests NetworkStackNextTests
Merged-In: Id0dcec44f362f79bc8c046d722635687a7388aa2
Change-Id: Id0dcec44f362f79bc8c046d722635687a7388aa2
Catch NoSuchElementException to unbreak no offload devices.
To consistent with fetching offload config service, retry fetcheing
offload control service.
b/152430668#comment4 assert that the fetch will be retried only
if the service is installed on the device.
Bug: 155026033
Test: run TetheringCoverageTests in virtual devices(do not support
offload)
Merged-In: Ie0a32a9062c722327a27c6de13e3bb8d9588bebb
Change-Id: Ie0a32a9062c722327a27c6de13e3bb8d9588bebb
Catch NoSuchElementException to unbreak no offload devices.
To consistent with fetching offload config service, retry fetcheing
offload control service.
b/152430668#comment4 assert that the fetch will be retried only
if the service is installed on the device.
Bug: 155026033
Test: run TetheringCoverageTests in virtual devices(do not support
offload)
Change-Id: Ie0a32a9062c722327a27c6de13e3bb8d9588bebb
Address issues found during AIDL review:
- Rename clientAddr to singleClientAddr
- Do not use a ParcelableBundle for notifyNetworkTested or
notifyDataStallSuspected; instead use AIDL parcelables for stronger
backwards compatibility guarantees.
Test: atest NetworkMonitorTest ConnectivityServiceTest
ConnectivityServiceIntegrationTest, manual
Bug: 153500847
Change-Id: Id9b71784e5f6294d203230e57737979e063ff0f8
Stop depending on Preconditions that is not released on the same cadence
as the module, and is maintained as part of the framework.
Bug: 148636687
Test: atest TetheringTests NetworkStackNextTests
Change-Id: Id0dcec44f362f79bc8c046d722635687a7388aa2
1. Let restricted notification that can be dismissed.
2. Only put up restricted notification when any of tethering is
activating.
Bug: 154214549
Test: atest TetheringTests
Change-Id: Ib980aca154036828abdab35e3bb11d42f85ff610
Merged-In: Ib980aca154036828abdab35e3bb11d42f85ff610
(cherry picked from commit 2eb66bdbe4, aosp/1290334)
1. Let restricted notification that can be dismissed.
2. Only put up restricted notification when any of tethering is
activating.
Bug: 154214549
Test: atest TetheringTests
Change-Id: Ib980aca154036828abdab35e3bb11d42f85ff610
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
Merged-In: Ife3915837b6b7b83d3eaaa84b71b6409ff37b71c
(cherry picked from commit 0171c07d05dd2625c6dcfd47977a701ddc2d5d36, aosp/1289107)
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
Merged-In: I093f127d90b2aa1b13eb0748378a24726d419472
Change-Id: I093f127d90b2aa1b13eb0748378a24726d419472