settings(uwb): Refactor UwbPreferenceController

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 commit is contained in:
Roshan Pius
2023-04-04 15:22:35 -07:00
parent cd7123e071
commit 95892f3394
4 changed files with 194 additions and 75 deletions

View File

@@ -42,6 +42,7 @@ android_app {
"androidx.test.core",
"androidx.test.runner",
"androidx.test.ext.junit",
"frameworks-base-testutils",
"guava",
"jsr305",
"settings-contextual-card-protos-lite",