Build slice from indexed data in SliceProvider
Connect the SliceIndexing data to the SliceProvider, such that a query to SliceProvider can build a Slice via the indexed data from SlicesIndexingManager. We take the key from the Uri supplied to the SettingSliceProvider and find a potential matching row in the indexed data. The matched data is then used to Build a slice for the caller. Bug: 67996923 Test: robotests Change-Id: If51bfd1a05c3f3817ae720554f95a98fc7b002e1
This commit is contained in:
@@ -15,7 +15,7 @@ public class SlicesFeatureProviderImpl implements SlicesFeatureProvider {
|
||||
@Override
|
||||
public SlicesIndexer getSliceIndexer(Context context) {
|
||||
if (mSlicesIndexer == null) {
|
||||
mSlicesIndexer = new SlicesIndexer(context.getApplicationContext());
|
||||
mSlicesIndexer = new SlicesIndexer(context);
|
||||
}
|
||||
return mSlicesIndexer;
|
||||
}
|
||||
@@ -29,9 +29,14 @@ public class SlicesFeatureProviderImpl implements SlicesFeatureProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void indexSliceData(Context context) {
|
||||
// TODO (b/67996923) add indexing time log
|
||||
public void indexSliceDataAsync(Context context) {
|
||||
SlicesIndexer indexer = getSliceIndexer(context);
|
||||
ThreadUtils.postOnBackgroundThread(indexer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void indexSliceData(Context context) {
|
||||
SlicesIndexer indexer = getSliceIndexer(context);
|
||||
indexer.indexSliceData();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user