2 * Copyright (C) 2016 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.android.settings.core;
18 import com.android.settings.search.ResultPayload;
19 import com.android.settings.search.SearchIndexableRaw;
20 import com.android.settingslib.core.AbstractPreferenceController;
22 import java.util.List;
25 * A controller mixin that adds mobile settings specific functionality
27 public interface PreferenceControllerMixin {
30 * Updates non-indexable keys for search provider.
32 * Called by SearchIndexProvider#getNonIndexableKeys
34 default void updateNonIndexableKeys(List<String> keys) {
35 if (this instanceof AbstractPreferenceController) {
36 if (!((AbstractPreferenceController) this).isAvailable()) {
37 keys.add(((AbstractPreferenceController) this).getPreferenceKey());
43 * Updates raw data for search provider.
45 * Called by SearchIndexProvider#getRawDataToIndex
47 default void updateRawDataToIndex(List<SearchIndexableRaw> rawData) {
51 * @return the {@link ResultPayload} corresponding to the search result type for the preference.
53 default ResultPayload getResultPayload() {