Use CustomSliceRegistry directly when possible.

This is one step closer to (un)make CustomSliceManager an singleton.

Bug: 123937830
Test: manual
Change-Id: I844d0fb798c73e2af1945ecb667ba73fac9edf72
This commit is contained in:
Fan Zhang
2019-03-13 15:58:18 -07:00
parent 6120d57cbc
commit ad29500d1d
6 changed files with 12 additions and 44 deletions

View File

@@ -61,11 +61,10 @@ public class SliceBroadcastReceiver extends BroadcastReceiver {
final boolean isPlatformSlice = intent.getBooleanExtra(EXTRA_SLICE_PLATFORM_DEFINED,
false /* default */);
final CustomSliceManager mCustomSliceManager = FeatureFactory.getFactory(
context).getSlicesFeatureProvider().getCustomSliceManager(context);
if (CustomSliceRegistry.isValidAction(action)) {
final CustomSliceable sliceable =
mCustomSliceManager.getSliceableFromIntentAction(action);
CustomSliceable.createInstance(context,
CustomSliceRegistry.getSliceClassByUri(Uri.parse(action)));
sliceable.onNotifyChange(intent);
return;
}