Commit Graph

7 Commits

Author SHA1 Message Date
Zhen Zhang
c2b9e5ef20 Update summary for AllInOneTetherPreference accordingly
The summary for AllInOneTetherPreference in NetworkDashboardFragment is
updated according to tethering state and tether interface chosen by
user.

Bug: 149256198
Test: AllInOneTetherPreferenceControllerTest, TetherEnablerTest,
CodeInspectionTest

Change-Id: I24ba4deabbb02b203e76d32048040d7ccf1b2d22
2020-02-14 00:14:23 -08:00
Zhen Zhang
ec966cb7a3 Add tether preferences into AllInOneTetherSettings
These preferences are for user to toggle a specific tethering option,
like USB, BT or WIFI.

Bug: 147323306
Test: CodeInspectionTest, AllInOneTetherSettingsTest, TetherEnablerTest
Change-Id: I1229ffd2dd12b39e9c6e48dc29c6e46ce9ad7634
2020-02-10 23:04:37 -08:00
Zhen Zhang
258fb7f672 Make tether preference controllers extend BasePreferenceController
These controllers extended AbstractPreferenceController, which is not
quite compatible with some of the present framework. Especially for
indexable keys of settings search.

TetherEnabler and AllInOneTetherSettings are refactored based on the
change. Tests are updated.

Bug: 147272749
Test: CodeInspectionTest and other tests of classes touched by this CL
Change-Id: Ic3ad13e735d133c0959a0a309319a6fd5165b015
2020-02-05 10:18:57 -08:00
Zhen Zhang
02dfed6846 Use TetherEnabler in AllInOneTetherSettings to manage master switch
In AllInOneTetherSettings, we use TetherEnabler to hanle all behavior
related to tethering switch on/off.
In TetherEnbler, add WifiManager.WIFI_AP_STATE_CHANGED_ACTION to cover
all possible tethering state change.
TetherEnablerTest is modified accordingly.

Bug: 147322704
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TetherEnablerTest
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=AllInOneTetherSettingsTest

Change-Id: I505b3825f79260983fff9d3935ba834ad8f9f690
2020-01-17 11:11:30 -08:00
Zhen Zhang
b60e8ca294 Create a fragment class for the new "Hotspot & tethering" screen
This fragment class is created to display Wifi tether settings, Usb
tether settings and bluetooth tether settings within the single "Hotspot &
tethering" screen. By creating a new fragemnt, we can safely change the
UI by replace fragment name in xml file.
Right now, it only supports wifi tether settings and mostly copied from
WifiTetherSettings.java.

Bug: 146447611
Test: AllInOneTetherSettingsTest is created and run.
Change-Id: Icdac0d4930451e6956dbf6ef0f4b65bce96fed3f
2020-01-12 23:32:44 -08:00
Zhen Zhang
a990206ee7 Create preference controller for each tethering option
These controllers are responsible for persisting preference values and
managing the visibility and switch state. TetherEnabler will be
listening to changes of shared prefernce values and turn on/off
corresponding type of tethering when tethering is on at that time.

Bug: 146582865
Test: tests are created for each controller class.
Change-Id: I7e601b2bd693da59269517d2988bade7475e7f12
2020-01-06 23:55:30 -08:00
Zhen Zhang
23e8fa1020 Create a TetherEnabler class to manage tether settings switch
This class is created to manage the switch state of overall tethering
state. It can turn on/off each type of tethering based on stored value
in SharedPreference. Also, it listens to data saver state change.

Bug: 145923107
Test: TetherEnablerTest
Change-Id: I7f360329569f53f34cf13065aa0e00ad9b55f659
2019-12-17 12:46:55 -08:00