Commit Graph

18 Commits

Author SHA1 Message Date
Hugh Chen
ffeefd4d11 Fix USB tethering is not turned on with a single tap
Before this CL, the USB default settings will set default usb functions
to RNDIS when tethering is started. Because in some devices, the NCM
is used instead of RNDIS to start tethering. If RNDIS is set in the
device that uses NCM to start tethering, it will cause start
tethering failed.

This CL will use the current functions to set default usb functions
to fix this issue.

Bug: 195068679
Bug: 197026638
Test: make -j42 RunSettingsRoboTests
Change-Id: Ic9353c5ac76c0cd517318a4304fa214d6b2201d2
(cherry picked from commit ba30b04cc3)
2021-08-31 09:03:07 +00:00
Hugh Chen
112a638cba Fix it will auto switch back to "No data transfer" after selecting "USB Tethering"
Before this CL, the USB option didn't handle whether FUNCTION_NCM
existed in the intent extra when tethering was started which resulted
in some devices that enable NCM will have incorrect UI.

This CL added a condition to check whether FUNCTION_NCM existed in the
intent extra or not to fix this UI issue.

Bug: 192046902
Test: make -j42 RunSettingsRoboTests
Change-Id: Icb8548409930d59dc3a08c25e418c9a1ddb9f33c
2021-07-09 10:52:50 +08:00
Hugh Chen
db53d1c6f8 Fix borken test on Bluetooth and connected package
Bug: 187239965
Test: make RunSettingsRoboTests -j56
Change-Id: Ic0d60a6cd46b1211efb2021f079c0b0a6534b383
2021-05-05 14:31:01 +08:00
Hugh Chen
ddafb202bd Fix usb tethering switch back to none after off/on the screen
This CL adds conditions to check whether usb is connected or not.
If usb is not connected or tethering is not started don't update the
state.

Bug: 157709648
Test: make RunSettingsRoboTests -j56
Change-Id: Ifbf5900923419d6abf35834b196aab12601076e4
2021-04-28 09:12:15 +00:00
Hugh Chen
50fc7d15ef Fix "USB tethering" doesn't work after reconnecting USB
Before this CL, if users selects usb tethering option and
reconnects usb it would not start entitlement check.
Because we only start entitlement checks when users select it.

This CL will start entitlement checks when usb tethering option
is selected and reconnects usb.

Bug: 176037347
Test: make -j42 RunSettingsRoboTests
Change-Id: I3a2ad392a1cae9cf97355ef3cd4fb8c23de18673
2021-03-04 15:31:11 +08:00
Hugh Chen
0091ae6142 Refactor Usb settings
1. Rename ShouldIgnoreClickEvent() to isClickEventIgnored().
2. Use TetheringManager instead of ConnectivityManager.

Bug: 175651578
Test: make -j42 RunSettingsRoboTests
Change-Id: I37c49694257b7575550b5a905e293b5d056ba1bf
2021-03-03 18:13:17 +08:00
Edgar Wang
e19ee9a01f Revert "Settings search - Navigate user to exact page"
This reverts commit 08f2a58459.

Reason for revert: design changed, we decide to take the user to
the entry after clicking on a search result.
It's opposite with what we did, so we revert related CL first.

Test: robotest

Change-Id: Iadb9a94a7ef7838be34a54499e2d934d6396c336
2020-01-16 14:07:38 +08:00
Edgar Wang
08f2a58459 Settings search - Navigate user to exact page
- remove duplicate index preference
- default set searchable = false when the preference has fragment
- make some fragments indexable

Bug: 143057584
Test: robotest & manual

Change-Id: I4d64f6106d2f92f0a45e8c7e26388677f593f412
2019-12-24 21:04:11 +08:00
hughchen
d6ec2ac7be Tethering shouldn't indicates on when SIM without tethering option
Before this CL, If SIM doesn't have tethering option then UI will not
back to previous option when press "USB tethering" in
[Default USB configuration].

This CL added receiver to observe USB state that get correct state
from UsbManager.

Bug: 138630479
Test: make -j42 RunSettingsRoboTests
Change-Id: I6cc8da508f6ab142142ca8c28460125bad93925b
2019-10-04 15:41:45 +08:00
Sunny Shao
bd7a034ae3 Use dynamic footer
Removed the FooterPreferenceMixin from the UsbDefaultFragment page.

Fixes: 139460691
Test: manual test
Test: make RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.connecteddevice.usb
Change-Id: Iadf1d4893019827077875d02e3ebe380662aeb2c
2019-08-15 17:42:25 +08:00
Fan Zhang
31b210017b Migrate all MetricsProto enums to SettingsEnums
Bug: 122855168
Test: rebuild
Change-Id: I962d9a71179f86b7cae9dc5e9a00e0aa1557dc76
2019-01-17 14:55:42 -08:00
jackqdyulei
184b3a4c68 Add entitlement check for usb tethering
Before this CL, usb tethering in detail page doesn't have entitlement
check. This CL fix it by using the correct API

Also polish it by updating the UI before entitlement check to align
hotspot page. So in UI it will first check "usb tethering". If
entitlement check fail, it will revoke and go back to previous selection.

Bug: 115707279
Test: RunSettingsRoboTests
Change-Id: I3d2ebad2879479a870bcdfe596bb88b83c424389
2018-10-02 15:41:46 -07:00
Fan Zhang
23f8d59d02 Sort imports
Having consistent import order will reduce chance of merge
conflict between internal and external master

Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
2018-08-28 22:13:15 +00:00
Fan Zhang
176ccd0c35 Clean up: fix incorrect @VisibleForTesting imports
Test: rebuild and robotests
Change-Id: I33d7ee1c0622c01f592920baaf01d44ad19d9a13
2018-07-13 13:08:53 -07:00
tmfang
27c84de325 Settings Fragment Migration (Build pass app)
This patch focused on fixing compile errors and some runtime errors.

Test: We can't test it now. But we will have an integration test later.
Bug: 110259478
Change-Id: I16c471ddcd0fa1460c665b7f74d86fcace5ee67b
2018-07-11 18:24:51 -07:00
Jerry Zhang
55d10dff53 Update USB settings screen
Screen now handles data role and power
role switching as separate categories.

Change the UsbBackend api to use predefined
constants. Split out data and power direction
changes into separate functions.

Add tests for new controllers and new backend
functionality.

Bug: 72829348
Test: passes
Change-Id: I28b96cf49463fa4f3a4b6be41c57d5841731fbd6
2018-03-15 17:18:41 -07:00
Dake Gu
fef14cac00 Settings: Move DefaultAppInfo CandidateInfo to SettingsLib
Bug: 3600711
Test: Moved DefaultAppInfoTest to SettingsLib
      m RunSettingsRoboTests
Change-Id: If9e2288009277f1940b9769790b78bb0a58b626a
2018-02-23 13:23:16 -08:00
Jerry Zhang
502471726a Add UsbDefaultFragment and tests
Replace old USB screen in developer options with
UsbDefaultFragment.

Test: pass
Bug: 62876645
Change-Id: I8428a2814b7e1abd7d0fa9fa9980dbc02cfa0034
2018-02-21 19:16:23 +00:00