In settings when searching for "uwb" the inline toggle doesn't work,
this change fixes the issue. This change won't fix the issue of
correctly displaying the UWB state in case when the UWB adapter state
changed after the inline toggle was already loaded, that issue is
tracked in b/287644073.
Bug: 280643766
Test: Manually verified
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:34ea9149906ac41396afbf3d1e153f4ed60dc1ed)
Change-Id: Iddb89220921a9af0e1d97bb3d648ca8b0f42fc65
1. Use handler executor to directly handle state changed callbacks in
the same thread as APM handling.
2. Use the same flow to fetch the initial APM mode & UWB state from
onStart()
3. Store the state and reason code (to be used for showing regulatory
message in follow up CL).
4. Refactor the class for better unit testing (use mocks, avoid reaching
into class members being tested by using argument captor).
Bug: 270515435
Test: Manual tests
Test: atest UwbPreferenceControllerTest
Change-Id: I1b8c06a05691d9512de65ca2d61f3963dab230ab
This patch contains two fixes:
- Make sure mUwbManager is non-null by calling isUwbSupportedOnDevice to avoid a NPE.
- Modify AdvancedConnectedDeviceDashboardFragment, add lifecycle observer only if device supports UWB.
Bug: 244871579
Test: manual test and Robotest.
Change-Id: I78f97794a66f3fb487f067c4570899e21c254acf