Commit Graph

10 Commits

Author SHA1 Message Date
Treehugger Robot
821e70ea59 Merge "Adb is disconnecting during Monkey Test Run." 2023-03-10 15:19:15 +00:00
Patrick Rohr
6f9062297f settings: allow enabling ethernet tethering independent of link state
A user should be able to enable tethering even if the interface does not
have link yet. Therefore, the toggle should be active if any interface
is available, independent of its link state.

Test: TH
Bug: 234036868
Change-Id: I2ae25207a766d71217dd6d17f3f9b74ceb261238
2023-03-08 00:57:03 +00:00
Ankit Agrawal
5bff5f3868 Adb is disconnecting during Monkey Test Run.
When running the monkey test, its going in tethering page
inside Settings app and enabling ethernet tethering.
Due to get adb connection is getting lost.

Guarding ethernet tethering option when monkey test is running,
it will not display ethernet tethering option during monkey test.

Bug:
Test: start monkey test run using below command
adb shell monkey -v 1000000

Change-Id: I4040cb088404e663b032179ff52b1bc564ecf76b
Signed-off-by: Ankit Agrawal <ankit.agarwal@intel.com>
2022-12-13 21:24:11 +05:30
Shen Lin
ce0e8b9a4b Align main thread checking by calling ThreadUtils
Since ThreadUtils encapsules method to ensure main thread, it is
suggested to call this method rather than maintaining our copy.

Bug: 258270052
Test: atest and manual.
Change-Id: I4c5fcdd6e5bcc7d1d08f526eedb3aa123926d8a1
2022-11-09 11:43:03 +08:00
Xiao Ma
db7d7de3b4 Adapt new EthernetManager APIs in Settings.
EthernetManager is going to be moved to Connectivity mainline module and
new EthernetManager management APIs have been exposed. This CL adapts
new APIs in the settings in advance, the changes include:

1. use addInterfaceStateListener and removeInterfaceStateListener.
2. rely on the onInterfaceStateChanged callback to receive the Ethernet
   interface state update, to replace the getAvailableInterfaces and
   getConfiguration.
3. after the Ethernet mainline migration completes, Settings cannot
   access the platform resource such as config_ethernet_iface_regex,
   instead, check the availability of Ethernet interface by checking
   if either any of FEATURE_ETHERNET and FEATURE_USB_HOST is supported.

Bug: 210586283
Bug: 218798003
Test: m
Test: manually verify that device can access the Internet via Ethernet
Test: manually verify that device can share the Internet via Ethernet
      tethering
Test: make RunSettingsRoboTests ROBOTEST_FILTER=<modified test cases>
      EthernetTetherPreferenceControllerTest
      AllInOneTetherSettingsTest
Change-Id: I9e10481e1751975772a24db29568aa26bb85cd70
2022-02-24 01:49:57 +00:00
Xiao Ma
f621c4ba14 Fix EthernetManager.addListener dependency in Tethering settings.
Ethernet service related files are going to be moved into Connectivity
module. EthernetManager.addListener(listener, exectuor) will be exposed
out as module-lib API. Replace the current API usage with the one to be
exposed.

android.os.HandlerExecutor is a hidden API which isn't visible to modules,
try to replace HanlderExecutor class with Handler.post itself although
Setttings can still access this API.

Bug: 210586283
Test: m
Change-Id: I618b43769c68897f4724fae8213181be1cc770c6
2022-01-25 04:49:16 +00:00
Bonian Chen
d6f54ed90b Revert "[Settings] Convert to getSystemService(Class<T>)"
Revert submission 1645152-getSystemService(Class<T>)

Reason for revert: Fix JUnit test failure
Reverted Changes:
I1b4812044:[Settings] Convert to getSystemService(Class<T>)
I278951c24:[Settings] Support getSystemService(Class<T>)

Change-Id: I864a40f82ba9cb4170900ac0c1d77f781b17341f
2021-03-31 09:37:03 +00:00
Bonian Chen
db6c47756d [Settings] Convert to getSystemService(Class<T>)
Change to getSystemService(Class<T>) to align the capability with framework
part.

Bug: 179640862
Test: local
Change-Id: I1b4812044fc4876bec6645570049a60f9470dbbd
2021-03-22 06:20:19 +00:00
paulhu
c11ac84929 Replace ConnectivityManager hidden symbols on Settings
Connectivity is becoming a mainline module in S, so
ConnectivityManager hidden symbols can not be used for outside
components. Besides, most Tethering relevant methods or variables
on CM are migrated to TetheringManager. So replace all these
methods or variables from ConnectivityManager to TetheringManager
on Settings.

Bug: 180693313
Test: make RunSettingsRoboTests ROBOTEST_FILTER=<Modified Test>
Change-Id: Iba4b121a4ddf3f04252aa0355e0e6494a593682a
Merged-In: Iba4b121a4ddf3f04252aa0355e0e6494a593682a
2021-02-24 11:45:02 +08:00
Zhen Zhang
c10ec56e0f Add ethernet tether option into AllInOneTetherSettings
Create controller for ethernet tether preference in
AllInOneTetherSettings and corresponding test.

Test: AllInOneTetherSettingsTest; UsbTetherPreferenceControllerTest;
BluetoothTetherPreferenceControllerTest;
EthernetTetherPreferenceControllerTest;
WifiTetherDisablePreferenceControllerTest; TetherEnablerTest
Bug: 153690620

Change-Id: I8918d5c8a82c521b00eb3c712af80c2041778595
2020-04-20 13:53:58 -07:00