Add slice uri to slice index db
And slightly refactored the SliceDataConverter to remove 1 reflection. Bug: 126222433 Test: robotest Change-Id: Ic5782bdd71f5c9cb77879a35de81dc61c01d1912
This commit is contained in:
@@ -23,7 +23,6 @@ import static com.android.settings.slices.SettingsSliceProvider.EXTRA_SLICE_PLAT
|
||||
import android.annotation.ColorInt;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
@@ -110,17 +109,6 @@ public class SliceBuilderUtils {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the {@link SliceData.SliceType} for the {@param controllerClassName} and key.
|
||||
*/
|
||||
@SliceData.SliceType
|
||||
public static int getSliceType(Context context, String controllerClassName,
|
||||
String controllerKey) {
|
||||
BasePreferenceController controller = getPreferenceController(context, controllerClassName,
|
||||
controllerKey);
|
||||
return controller.getSliceType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits the Settings Slice Uri path into its two expected components:
|
||||
* - intent/action
|
||||
@@ -214,17 +202,6 @@ public class SliceBuilderUtils {
|
||||
return "";
|
||||
}
|
||||
|
||||
public static Uri getUri(String path, boolean isPlatformSlice) {
|
||||
final String authority = isPlatformSlice
|
||||
? SettingsSlicesContract.AUTHORITY
|
||||
: SettingsSliceProvider.SLICE_AUTHORITY;
|
||||
return new Uri.Builder()
|
||||
.scheme(ContentResolver.SCHEME_CONTENT)
|
||||
.authority(authority)
|
||||
.appendPath(path)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static Intent buildSearchResultPageIntent(Context context, String className, String key,
|
||||
String screenTitle, int sourceMetricsCategory) {
|
||||
final Bundle args = new Bundle();
|
||||
@@ -350,7 +327,7 @@ public class SliceBuilderUtils {
|
||||
.build();
|
||||
}
|
||||
|
||||
private static BasePreferenceController getPreferenceController(Context context,
|
||||
static BasePreferenceController getPreferenceController(Context context,
|
||||
String controllerClassName, String controllerKey) {
|
||||
try {
|
||||
return BasePreferenceController.createInstance(context, controllerClassName);
|
||||
|
Reference in New Issue
Block a user