Commit Graph

377 Commits

Author SHA1 Message Date
Nucca Chen
6151bb7aed Merge changes I2d6f80f0,I9c26852d am: 50522024a1
Change-Id: I584138925bf090c1c4b600fc2327220d7e5e39c9
2020-05-12 11:24:05 +00:00
Nucca Chen
50522024a1 Merge changes I2d6f80f0,I9c26852d
* changes:
  Use device option to control BPF offload features
  Add tether BPF offload config to device config and resource
2020-05-12 11:00:04 +00:00
Treehugger Robot
2e6ffb2465 Merge "InProcessTethering: set min_sdk_version" am: 932b0b27b6
Change-Id: I0a824c6f6cc10faf3ced1135ab288c2ff2e94e8b
2020-05-11 09:34:42 +00:00
Jooyung Han
482af2e2e8 InProcessTethering: set min_sdk_version
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

InProcessTethering is a part of com.android.tethering.inprocess,
therefore min_sdk_version is set.

Bug: 145796956
Bug: 150999716
Test: m
Change-Id: I655211e0b9aa4bd7cb3718b6f567f0aa1a0176a5
2020-05-11 13:18:29 +09:00
Mark Chien
ec7cf5e356 Merge "Allow to exempt from entitlement check" am: 469314ecc8
Change-Id: I1252b9670efa16118d428cda2ab94e2dca757090
2020-05-08 12:29:58 +00:00
Treehugger Robot
b8345314d8 Merge "Override tethering module APK-in-APEX for Go variant" am: bfd392c4c0
Change-Id: Iff6db0c1f58356a0e573654175c3780b8fa09a66
2020-05-08 12:29:38 +00:00
Mark Chien
469314ecc8 Merge "Allow to exempt from entitlement check" 2020-05-08 12:28:06 +00:00
Treehugger Robot
bfd392c4c0 Merge "Override tethering module APK-in-APEX for Go variant" 2020-05-08 12:11:47 +00:00
markchien
f5078f489d Allow to exempt from entitlement check
To exempt from entitlement check, caller need to hold TETHER_PRIVILEGED
permission.

Bug: 141256482
Test: atest TetheringTests

Change-Id: I2eb37f5e92f5f5150a7fb7c25b945e28704d27a0
2020-05-08 18:55:26 +08:00
Mark Chien
b51ef98b86 Merge "Address the comment of aosp/1288493" am: 974d6f5978
Change-Id: I706462c5dc4a0dbd4b921f2c446a13b1b408948a
2020-05-08 10:45:12 +00:00
Mark Chien
974d6f5978 Merge "Address the comment of aosp/1288493" 2020-05-08 10:30:49 +00:00
Jooyung Han
e25536866e Merge "Set min_sdk_version for updatable mainline modules" am: 50f4887299
Change-Id: I30b90b19967d2a4cd8e283420f856816c3e4bbb4
2020-05-08 09:04:30 +00:00
Jooyung Han
50f4887299 Merge "Set min_sdk_version for updatable mainline modules" 2020-05-08 08:45:49 +00:00
markchien
147e5765ee Address the comment of aosp/1288493
Bug: 141256482
Test: atest TetheringTests
Change-Id: I0cf337625cee31a47879c59e9b18657ea7624eb4
2020-05-08 15:51:52 +08:00
Mark Chien
407c3afa4a Merge "Refactor the EntitlementManager" am: 581afa0bfa
Change-Id: I20f7b03356592cd184b695e4ceb491d4b04cde14
2020-05-07 11:19:16 +00:00
Mark Chien
581afa0bfa Merge "Refactor the EntitlementManager" 2020-05-07 11:14:40 +00:00
Jeongik Cha
d12236a66f Merge "Use stable networkstack-aidl-interfaces" am: 3a22b81ccf
Change-Id: I278f01d4c8e31913bbc1151bd4733ff8158111d0
2020-05-07 11:12:50 +00:00
Jeongik Cha
3a22b81ccf Merge "Use stable networkstack-aidl-interfaces" 2020-05-07 10:59:05 +00:00
Jooyung Han
8182d8bd56 Set min_sdk_version for updatable mainline modules
Modules contributing mainline modules (APK/APEX) should set
min_sdk_version as well as apex_available.

For now setting min_sdk_version doesn't change build outputs.
But build-time checks will be added soon.

Bug: 145796956
Bug: 150999716
Test: m
Change-Id: Ifaecb49a47a1f43edea3ea06e1cf704a177d1044
2020-05-07 17:30:00 +09:00
markchien
dbaff66f45 Override tethering module APK-in-APEX for Go variant
Bug: 155604224
Test: build
Change-Id: I4147173b5f3668491ff9cb7f1f86715b036d6d4b
Merged-In: I4147173b5f3668491ff9cb7f1f86715b036d6d4b
2020-05-07 06:35:05 +00:00
Mark Chien
3369043fca Merge "Test tethering log dump" am: 0e3371469e
Change-Id: I3218a3c600ffc4be33a660362cbb5dd001437171
2020-05-07 03:26:47 +00:00
Mark Chien
0e3371469e Merge "Test tethering log dump" 2020-05-07 03:09:11 +00:00
markchien
146f6055bd Test tethering log dump
Bug: 145490751
Test: atest TetheringTests
Change-Id: I01fc6969041711f7a15880144ee5eac591086ecd
2020-05-06 17:00:37 +08:00
Anton Hansson
1af24fa462 Merge "Rename module dist files" am: b098442b7b
Change-Id: Ibe316eef17d3efb90d68182b0f92f8b18aaecde5
2020-05-05 14:07:08 +00:00
Anton Hansson
b098442b7b Merge "Rename module dist files" 2020-05-05 13:45:03 +00:00
Junyu Lai
6848610485 Merge "[SP18.6] Make offload controller poll interval configurable" am: 10c8c21777
Change-Id: I30ad758e9c36f39eea7851237ca5ba008d3d9d4d
2020-05-05 10:17:49 +00:00
Hungming Chen
3d8fa889b4 Use device option to control BPF offload features
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
2020-05-05 17:43:50 +08:00
Hungming Chen
8bf2e7e05b Add tether BPF offload config to device config and resource
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
2020-05-05 17:37:32 +08:00
junyulai
5475504266 [SP18.6] Make offload controller poll interval configurable
Test: atest TetheringTests
Bug: 149467454

Change-Id: I0b07a0b520dedb479bf863fbfe898ae85b84b0f3
2020-05-05 11:45:36 +08:00
Junyu Lai
c44a1ba581 Merge changes from topic "sp18-TestableNetworkStatsProviderCbBinder" am: 80ab95927b
Change-Id: Ia0f5206e7adc6a8746e68b8ef16e747f11eea97b
2020-05-05 03:30:06 +00:00
Junyu Lai
80ab95927b Merge changes from topic "sp18-TestableNetworkStatsProviderCbBinder"
* changes:
  [SP18.5] Create offload controller poll interval to resource
  [SP18.4] Add unit test for polling network stats in OffloadController
  [SP18.3] Adapt TestableNetworkStatsProviderCbBinder
2020-05-05 03:09:58 +00:00
Jeongik Cha
0630f383af Use stable networkstack-aidl-interfaces
Test: m nothing
Bug: 133526962
Change-Id: I507f40866d04db5ed3361831e01eaa4dfaf20bed
2020-05-04 08:11:26 +00:00
junyulai
9606a22037 [SP18.5] Create offload controller poll interval to resource
Test: atest TetheringConfigurationTest
Bug: 149467454
Change-Id: I8b4ad920a4945504914d3741a9fba5c096fbf452
2020-05-04 14:56:37 +08:00
junyulai
9c50628e95 [SP18.4] Add unit test for polling network stats in OffloadController
Test: atest OffloadControllerTest
Bug: 149467454
Change-Id: I9b9c9c096a2366aaf383d5c2d567db6682f02dad
2020-05-04 14:56:37 +08:00
junyulai
da5dfd9f0d [SP18.3] Adapt TestableNetworkStatsProviderCbBinder
This is a no-op refactoring to adapt new test provider callback.
Also this patch adapts TestLooper to allow better control on
delay messages that will be verified in subsequent tests.

Test: atest OffloadControllerTest
Bug: 149467454
Change-Id: Icfd6ff289d6689ae2d5753d3fe472516c808dc7a
2020-05-04 14:56:36 +08:00
Anton Hansson
6439512cc7 Merge "Fix tethering module lib stub default" am: d2ec5841fb
Change-Id: I11beafef884cb097ac85fab0b8e175d47a76813c
2020-05-01 09:13:22 +00:00
Anton Hansson
d2ec5841fb Merge "Fix tethering module lib stub default" 2020-05-01 08:58:26 +00:00
Treehugger Robot
b518fd475c [automerger skipped] Merge "Import translations. DO NOT MERGE" am: 5f2cebc10a -s ours
am skip reason: subject contains skip directive

Change-Id: Iec96a2a81d4ad75c01c22bf1ff7b73991816155e
2020-05-01 00:10:04 +00:00
Bill Yi
3b1e3d04f6 Import translations. DO NOT MERGE
Auto-generated-cl: translation import
Change-Id: I3b69996ab87b3c9ddeeb5c6166a1256b77f30c12
2020-04-30 15:32:29 -07:00
Anton Hansson
bb5231decc Rename module dist files
This makes the filenames of the disted artifacts (api txts and stubs)
match the module name of the modules they're from. This matches the
naming scheme used by java_sdk_library, which should make the future
transition to this build rule easier.

Bug: 149293194
Test: lunch sdk_phone_armv7 && m sdk dist && find out/dist/apistubs
Change-Id: I076f30931bf2524d57703873cd7de25b3f23b457
Merged-In: I076f30931bf2524d57703873cd7de25b3f23b457
(cherry picked from commit d7f1fabc94)
2020-04-30 20:56:11 +01:00
Anton Hansson
a8f2e3ead5 Fix tethering module lib stub default
It was using the systemapi stub defaults, but should be using the
module_lib default.

Bug: 144149403
Test: m
Change-Id: Iaab154d9d71900284d92d518a086fc1227c00d5c
Merged-In: Iaab154d9d71900284d92d518a086fc1227c00d5c
(cherry picked from commit dc8e0fc1a1)
2020-04-30 17:05:01 +01:00
markchien
33d861e6a7 Refactor the EntitlementManager
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
2020-04-30 14:00:20 +08:00
Treehugger Robot
30af8e6201 Merge "[SP18.1] add dependency object to OffloadController" am: c75f373448
Change-Id: I02c648e4ec802e738d311f5996cb3cd053f58478
2020-04-29 12:25:36 +00:00
Treehugger Robot
c75f373448 Merge "[SP18.1] add dependency object to OffloadController" 2020-04-29 12:08:22 +00:00
Junyu Lai
73cfbe504e Merge "[SP18] Poll network stats in OffloadController to support data warning" am: d25d88199f
Change-Id: I16e45c86f4f7c5654dd0061c6fdb3fbf66986124
2020-04-29 11:19:40 +00:00
Junyu Lai
d25d88199f Merge "[SP18] Poll network stats in OffloadController to support data warning" 2020-04-29 11:01:56 +00:00
junyulai
360c88f238 [SP18.1] add dependency object to OffloadController
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
2020-04-28 18:27:57 +08:00
junyulai
607fa9efea [SP18] Poll network stats in OffloadController to support data warning
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
2020-04-28 18:27:57 +08:00
Mark Chien
cdee1cfe24 Merge "Remove Preconditions usage to stop dependecy with non-updatble class" am: 821089e106
Change-Id: Ib101caf06704f74d7721c44ed4f51d396bc0a4e8
2020-04-27 11:02:19 +00:00
Mark Chien
821089e106 Merge "Remove Preconditions usage to stop dependecy with non-updatble class" 2020-04-27 10:54:19 +00:00