DO NOT MERGE Add Slices for WifiCalling

Add Slices for WifiCalling
WifiCalling Slice Provider:
  1. If there is no activation needed or if the Wifi calling
     is currently turned on - provide the slice to toggle the
     value
  2. Else display appropriate message with further instructions
WifiCalling Slice Broadcast Receiver:
  1. If the action is turning off wifi or if there is no
     activation needed. Change the setting with ImsManager.
  2. And Ask to requery the slice in one second to display
     updated settings if 1 is valid or display appropriate message

Bug: 63731862
Bug: 78192106
Test: Use support-slices-demos-debug.apk to test on device
Test: Robotests
Change-Id: I29e1822fd24ebcff575fa48ad93f84ed91bf4d87
This commit is contained in:
Naina Nalluri
2018-05-02 14:30:11 -07:00
parent 26453818b9
commit e6bf71abed
7 changed files with 725 additions and 7 deletions

View File

@@ -18,6 +18,8 @@ package com.android.settings.slices;
import static android.Manifest.permission.READ_SEARCH_INDEXABLES;
import static com.android.settings.wifi.calling.WifiCallingSliceHelper.PATH_WIFI_CALLING;
import android.app.PendingIntent;
import android.app.slice.SliceManager;
import android.content.ContentResolver;
@@ -36,7 +38,13 @@ import android.util.ArrayMap;
import android.util.Log;
import android.util.Pair;
import androidx.slice.Slice;
import androidx.slice.SliceProvider;
import androidx.slice.builders.ListBuilder;
import androidx.slice.builders.SliceAction;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.utils.ThreadUtils;
import java.net.URISyntaxException;
@@ -46,11 +54,6 @@ import java.util.List;
import java.util.Map;
import java.util.WeakHashMap;
import androidx.slice.Slice;
import androidx.slice.SliceProvider;
import androidx.slice.builders.ListBuilder;
import androidx.slice.builders.SliceAction;
/**
* A {@link SliceProvider} for Settings to enabled inline results in system apps.
*
@@ -165,6 +168,11 @@ public class SettingsSliceProvider extends SliceProvider {
switch (path) {
case "/" + PATH_WIFI:
return createWifiSlice(sliceUri);
case "/" + PATH_WIFI_CALLING:
return FeatureFactory.getFactory(getContext())
.getSlicesFeatureProvider()
.getNewWifiCallingSliceHelper(getContext())
.createWifiCallingSlice(sliceUri);
}
SliceData cachedSliceData = mSliceWeakDataCache.get(sliceUri);