- introduce a new private interface "Indexable". - refactor Wallpaper and Wi-Fi settings to support this new interface. - only index saved/remembered Wi-Fi networks - also add the capability to remove some data from the Index. Fragments that want to publish some dynamic indexable data should implement the "Indexable" interface and provide a static final field named "INDEX_DATA_PROVIDER" with is the Indexable.IndexDataProvider interface for providing the data for indexing. Thru this interface the Index can ask what are the data chuncks to index. Change-Id: I31e7212c87b8218efe1a8f3028147cb19e119be6
53 lines
1.7 KiB
Java
53 lines
1.7 KiB
Java
/*
|
|
* Copyright (C) 2014 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
package com.android.settings.indexer;
|
|
|
|
import android.content.Context;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* Interface for classes whose instances can provide data for indexing.
|
|
*
|
|
* Classes implementing the Indexable interface must have a static field called
|
|
* <code>INDEX_DATA_PROVIDER</code>, which is an object implementing the
|
|
* {@link Indexable.IndexDataProvider Indexable.IndexDataProvider} interface.
|
|
*
|
|
* See {@link IndexableRef} and {@link IndexableData}.
|
|
*
|
|
*/
|
|
public interface Indexable {
|
|
|
|
public interface IndexDataProvider {
|
|
/**
|
|
* Return a list of references for indexing. See {@link IndexableRef}
|
|
*
|
|
* @param context the context
|
|
* @return a list of {@link IndexableRef} references. Can be null.
|
|
*/
|
|
List<IndexableRef> getRefsToIndex(Context context);
|
|
|
|
/**
|
|
* Return a list of raw data for indexing. See {@link IndexableData}
|
|
*
|
|
* @param context the context
|
|
* @return a list of {@link IndexableData} references. Can be null.
|
|
*/
|
|
List<IndexableData> getRawDataToIndex(Context context);
|
|
}
|
|
}
|