Add Wifi calling Preference slice and other cleanup
WifiCallingPreference Slice Provider: 1. If Wifi calling is not enabled - display message to user to enable Wifi calling 2. Else if Wifi preference is not editable - return a null Slice 3. Else provide a slice with rows - first row giving current pref information, followed by preference items (in each row). wifi_only is displayed only when it is allowed to display it. Each row with preference item has specific intent action. WifiCallingPreference Slice BroadcastReceiver: 1. If only Wifi calling is enabled & Wifi preference is editable & there is a change in current value modify wifi pref setting 2. And Ask to re-query the slice in one second to display updated settings if 1 is valid or display appropriate message. Clean-up: 1. Return null instead of non-actionable slices. 2. Use getText to get string resources. 3. Remove unnecessary extra variables. Bug: 79548264 Test: Use support-slices-demos-debug.apk to test on device Change-Id: I186f19be2007c2331eaf6195e70b4a9c635adf9e
This commit is contained in:
@@ -25,6 +25,9 @@ import static com.android.settings.slices.SettingsSliceProvider.EXTRA_SLICE_PLAT
|
||||
import static com.android.settings.wifi.calling.WifiCallingSliceHelper.ACTION_WIFI_CALLING_CHANGED;
|
||||
import static com.android.settings.wifi.WifiSliceBuilder.ACTION_WIFI_SLICE_CHANGED;
|
||||
import static com.android.settings.mobilenetwork.Enhanced4gLteSliceHelper.ACTION_ENHANCED_4G_LTE_CHANGED;
|
||||
import static com.android.settings.wifi.calling.WifiCallingSliceHelper.ACTION_WIFI_CALLING_PREFERENCE_WIFI_ONLY;
|
||||
import static com.android.settings.wifi.calling.WifiCallingSliceHelper.ACTION_WIFI_CALLING_PREFERENCE_WIFI_PREFERRED;
|
||||
import static com.android.settings.wifi.calling.WifiCallingSliceHelper.ACTION_WIFI_CALLING_PREFERENCE_CELLULAR_PREFERRED;
|
||||
|
||||
import android.app.slice.Slice;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -91,6 +94,14 @@ public class SliceBroadcastReceiver extends BroadcastReceiver {
|
||||
.getNewEnhanced4gLteSliceHelper(context)
|
||||
.handleEnhanced4gLteChanged(intent);
|
||||
break;
|
||||
case ACTION_WIFI_CALLING_PREFERENCE_WIFI_ONLY:
|
||||
case ACTION_WIFI_CALLING_PREFERENCE_WIFI_PREFERRED:
|
||||
case ACTION_WIFI_CALLING_PREFERENCE_CELLULAR_PREFERRED:
|
||||
FeatureFactory.getFactory(context)
|
||||
.getSlicesFeatureProvider()
|
||||
.getNewWifiCallingSliceHelper(context)
|
||||
.handleWifiCallingPreferenceChanged(intent);
|
||||
break;
|
||||
default:
|
||||
final String uriString = intent.getStringExtra(SliceBroadcastRelay.EXTRA_URI);
|
||||
if (!TextUtils.isEmpty(uriString)) {
|
||||
|
Reference in New Issue
Block a user