1 /*
2  * Copyright (C) 2019 The Android Open Source Project
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 
17 package com.android.settingslib.search;
18 
19 /**
20  * A Bundle class used in {@link SearchIndexableResources} to provide search Index data.
21  */
22 public class SearchIndexableData {
23     private final Class mTargetClass;
24     private final Indexable.SearchIndexProvider mSearchIndexProvider;
25 
26     /**
27      * Constructs a SearchIndexableData
28      *
29      * @param targetClass The target opening class of the {@link Indexable.SearchIndexProvider}. It
30      *                    should be a {@link android.app.Activity} or fragment {@link
31      *                    androidx.fragment.app.Fragment}.
32      *                    But fragment is only supported in Android Settings. Other apps should use
33      *                    {@link android.app.Activity}
34      * @param provider    provides searchable data for Android Settings
35      */
SearchIndexableData(Class targetClass, Indexable.SearchIndexProvider provider)36     public SearchIndexableData(Class targetClass, Indexable.SearchIndexProvider provider) {
37         mTargetClass = targetClass;
38         mSearchIndexProvider = provider;
39     }
40 
getTargetClass()41     public Class getTargetClass() {
42         return mTargetClass;
43     }
44 
getSearchIndexProvider()45     public Indexable.SearchIndexProvider getSearchIndexProvider() {
46         return mSearchIndexProvider;
47     }
48 }
49