Commit Graph

32 Commits

Author SHA1 Message Date
Weng Su
d0cd5492e4 Separate Tether summary "Off" to dedicated string ID
- Separate Tether summary "Off" to dedicated string ID for special language translation

Bug: 228573128
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=TetherPreferenceControllerTest

Change-Id: I0615eb03d6329ef73b714af39e78836ae17ea408
2022-09-24 23:03:53 +08:00
Kweku Adams
5949fccc7a Remove duplicate strings.
"Yes" and "no" were redefined many times with no clear benefit, so this
consolidates them into one definition.

Bug: 243843096
Test: Build, install, and open the Settings app
Test: atest SettingsRoboTests
Change-Id: I5f84d09f223efd478461ded93aeac82bf7b128d8
2022-08-26 00:07:08 +00:00
paulhu
81854ca397 Update Utils#getTetheringLabel usage on Settings
Utils#getTetheringLabel() is using TetheringManger to get
tetherable interface. So update the usage on Settings.

Bug: 180693313
Test: atest SettingsRoboTests
Change-Id: I4e1a983195a0fe91b98a497b6377f2ff554a3ffd
2021-03-08 10:58:39 +08:00
Adrian Roos
d99faa25c0 Revert "Merge "Update Utils#getTetheringLabel usage on Settings" am: 2b1e3a971f am: ddf3efb070 am: 8c38e9543e"
This reverts commit 0df55e1eb4.

Reason for revert: Other CLs in topic were skipped, but this one wasn't, which broke sc-dev.

Change-Id: Icf61dae071416381ea11cbe74cd92ae934c3047e
2021-03-03 14:51:42 +00:00
paulhu
2a5051e4fd Update Utils#getTetheringLabel usage on Settings
Utils#getTetheringLabel() is using TetheringManger to get
tetherable interface. So update the usage on Settings.

Bug: 180693313
Test: atest SettingsRoboTests
Change-Id: I1907743ed13c333ecbafd25b6dd9276fe692f2ea
2021-03-02 03:57:34 +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
markchien
92b09e825f Remove isProvisioningNeededButUnavailable usage
config_mobile_hotspot_provision_app would be move out of framework and
only private for tethering only. TetherUtil#isProvisioningNeeded and
isProvisioningNeededButUnavailable are no longer needed because
tethering would ensure entitlement app is valid if entitlement check is
needed. Otherwise, tethering would return not supported that tethering
settings would be hidden.

Bug: 146918263
Test: m
Change-Id: If0b0a3e6cadab3c4a4d2c003e2aa9e9f3dd7449c
2020-06-10 22:34:39 +08:00
Zhen Zhang
31f1a34629 Add a Preference into "Network & internet" for new tethering UI
Adding a MasterSwitchPreference into "Network & internet" and create
corresponding controller. The preference is hidden by the feature flag.
It does NOT affect the existing UI.

Bug: 146147778
Test: CodeInspectionTest, TetherPreferenceControllerTest,
NetworkDashboardFragmentTest
Change-Id: Ida8e088efbb22d0c983acecbc420672206392dad
2020-02-12 23:55:02 -08:00
Zhen Zhang
d2a7f9ae79 Use feature flag to show/hide AllInOneTetherSettings
This partially reverts commit 0ccc849de7
which added a config value. Instead, we will use feature flag to switch
between the fragments.

This CL also adds a postfix to keys in all_tether_prefs to
de-duplicate with keys in tether_prefs and wifi_tether_settings.

Bug: 148182953
Change-Id: I92832c786473990065a965409072e4117a7e75a8
Fix: 148618984
Test: make RunSettingsRoboTests
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
2020-01-30 16:01:42 -08:00
Zhen Zhang
0ccc849de7 Add config value to switch between Tether Settings UIs.
Adding this config value to make it easy to switch to developing
Tethering settings UI. Also, using this config value to make sure
that preferences from new AllInOneTetherSettings screen won't show up in
the search results.

Bug: 147915366
Test: make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=TetherSettingsTest
Test: make RunSettingsRoboTests
ROBOTEST_FILTER=TetehrPreferenceControllerTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSettingsTest

Change-Id: I8c88816a8f2b40fc219cae8d0d442454c5270b2b
2020-01-21 07:37:56 +00:00
Philip P. Moltmann
e3f721132a RestrictedLockUtils was split into ...Internal
This means that in some cases RestrictedLockUtils has to be used and in
some RestrictedLockUtilsInternal.

This causes a lot of trivial code changes.

I also updated the ordering of the imports in all affected files.

Bug: 110953302
Test: Built
      make -j RunSettingsRoboTests
Change-Id: I9bdf8b89134f853bae4f38c81af436715c73e924
2018-08-30 08:11:39 -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
c7162cd24d Reorder and clean up imports.
Test: rebuild
Change-Id: I178485c84ae7146f991fd77b6d7504b029942a68
2018-06-18 15:45:09 -07:00
Nitin Shivpure
ec5a3f9c01 Merge "Bluetooth: Fix to avoid BluetoothPan ServiceConnection leak" into pi-dev am: d924894652
am: 75787c8a77

Change-Id: Ib111a099149a8a6852f029d5c8b1334ea891a7fc
2018-05-16 16:43:00 -07:00
Nitin Shivpure
1b0afb9d1c Bluetooth: Fix to avoid BluetoothPan ServiceConnection leak
Usecase:
1.) Make sure BT is turned off.
2.) Go to Settings -> Network & Internet
3.) Press back  from Network & Internet.
4.) Repeat above step 2000 times

Expected Result:
No ANR/Crashed should be seen.

Observed Result:
ServiceConnection leak is happening & android setting app get crashed.

Root cause: TetherPreferenceController tries to get
pan Proxy object, when BT is oFF, which is leaking one
service connection each time

Fix: getProfileProxy for Pan must only be called, when BT is
      turned on.

Test: lifeCycle_onCreate_shouldNotInitBluetoothPanWhenBluetoothOff

Bug: 79561076
Change-Id: I85208f48ce4dded94020cb156fcdb98b2cc873f9
(cherry picked from commit 31bcf6225cdabee4f810d4fe55ea32d0d43a9c5c)
(cherry picked from commit 31c799305b480e56bd083a48c6acca11572ebe16)
2018-05-16 15:22:56 -07:00
Chilun
d3358d8a6f Add index for Hotspot settings page into search
Added index provider into TetherSettings and WifiTetherSettings pages.
Added robotests to check the keys returned by getNonIndexableKeys.
Move repeated code into utility class.

Bug: 74777873
Test: make -j RunSettingsRoboTests
Test: atest UniquePreferenceTest
Change-Id: I6cb09d735afa4867d25a79de733ce8c59634e49b
2018-05-09 14:05:15 +08:00
Aurimas Liutikas
e0069d332d Migrate Settings to androidx.
Test: make Settings
Bug: 76692459
Change-Id: I941dea40562170649bf056e675cc32e5163c0e39
2018-04-20 12:52:29 -07:00
Salvador Martinez
52da8a79b9 Refactor tether logic for reuse
Some logic related to permissions needs to be used elsewhere. This
CL refactors the relevant code into a method so that it stays in
sync in both places.

Test: robotests still pass
Bug: 64092292
Change-Id: I3b54529865e16b7e1640b0adda7f7edb9d1a41f7
2017-08-07 23:14:34 +00:00
Fan Zhang
af6fce6335 Use pref controller to get non-indexable in network setting
Change-Id: I2bcc9047146f4ad014d5929e66ee895ee497b641
Fix: 62555826
Test: robotests
2017-07-11 14:58:38 -07:00
jackqdyulei
4a2bbadcd4 Bind service in onCreate
This cl puts the binding to onCreate instead of constructor, so
preference controller won't bind/unbind service without registering
Lifecycle.

Bug: 62105045
Test: RunSettingsRoboTests
Change-Id: I1e60d4b6ad7270aa5d04b7ec9fae1d3200fccc5f
2017-07-11 10:52:06 -07:00
Tony Mantler
1d583e125f Make PreferenceController a mixin
Bug: 62912136
Test: Existing tests in BaseSearchIndexProviderTest
Change-Id: Ieda359806c09a019840b2005446c7ec8b61fdb00
2017-06-26 10:58:36 -07:00
Doris Ling
28068990d2 Merge "Listener to tether state change on Network & internet page." into oc-dev am: 1dead24890
am: be520a5f34

Change-Id: I31036a30605036e957b421727833b3a9830e4584
2017-05-25 02:37:59 +00:00
Doris Ling
5bf5c8ac04 Listener to tether state change on Network & internet page.
User can navigates to the page and turn hotspot on or off from the quick
settings. Need to listen to the tether state updates to refresh the
summary for the Hotspot & tethering preference accordingly.

Change-Id: I7c6869b909306b09556e19cf7b7543ce9dcd890e
Fix: 38452559
Test: make RunSettingsRoboTests
2017-05-24 16:51:14 -07:00
Juan Lang
777ed2535a Depend on SettingsLib's version of lifecycle and FooterMixin.
The implementations have been imported into SettingsLib. Setting's copy
can now be removed, which this change also does.

Test: Manually check battery status, which uses FooterMixin, looks OK.
make RunSettingsLibRobotTests && make RunSettingsRoboTests
     && make RunSettingsGoogleRoboTests
Change-Id: I6539605fdad80d156ff5ff249e68df4a1c412067
2017-05-12 11:10:46 -07:00
Fan Zhang
768824d7ad Update tether summary text when airplane mode turns on
Change-Id: I62c52351abbad50aeac077785afb21822773956e
Fix: 37934871
Test: make RunSettingsRoboTests
2017-05-05 12:55:11 -07:00
Fan Zhang
f5f71a9be2 Fix ServiceConnectionLeak in network fragment
Change-Id: I43efe9ae31fc2f58361abdb034b0205a3f3e2b71
Fix: 35957226
Test: make RunSettingsRoboTests
2017-03-03 18:01:19 -08:00
Fan Zhang
b00811da64 Let fragment and indexProvider share prefControllers
Bug: 35812240
Test: make RunSettingsRoboTests
Change-Id: Ifd96f935836a52e0a56f170f3cdf9b9ddf7c499a
2017-03-01 12:56:58 -08:00
Fan Zhang
c689d136c1 Add hotspot summary text
Bug: 34974598
Test: RunSettingsLibRoboTests

Change-Id: If5d17bf458f980b4f3a8fdeb4718bbf5d2993a21
2017-02-13 13:18:35 -08:00
Fan Zhang
9b6f181340 Remove no-op handlePerferenceTreeClick from PrefControllers
Bug: 33429853
Test: RunSettingsRoboTests
Change-Id: I5633953e3d7b07f9006e541b96a24a2a769e2686
2016-12-07 15:34:31 -08:00
Fan Zhang
242da31179 Fix logging spam in DashboardFragment.
When updating preferences managed through PreferenceController, the
fragment should skip prefs that are not available.

Bug: 32255863
Test: RunSettingsRoboTests
Change-Id: I2f9b6ddf8c78d40068dc18f07e60672dcba4474a
2016-10-25 17:14:47 -07:00
Fan Zhang
db1112a221 Add progressive disclsoure
- Add a ProgressiveDisclosureMixin that contains all logic for collapse
  preference list when it's too long
- Refactored PreferenceController's updateState to take a preference
  instead of PreferenceScreen, because with progressive disclosure the
  preference can either be in screen or the mixin. DashboardFragment is
  responsible finding the preference before passing it to controller.

Bug: 32255863
Test: RunSettingsRoboTests

Change-Id: I6713abd61c954ce12732902e5b3ca4d4c0b1563e
2016-10-18 16:57:11 -07:00
Fan Zhang
7f1a4b5891 Add PreferenceControllers to Network page.
- Also made tiles refresh more efficient: when category changes, only
  refresh dynamic tiles. Static tiles from xml will not change due to
  category change.

Bug: 31799836
Test: RunSettingsRoboTests
Change-Id: I1e4c85f2c122c65ec99729e43a66c80acdd863c8
2016-10-12 15:04:39 -07:00