Commit Graph

4 Commits

Author SHA1 Message Date
Zoey Chen
927a1cac10 [Settings] Revert the test for using mPhoneStateListener since the Robolectric test is broken
Bug: 183066948
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=AirplaneModeEnablerTest
Change-Id: Ic5c67a9a2996f40fcb07d0840f5c677494e1dc0a
2021-03-19 17:00:00 +08:00
Zoey Chen
b8a639f8fd [Settings] Use TelephonyManasger.registerTelephonyCallback instead of TelephonyManager.listen
Bug: 175270951
Test: make and atest
Change-Id: I15e1a199e6a34914db97055bfea9392c5bbdc9c6
2021-03-12 19:27:05 +08:00
Jason Chiu
1766b3c01d Fix indexing error of mobile related controllers
There were several errors in indexing mobile related sliceable
controllers, which led them not able to display on Panel and as inline
controls in search result.

It's because indexing mechanism is running in a worker thread and trying
to construct each controller instance, but the failed controllers'
constructors need to initilize something in the main thread.

- Give the main looper to the classes which only can be initialized in
  the main thread to fix the indexing.
- Guard null pointer exception in SlicesIndexer after fixing the
  indexing.
- Use onStart/onStop in AirplaneModePreferenceController to start/stop
  listener.

Fixes: 149720345
Test: robotest
Change-Id: Ibe5a8d6cc713eeddf26eceaabc05e6d1faa45507
2020-04-10 10:56:31 +00:00
Bonian Chen
717e0765a5 [Settings] Refactor AirplaneModeEnabler with test
Support auto testing

Bug: 147029746
Test: manual
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=AirplaneModeEnablerTest
Change-Id: Ib39ab1881484f65bc5a3834b2828c6ba98198cca
2020-01-02 12:06:00 +08:00