Refactor CustomSliceManager.

- Make everything that can be static, static.
- Also removed a unused slice for battery info.

Next step - going to make CustomSliceManager into a regular class
instead of getting it from FeatureProvider. This way it's no longer an
application level singleton, then we can do things like attaching
lifecycle to it. It will be easier to deal with "session" based use case
after the refactor

Bug: 123937830
Test: manual
Change-Id: I384761a6894fa907f72a3610437835c4dd4d1944
This commit is contained in:
Fan Zhang
2019-03-12 15:46:12 -07:00
parent e2eefcd163
commit 2fe7e9fc45
10 changed files with 80 additions and 308 deletions

View File

@@ -147,7 +147,7 @@ public class SettingsSliceProvider extends SliceProvider {
@Override
public void onSlicePinned(Uri sliceUri) {
if (mCustomSliceManager.isValidUri(sliceUri)) {
if (CustomSliceRegistry.isValidUri(sliceUri)) {
final CustomSliceable sliceable = mCustomSliceManager.getSliceableFromUri(sliceUri);
final IntentFilter filter = sliceable.getIntentFilter();
if (filter != null) {
@@ -194,7 +194,7 @@ public class SettingsSliceProvider extends SliceProvider {
// Before adding a slice to {@link CustomSliceManager}, please get approval
// from the Settings team.
if (mCustomSliceManager.isValidUri(sliceUri)) {
if (CustomSliceRegistry.isValidUri(sliceUri)) {
final CustomSliceable sliceable = mCustomSliceManager.getSliceableFromUri(
sliceUri);
return sliceable.getSlice();