Move all custom slice uris to a registry class.

Change-Id: I192320f95ac81d14c8891ce2531d603912e59f56
Fixes: 119776308
Test: robotests
This commit is contained in:
Fan Zhang
2018-11-27 16:14:51 -08:00
parent 154f34a35e
commit 53f75f0df9
33 changed files with 415 additions and 499 deletions

View File

@@ -20,7 +20,6 @@ import static android.app.slice.Slice.EXTRA_TOGGLE_STATE;
import android.annotation.ColorInt;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -37,6 +36,7 @@ import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.connecteddevice.BluetoothDashboardFragment;
import com.android.settings.slices.CustomSliceRegistry;
import com.android.settings.slices.SliceBroadcastReceiver;
import com.android.settings.slices.SliceBuilderUtils;
@@ -47,16 +47,6 @@ public class BluetoothSliceBuilder {
private static final String TAG = "BluetoothSliceBuilder";
/**
* Backing Uri for the Bluetooth Slice.
*/
public static final Uri BLUETOOTH_URI = new Uri.Builder()
.scheme(ContentResolver.SCHEME_CONTENT)
.authority(SettingsSlicesContract.AUTHORITY)
.appendPath(SettingsSlicesContract.PATH_SETTING_ACTION)
.appendPath(SettingsSlicesContract.KEY_BLUETOOTH)
.build();
/**
* Action notifying a change on the BluetoothSlice.
*/
@@ -74,7 +64,7 @@ public class BluetoothSliceBuilder {
}
/**
* Return a Bluetooth Slice bound to {@link #BLUETOOTH_URI}.
* Return a Bluetooth Slice bound to {@link CustomSliceRegistry#BLUETOOTH_URI}.
* <p>
* Note that you should register a listener for {@link #INTENT_FILTER} to get changes for
* Bluetooth.
@@ -92,7 +82,7 @@ public class BluetoothSliceBuilder {
final SliceAction toggleSliceAction = new SliceAction(toggleAction, null /* actionTitle */,
isBluetoothEnabled);
return new ListBuilder(context, BLUETOOTH_URI, ListBuilder.INFINITY)
return new ListBuilder(context, CustomSliceRegistry.BLUETOOTH_URI, ListBuilder.INFINITY)
.setAccentColor(color)
.addRow(new RowBuilder()
.setTitle(title)