Commit Graph

18 Commits

Author SHA1 Message Date
SongFerngWang
fc435e3736 Replace allowedNetworkTypes with allowedNetworkTypesForReason
- Replace getAllowedNetworkTypes with
getallowedNetworkTypesForReason(ALLOWED_NETWORK_TYPES_REASON_CARRIER)
- Replace "Settings.Global.PREFERRED_NETWORK_MODE" with
"getAllowedNetworkTypesForReason(USER)"
- Move EnabledNetworkModePreferenceControllerTest from robotests to unit
- Replace KEY_NR_ENABLED_BOOL with KEY_CARRIER_NR_AVAILABILITY_INT
- Rename PreferredNetworkModeContentObserver to AllowedNetworkTypesListener
Bug: 161434786
Test: build pass.
(PASS)atest CdmaSystemSelectPreferenceControllerTest
(PASS)atest PreferredNetworkModePreferenceControllerTest
(PASS)atest AllowedNetworkTypesListenerTest
(PASS)atest EnabledNetworkModePreferenceControllerTest
(PASS)atest MobileNetworkUtilsTest

Change-Id: I2b981569ad11cf70a558c1952cc2e077464328d8
Merged-In: I2b981569ad11cf70a558c1952cc2e077464328d8
2021-03-04 19:20:04 +08:00
Bonian Chen
967311df7f Merge "[Settings] Reduce the operation of VoLTE config redraw" 2020-11-26 07:35:21 +00:00
Bonian Chen
f9256b41f2 [Settings] Reduce the operation of VoLTE config redraw
There're 3 VoLTE configuration UIs sharing the same configuration,
but only 1 of them will be displayed.

The 3 classes extending Enhanced4gBasePreferenceController are:
1. Enhanced4gAdvancedCallingPreferenceController
2. Enhanced4gCallingPreferenceController
3. Enhanced4gLtePreferenceController
They're different in the value of getMode().

The design within Enhanced4gBasePreferenceController only allows to show one of them.
Which means, the other two don't need to register for PhoneStateListener and should ignore actions in response to it when receiving callback from PhoneStateListener.

Through detecting the VoLTE configuration mode, some operations could be
avoided.
This fix is targeting to avoid these operations from happening.

Bug: 172987488
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
Merged-In: I56d4900b5bcb189693c99e870b013da97ed283db
(cherry picked from commit d2e22f4cee)
Change-Id: I92e4b84b81622548fb356a4c7af99668bd2a9e00
2020-11-26 14:18:25 +08:00
Bonian Chen
9769677a3c [Settings] Add voice call status and VoLTE mode detection into VoLTE UI test case
1. VoLTE UI should gray out during voice call.
2. UI should be invisible when VoLTE mode mismatch.

Bug: 172781455
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
Merged-In: I8b6a212dc727f1ab78f4dd280cb41966b7054180
(cherry picked from commit 227329b2f7)
Change-Id: I1bd239b6434038323a0689e2bc3bf05182bfcd45
2020-11-26 13:52:47 +08:00
Taesu Lee
99637baab2 Avoid unexpected state changes for enhanced preferences
Assigning current call state to mCallState right before registering
PhoneStateListener so that the preferences have correct state before
first onCallStateChanged() by initial registration even.

Bug: 166307650
Test: Check the preferences state when onStop() -> onStart()

Change-Id: I861a687497ba4da7a845540fd92ae2b865392d60
Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
2020-09-11 14:36:26 +09:00
SongFerngWang
414f8b8fe6 Add corresponding code for the new NR condition
Bug: 155915216
Test: make RunSettingsRoboTests ROBOTEST_FILTER=\
EnabledNetworkModePreferenceControllerTest (Pass)

Change-Id: I171ea0a8adc621ad5e9dc5cd2090e431b923e775
2020-05-19 12:32:57 +00:00
Bonian Chen
d231727e3b [Settings] Code refactor
Move some work out of constructor of
EnabledNetworkModePreferenceController.
Which could avoid callbacks before init() been invoked.

Bug: 141833767
Test: make RunSettingsRoboTests -j
ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=EnabledNetworkModePreferenceControllerTest
Change-Id: I11f25d130a746c75184a21a8991177b02ad237f0

Change-Id: I6aa58a8d9d15b1524bf03f425e3eae3a0254593e
2020-05-04 11:48:09 +08:00
Bonian Chen
0f47147543 [Settings] To avoid from crash when callback
Callback from SubscriptionManager and PhoneStateListner may comes in
under the case of Preference not available.

Bug: 141833767
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=VideoCallingPreferenceControllerTest
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiCallingPreferenceControllerTest
Change-Id: I50b83b4488d272f6482bde5f09b57d59e6fc27a3
2020-04-21 15:02:14 +08:00
SongFerngWang
e60faf8056 [5G settings UI] add UI for the 5G limited VoLTE dialog
when the user disables VoLTE, UE show alert dialog for 5G disable.

Bug: 151313654
Test: build pass. manual test: UI show alert dialog.
Change-Id: I5ea4d59017b5d9db6f7c3d8d0ffd24d5a2c61457
2020-04-15 15:05:30 +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
2de00e766d [Settings] NullPointerException when disable eSIM/Fi
When disabling eSIM/Fi, CarrierConfig retrieved on that subscription
becomes null and need to perform null pointer checking when accessing
it.

Bug: 149484288
Test: manual
Change-Id: If8a206788407a65c2cb9e5bafe3bc89b93cf63fe
2020-03-01 01:15:06 +00:00
Bonian Chen
19b232f73e [Settings] Apply ImsQueryProvisioningStat to VoLTE
1. Code refactor
2. Apply ImsQueryProvisioningStat class to VoLTE's use case

Bug: 140542283
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gLteSliceHelperTest
Change-Id: Ie5a56e9b768b9abe88c635e4e5532d72c9ddd1a2
2020-02-05 14:12:23 +08:00
Bonian Chen
00f42fb6fc [Settings] replace isNonTtyOrTtyOnVolteEnabled() in VoLTE
1. Code refactor
2. Replace ImsManager#isNonTtyOrTtyOnVolteEnabled() by combination of
   TelecomManager#getCurrentTtyMode() and
   ImsMmTelManager#isTtyOverVolteEnabled()

Bug: 140542283
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gLteSliceHelperTest
Change-Id: I5ea5978529a7ae9a63161caca22fb29102f24150
2020-01-21 16:13:38 +00:00
Bonian Chen
bd9a04ceea [Settings] add VolteQueryImsState for IMS
1. Code refactor
2. Introduce VolteQueryImsState for user enable/disable configuration

Bug: 140542283
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
Test: m RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gLteSliceHelperTest
Change-Id: I9c18c8900ac01909030d9433935650c1581a0fb0
2020-01-21 19:39:29 +08:00
Malcolm Chen
26e5dbdbfd Mainline: remove usage of hiddepn API SubscriptionManager#getPhoneId
Bug: 140908357
Test: build
Change-Id: Idaa206c7659717a269738c0121a31d957f7d90d0
2019-12-16 11:43:00 -08:00
Bonian Chen
21361e1f84 [Settings] Refactor PhoneStateListener
Remove Looper and update of mSubId

Bug: 144542981
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=VideoCallingPreferenceControllerTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=WifiCallingPreferenceControllerTest

Change-Id: Ie6ae5b5914322644f2655e585b03a6b685bbc84a
2019-11-15 16:01:51 +08:00
Bonian Chen
65817204e6 [Settings] Replace VT and VOLTE provisioning API
Replace isVtProvisionedOnDevice() and isVolteProvisionedOnDevice()
by android.telephony.ims.ProvisioningManager.

Bug: 140542283
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gBasePreferenceControllerTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=Enhanced4gLteSliceHelper
make RunSettingsRoboTests -j ROBOTEST_FILTER=VideoCallingPreferenceController

Change-Id: Ie92794b794a6b9f2d9e161ca5f328cd9fa01064a
2019-11-14 18:24:55 +08:00
Stanley Wang
9cbca4bcee Fix can't find the search result by input "4G Calling"
Add indexable raw data for type 4G_CALLING or ADVANCED_CALL and
set the volte to non-indexable if current type is not volte.

Fixes: 137155154
Test: manual

Change-Id: I0992f9fb95e0b1cc23fb4f38f356ee0569f3b5b1
2019-09-19 19:21:16 +08:00