Commit graph android_packages_modules_Co.../Tethering
Message SHA1
Merge "Move setupOnce from EthernetTetheringTestBase to EthernetTetheringTest" into main
Mark Chien   authored and   Gerrit Code Review   commited 2024-04-09 07:42:11 +00:00
01e091b1fb
Merge "Tethering: Throw exception when register null callback to avoid a crash" into main
Yuyang Huang   authored and   Gerrit Code Review   commited 2024-04-02 05:45:07 +00:00
c634eb5726
Merge "Allow enable DBG/VDBG without having to rebuild the module." into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-04-02 05:44:35 +00:00
5250ebe96e
Move setupOnce from EthernetTetheringTestBase to EthernetTetheringTest
If we want to get rid of the flakiness, we may need to change the
production code. You can find a more detailed analysis in
b/318121782/comment#4.

Here's a quick and easy alternative fix: just move setupOnce from
EthernetTetheringTestBase to EthernetTetheringTest. The flakiness
started when I added setupOnce into EthernetTetheringTestBase to
fix flakiness in EthernetTetheringTest.

Bug: 318121782
Test: TH
Change-Id: I0a6fb25773aa60872f71fe4b34e42a0b745a767f

Mark Chien   commited 2024-04-02 05:39:51 +00:00
54fa56def5
Allow enable DBG/VDBG without having to rebuild the module.
Check out #isLoggable from frameworks/base/core/java/android/util/Log.java to
learn how to enable the log.

Bug: 329552689
Change-Id: I86ce0dae947cf56da069dfe3145ef074de11217e
Test: TH

Mark Chien   commited 2024-04-02 03:59:35 +00:00
9f69605fa0
Merge "Remove mWifiTetherRequested" into main
Mark Chien   authored and   Gerrit Code Review   commited 2024-04-02 03:20:31 +00:00
4775bb519a
Merge "Obtain BluetoothAdapter through BluetoothManager" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-04-02 02:23:09 +00:00
54c9c90f27
Obtain BluetoothAdapter through BluetoothManager
BluetoothAdapter.getDefaultAdapter is deprecated and should be replaced
with BluetoothManager.

The AttributionSource is not necessarily set properly with
BluetoothAdapter.getDefaultAdapter, and may depend on which package is
returned first by PackageManager.getPackagesForUid. This has been
causing some flaky failures in presubmit.

Fixes: 332225348
Test: atest
Change-Id: I2f066f1a90a3c6fed7885f4bbee870abf96f664d

Remi NGUYEN VAN   commited 2024-04-01 16:35:24 +09:00
9b7fea5eee
Merge "Separate Struct.java into its own lib." into main
Yang Sun   authored and   Gerrit Code Review   commited 2024-03-28 06:23:57 +00:00
68d68d82ed
Separate Struct.java into its own lib.
* Struct.java is removed from net-utils-device-common-bpf and
  net-utils-device-common-struct's source list
* Created a lib net-utils-device-common-struct-base for Struct.java
* Updated libs that require Struct.java to include
  net-utils-device-common-struct-base.
* Replaced net-utils-multicast-forwarding-structs with
  net-utils-device-common-struct in service-connectivity

Bug: 323503345

Test: build tethering module.
Change-Id: I3f60715c3d8043b7569db7612dee9d4fa1ccba59

Yang Sun   commited 2024-03-27 20:15:17 +08:00
3aa62e6773
Remove mWifiTetherRequested
Removing "mWifiTetherRequested" because it might cause Wi-Fi tethering
to not have an upstream if P2P is turned on. The issue could be
recovered when the upstream's capabilities or link properties change,
tethering calls "chooseUpstreamType" to select an upstream. If none of
the above situations happen, Wi-Fi tethering won't have an upstream.

1. When Wifi P2P is enabled and tethering enters TetherModeAliveState.
2. Turning on wifi tethering, TetherModeAliveState would first receive
   EVENT_IFACE_SERVING_STATE_INACTIVE when wifi tethering's IpServer
   is created and enters IpServer's InitialState. Then it will call
   updateUpstreamWanted and change mUpstreamWanted from false to true
   before wifi tethering's IpServer actually enters TetheredState.
3. When TetherModeAliveState receives EVENT_IFACE_SERVING_STATE_ACTIVE,
   which is triggered by wifi tethering's IpServer entering
   TetheredState, it won't call chooseUpstreamType() because
   mUpstreamWanted is already true.
   case EVENT_IFACE_SERVING_STATE_ACTIVE: {
       IpServer who = (IpServer) message.obj;
       if (VDBG) Log.d(TAG, "Tether Mode requested by " + who);
       handleInterfaceServingStateActive(message.arg1, who);
       who.sendMessage(IpServer.CMD_TETHER_CONNECTION_CHANGED,
               mCurrentUpstreamIfaceSet);
       // If there has been a change and an upstream is now
       // desired, kick off the selection process.
       final boolean previousUpstreamWanted = updateUpstreamWanted();
       if (!previousUpstreamWanted && mUpstreamWanted) {
           chooseUpstreamType(true);
       }

mWifiTetherRequested is only used to check upstreamWanted() and only be
used in TetherModeAliveState so that it is
safe to remove mWifiTetherRequested and always use mForwardedDownstreams
to check whether upstream is needed for TetherModeAliveState because all
the Tethered IpServer is added to mForwardedDownstreams when it enter
Tethered State and be removed from mForwardedDownstreams when it exit
Tethered State.

This change also move the upstreamWanted() function inside TetherMainSM
to prevent it from being used incorrectly outside of TetherMainSM.

Bug: 329552689
Test: atest TetheringTests

Change-Id: I6842170f455b280dd79aae039a1117d5e6d677f3

Mark Chien   commited 2024-03-26 08:08:01 +00:00
27d9121ef3
Add a test to catch wifi tethering no upstream bug
If P2P is enabled first then turn on wifi tethering, it doesn't have
upstream.

Bug: 329552689
Test: atest TetheringTests
Change-Id: Ia39031167a3cf7751ae549ea5ce147cb9cb87607

Mark Chien   commited 2024-03-26 06:31:34 +00:00
00b45fc970
[EthernetTetheringTest] Don't run setupOnce() if Ethernet is not
supported.

BUG: 323896172
Test: atest CtsTetheringTest

Change-Id: Ibb01d9783a480f0c4acc9385a04527b95ae15fbb
Signed-off-by: Weilun Du <wdu@google.com>

Weilun Du   commited 2024-03-19 21:24:46 +00:00
2881157a6d
Merge "Do not crash on failures in callbacks" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-15 09:17:09 +00:00
028bf79c22
rename: @btf.o -> @mainline.o
(in prep for these actually being only loaded via mainline netbpfload)

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I9cea40b3d7525aa3ef8fdaad291b27d7d179a1aa

Maciej Żenczykowski   commited 2024-03-12 00:25:11 +00:00
561fb4a975
Merge "Drop platform_apis from android_library" into main am: e2e1dc10a3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2971691

Change-Id: Icdebb4aa6c89fd88124120973045b7530b7f5c64
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-03-04 08:41:41 +00:00
c886abf0ee
Merge "Drop platform_apis from android_library" into main
Treehugger Robot   authored and   Gerrit Code Review   commited 2024-03-04 07:58:11 +00:00
e2e1dc10a3
Merge "Remove unused library visibility" into main am: 2154e525b3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2984492

Change-Id: I743bbcd9adab85c243416f6723fa1560114fe965
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Chiachang Wang   authored and   Automerger Merge Worker   commited 2024-03-04 02:59:53 +00:00
8a7c9f6c5f
Tethering: Throw exception when register null callback to avoid a crash
Register null callback will cause a crash so throw an exception

Test: m, CtsTetheringTest
Change-Id: Id4337328f6793f1436c9d3561960fa69d17d030e

Ding Zhang   commited 2024-03-01 11:42:22 -08:00
52776a3c8c
Merge "Move VpnManagerServiceTest and VpnTest to frameworks" into main am: 0df28d82be
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2981695

Change-Id: I467c5567f18762ef0cdbceb89e725e5c34dbb2c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Chiachang Wang   authored and   Automerger Merge Worker   commited 2024-03-01 01:40:56 +00:00
04e109be0d
Remove unused library visibility
This commit removes the unused library visibility.

The "frameworks/base/packages/Connectivity" folder is the
temporary folder for modulizing the connectivity codes. There is
no such need now.

Test: m
Change-Id: Ia2890fe64c1bc369fcb90be645263bc56c98a7b2

Chiachang Wang   commited 2024-03-01 00:57:52 +00:00
52d329642a
Move VpnManagerServiceTest and VpnTest to frameworks
These unit tests are closely tied to the source code in
frameworks/base and were incorrectly placed in the connectivity
module. Also update the libraries visibility that are used by
the tests.

Test: atest FrameworksNetTests
Change-Id: I196c33a8bd5b5cdb9d42aea381e900681ff6d25e

Chiachang Wang   commited 2024-02-29 07:48:02 +00:00
a5d9875823
Drop platform_apis from android_library
This property is a no-op for this module type.

Test: m nothing
Bug: 215379393
Change-Id: Ib13007e83c0a6263f36f009ba07407d6ccb50e00

Spandan Das   commited 2024-02-21 15:27:22 +00:00
e84353eaf3
Merge "Update flags.aconfig to follow the current APIs" into main am: 1ec06555e1
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2964822

Change-Id: Ie66fb9df8f03e6fcfe4b7177d0105fc0520b783f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Motomu Utsumi   authored and   Automerger Merge Worker   commited 2024-02-19 09:56:16 +00:00
e700f09176
Update flags.aconfig to follow the current APIs
This CL also specifies aconfig_declaration module in java_sdk_library
register_nsd_offload_engine will be moved to the platform flags.aconfig
in the followup CL.

Test: TH
Change-Id: I430a5f0b1e1ef2e3394cf6aa8efebbd46da41765

Motomu Utsumi   commited 2024-02-19 06:58:35 +00:00
52f294cbc4
Merge "Make TetheringRequest parcelable" into main am: 211e7862b6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2953588

Change-Id: Iffe2b1b80bbd7ac18c31fdb2729a817d9e774e48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Quang Luong   authored and   Automerger Merge Worker   commited 2024-02-15 05:20:15 +00:00
73877d7538
Make TetheringRequest parcelable
Make TetheringRequest parcelable so we can pass it via Wifi APIs and map
Soft AP state changes to the correct request.

Bug: 216524590
Test: build
Change-Id: I63a45b14e9abc288b353159dfdcbe96fde485cb7

Quang Anh Luong   commited 2024-02-15 10:15:05 +09:00
1252f7f428
Drop riscv64-specific exclude_jni_libs element am: b1872c83d3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2953800

Change-Id: I2c338609141033481434b1557dcbdf7a05295176
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Nathaniel Manista   authored and   Automerger Merge Worker   commited 2024-02-09 23:47:50 +00:00
2ca4223469
Drop riscv64-specific exclude_jni_libs element
This fulfills a "TODO: remove this when there is a riscv64 libcronet"
because with https://android-review.googlesource.com/2952606 there is
now a RISC-V64 libcronet. 🙂

Bug: 276962315
Change-Id: Ia69657b13a35e47852bf2bc46b2aac95fcf46e0a

Nathaniel Manista   commited 2024-02-09 14:09:22 +00:00
b1872c83d3
Merge "Remove strict_updatability_linting: true" into main am: 1042c175a0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2927772

Change-Id: Ic0832c9ccba9706834124be3bf1f21dc9cf5ad5b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Cole Faust   authored and   Automerger Merge Worker   commited 2024-02-02 19:10:18 +00:00
5af49dc5ac
Merge "Remove strict_updatability_linting: true" into main
Cole Faust   authored and   Gerrit Code Review   commited 2024-02-02 18:21:10 +00:00
1042c175a0
Do not crash on failures in callbacks
Calling fail() in a callback not running in the test thread will crash
the test process, instead of failing the test.

This affects other tests as the whole process dies.

Avoid that by adding errors to a list, which is verified in tearDown().

Test: atest
Change-Id: I354352b61fb1909bcac519bf58d49b36e81c710f

Remi NGUYEN VAN   commited 2024-02-01 14:46:22 +09:00
62b3efbaf9
Merge "netbpfload: enable mainline on API V/35+" into main am: 9128ac317d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2804514

Change-Id: I5f63d3a162f1f47fbc4d51763fee0bfc194611d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2024-02-01 01:34:02 +00:00
bb7aedce5e
Merge "netbpfload: enable mainline on API V/35+" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-02-01 01:00:10 +00:00
9128ac317d
Merge "[DON'T BLOCK] Test ownership migration rules" into main am: e7aa45cdf0
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2939819

Change-Id: I44d0250070a365ebea03b46cd1dbefa73f48ef51
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Treehugger Robot   authored and   Automerger Merge Worker   commited 2024-02-01 00:08:24 +00:00
612ba174b8
netbpfload: enable mainline on API V/35+
netbpfload.mainline.rc is derived from:
  initrc-doc/bpfloader-sdk34-14-U.rc,
except that it is 'override' instead of 'updatable' and uses
the apex netbpfload instead of the platform bpfloader.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I1ecf14e3d927ece136a0669a9b209be7112e55b5

Maciej Żenczykowski   commited 2024-01-31 22:36:39 +00:00
041be52b08
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
Merge "Pass buffer size to NetlinkUtils.netlinkSocketForProto" into main am: 2cb28ea360
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2919875

Change-Id: I4e4bd1f416abf389258c7d8852c712f4cb14f5c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>

Maciej Żenczykowski   authored and   Automerger Merge Worker   commited 2024-01-31 02:43:59 +00:00
4f7630ff9b
Merge "Pass buffer size to NetlinkUtils.netlinkSocketForProto" into main
Maciej Żenczykowski   authored and   Gerrit Code Review   commited 2024-01-31 01:42:49 +00:00
2cb28ea360
Merge Android 24Q1 Release (ab/11220357)
Bug: 319669529
Merged-In: Iaaca422cb105c00ded1d84b40afd745abcd651b7
Change-Id: I4328f5086dfde8c49e4352895663cc7abccab7fa

Xin Li   commited 2024-01-30 10:38:09 -08:00
0d0b075a3a
Pass buffer size to NetlinkUtils.netlinkSocketForProto
Pass buffer size to netlinkSocketForProto to allow callers to specify
buffer size. The buffer size is not set if 0 is passed in.

Following callers of netlinkSocketForProto passes SOCKET_RECV_BUFFERSIZE
to keep same behavior as before:
 * OffloadHardwareInterface.createConntrackSocket()
 * NetlinkUtils.sendOneShotKernelMessage()
 * IpSecXfrmController.Dependencies.newNetlinkSocket()
 * InetDiagMessage.getConnectionOwnerUid()
Following callers pass 0 to not update the buffer size:
 * TunInterfaceController - it uses the socket only for writing
 * NetlinkUtils.createNetLinkInetDiagSocket() same behavior as before
Added a SOCKET_DUMP_RECV_BUFFERSIZE of 128k to be used by socket
requesting dump information from kernel:
 * NetlinkUtils.getAndProcessNetlinkDumpMessages() - sends dump request
   and expecting multiple reply messages.

Bug: 320420453

Test: atest NetworkStaticLibTests
atest FrameworksNetTests

Change-Id: I3dcb76963cf2646eb311602b50ab4e44b8ad3e8f

Yang Sun   commited 2024-01-30 21:54:48 +08:00
7934241c8f
Merge "Add reconnectCell util, refactor reconnectWifi" into main
Remi NGUYEN VAN   authored and   Gerrit Code Review   commited 2024-01-30 02:44:28 +00:00
d7773093ee
Merge "Add experiment flag for enabling sync sm" into main
Mark Chien   authored and   Gerrit Code Review   commited 2024-01-30 02:18:24 +00:00
c1647a0efc
Remove strict_updatability_linting: true
strict_updatability_linting has been disabled for a while now, due to
an expansion in scope of the NewApi check. We're going to re-enable
it now, but doing so requires removing it from all modules that have
baselined NewApi issues.

Bug: 320698986
Test: Presubmits
Change-Id: Id6c9202c236f33ad89615e4d5fa5a6364147841a
Merged-In: Id6c9202c236f33ad89615e4d5fa5a6364147841a

Cole Faust   commited 2024-01-25 09:38:25 -08:00
ee56c432e0
Baseline NewApi issues
NewApi is a lint check that you don't call framework methods that were
introduced in versions later than your min_sdk_version. We want to
make this an error, so we're baselineing all existing issues.

This cl was generated automatically, by taking all the NewApi issues
from the reference baselines, and all the non-NewApi issues from the
existing checked in baselines.

Bug: 268261262
Test: Presubmits
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4ecdedda379e4e9040eb87b01dc3d8efb89be810)
Merged-In: I0393f24f101876abc458ca139eefdb279dcb2b03
Change-Id: I0393f24f101876abc458ca139eefdb279dcb2b03

Cole Faust   authored and   Android Build Cherrypicker Worker   commited 2024-01-25 02:41:58 +00:00
be30b3e96e
Add reconnectCell util, refactor reconnectWifi
Add a utility to reconnect mobile data, and refactor toggleWifi to match
it.

The new reconnectWifi utils do not support turning wifi on and back off
anymore, but this was dead code as no test was using it (wifi is
supposed to be connected before starting tests).

Bug: 253698734
Test: atest
Change-Id: I2b8b8d186d05bb57c6a45d872febc54def8c6d59

Remi NGUYEN VAN   commited 2024-01-24 17:49:06 +09:00
4d4664d207
Merge "Revert "Add experiment flag for tethering refactor"" into main
Mark Chien   authored and   Gerrit Code Review   commited 2024-01-24 07:41:19 +00:00
e48d106863
BpfMap - add R/W constructor alias
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I7cef2b19f55e6e056b46bb1b28f85c7f7376f6f4

Maciej Żenczykowski   commited 2024-01-23 16:16:44 -08:00
06155c8040
Add experiment flag for enabling sync sm
The logic is currently disabled by default, adding a flag so
that we can compare result with A/B rollout. Tethering only read
this flag once when it is created.

Bug: 319212113
Test: atest TetheringTests

Change-Id: I656b0389e56d29dd691738ee3abfa6418746846f

Mark   commited 2024-01-23 09:55:33 +00:00
c512ab7e23
Revert "Add experiment flag for tethering refactor"
This reverts commit cf11be9eb2.

Reason for revert: avoid some IpServer(s) running the new sync state machine while others use the async state machine.

Bug: 319212113
Change-Id: Ib086a7ccd102f38e579c79f94aceae9971f1853a

Mark Chien   authored and   Mark   commited 2024-01-22 11:34:14 +00:00
6e368d1bdd