Avoid ANR of TetherPreferenceController

Off load the following work from main thread,
- Calculate title
- Calculate summery

This also helps improve the latency.

Also migrate to registerTetheringEventCallback() since
TetheringManager.ACTION_TETHER_STATE_CHANGED is deprecated.

Fix: 311848767
Test: manual - on Network & internet page and turn on / off tethering
Test: unit tests
Change-Id: I6ee182b41ef51f691ea31938142be1a41faf5573
This commit is contained in:
Chaohui Wang
2023-11-28 18:57:04 +08:00
parent 6a3a3e2ac7
commit 880068d23a
8 changed files with 461 additions and 524 deletions

View File

@@ -65,6 +65,7 @@
android:icon="@drawable/ic_wifi_tethering"
android:order="5"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.network.TetherPreferenceController"
settings:keywords="@string/keywords_hotspot_tethering"
settings:userRestriction="no_config_tethering"
settings:useAdminDisabledSummary="true" />