1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
|
/*
* 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 android.provider;
import android.annotation.SystemApi;
import android.content.ContentResolver;
/**
* Describe the contract for an Indexable data.
*
* @hide
*/
@SystemApi
public class SearchIndexablesContract {
/**
* Intent action used to identify {@link SearchIndexablesProvider}
* instances. This is used in the {@code <intent-filter>} of a {@code <provider>}.
*/
public static final String PROVIDER_INTERFACE =
"android.content.action.SEARCH_INDEXABLES_PROVIDER";
private static final String SETTINGS = "settings";
/**
* Indexable reference names.
*/
public static final String INDEXABLES_XML_RES = "indexables_xml_res";
/**
* ContentProvider path for indexable xml resources.
*/
public static final String INDEXABLES_XML_RES_PATH = SETTINGS + "/" + INDEXABLES_XML_RES;
/**
* Indexable raw data names.
*/
public static final String INDEXABLES_RAW = "indexables_raw";
/**
* ContentProvider path for indexable raw data.
*/
public static final String INDEXABLES_RAW_PATH = SETTINGS + "/" + INDEXABLES_RAW;
/**
* Non indexable data keys.
*/
public static final String NON_INDEXABLES_KEYS = "non_indexables_key";
/**
* ContentProvider path for non indexable data keys.
*/
public static final String NON_INDEXABLES_KEYS_PATH = SETTINGS + "/" + NON_INDEXABLES_KEYS;
/**
* Indexable xml resources columns.
*/
public static final String[] INDEXABLES_XML_RES_COLUMNS = new String[] {
XmlResource.COLUMN_RANK, // 0
XmlResource.COLUMN_XML_RESID, // 1
XmlResource.COLUMN_CLASS_NAME, // 2
XmlResource.COLUMN_ICON_RESID, // 3
XmlResource.COLUMN_INTENT_ACTION, // 4
XmlResource.COLUMN_INTENT_TARGET_PACKAGE, // 5
XmlResource.COLUMN_INTENT_TARGET_CLASS // 6
};
/**
* Indexable xml resources columns indices.
*/
public static final int COLUMN_INDEX_XML_RES_RANK = 0;
public static final int COLUMN_INDEX_XML_RES_RESID = 1;
public static final int COLUMN_INDEX_XML_RES_CLASS_NAME = 2;
public static final int COLUMN_INDEX_XML_RES_ICON_RESID = 3;
public static final int COLUMN_INDEX_XML_RES_INTENT_ACTION = 4;
public static final int COLUMN_INDEX_XML_RES_INTENT_TARGET_PACKAGE = 5;
public static final int COLUMN_INDEX_XML_RES_INTENT_TARGET_CLASS = 6;
/**
* Indexable raw data columns.
*/
public static final String[] INDEXABLES_RAW_COLUMNS = new String[] {
RawData.COLUMN_RANK, // 0
RawData.COLUMN_TITLE, // 1
RawData.COLUMN_SUMMARY_ON, // 2
RawData.COLUMN_SUMMARY_OFF, // 3
RawData.COLUMN_ENTRIES, // 4
RawData.COLUMN_KEYWORDS, // 5
RawData.COLUMN_SCREEN_TITLE, // 6
RawData.COLUMN_CLASS_NAME, // 7
RawData.COLUMN_ICON_RESID, // 8
RawData.COLUMN_INTENT_ACTION, // 9
RawData.COLUMN_INTENT_TARGET_PACKAGE, // 10
RawData.COLUMN_INTENT_TARGET_CLASS, // 11
RawData.COLUMN_KEY, // 12
RawData.COLUMN_USER_ID, // 13
RawData.PAYLOAD_TYPE, // 14
RawData.PAYLOAD // 15
};
/**
* Indexable raw data columns indices.
*/
public static final int COLUMN_INDEX_RAW_RANK = 0;
public static final int COLUMN_INDEX_RAW_TITLE = 1;
public static final int COLUMN_INDEX_RAW_SUMMARY_ON = 2;
public static final int COLUMN_INDEX_RAW_SUMMARY_OFF = 3;
public static final int COLUMN_INDEX_RAW_ENTRIES = 4;
public static final int COLUMN_INDEX_RAW_KEYWORDS = 5;
public static final int COLUMN_INDEX_RAW_SCREEN_TITLE = 6;
public static final int COLUMN_INDEX_RAW_CLASS_NAME = 7;
public static final int COLUMN_INDEX_RAW_ICON_RESID = 8;
public static final int COLUMN_INDEX_RAW_INTENT_ACTION = 9;
public static final int COLUMN_INDEX_RAW_INTENT_TARGET_PACKAGE = 10;
public static final int COLUMN_INDEX_RAW_INTENT_TARGET_CLASS = 11;
public static final int COLUMN_INDEX_RAW_KEY = 12;
public static final int COLUMN_INDEX_RAW_USER_ID = 13;
/**
* @hide
*/
public static final int COLUMN_INDEX_RAW_PAYLOAD_TYPE = 14;
/**
* @hide
*/
public static final int COLUMN_INDEX_RAW_PAYLOAD = 15;
/**
* Indexable raw data columns.
*/
public static final String[] NON_INDEXABLES_KEYS_COLUMNS = new String[] {
NonIndexableKey.COLUMN_KEY_VALUE // 0
};
/**
* Non indexable data keys columns indices.
*/
public static final int COLUMN_INDEX_NON_INDEXABLE_KEYS_KEY_VALUE = 0;
/**
* Constants related to a {@link SearchIndexableResource}.
*
* This is a description of
*/
public static final class XmlResource extends BaseColumns {
private XmlResource() {
}
public static final String MIME_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
"/" + INDEXABLES_XML_RES;
/**
* XML resource ID for the {@link android.preference.PreferenceScreen} to load and index.
*/
public static final String COLUMN_XML_RESID = "xmlResId";
}
/**
* Constants related to a {@link SearchIndexableData}.
*
* This is the raw data that is stored into an Index. This is related to
* {@link android.preference.Preference} and its attributes like
* {@link android.preference.Preference#getTitle()},
* {@link android.preference.Preference#getSummary()}, etc.
*
*/
public static final class RawData extends BaseColumns {
private RawData() {
}
public static final String MIME_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
"/" + INDEXABLES_RAW;
/**
* Title's raw data.
*/
public static final String COLUMN_TITLE = "title";
/**
* Summary's raw data when the data is "ON".
*/
public static final String COLUMN_SUMMARY_ON = "summaryOn";
/**
* Summary's raw data when the data is "OFF".
*/
public static final String COLUMN_SUMMARY_OFF = "summaryOff";
/**
* Entries associated with the raw data (when the data can have several values).
*/
public static final String COLUMN_ENTRIES = "entries";
/**
* Keywords' raw data.
*/
public static final String COLUMN_KEYWORDS = "keywords";
/**
* Fragment or Activity title associated with the raw data.
*/
public static final String COLUMN_SCREEN_TITLE = "screenTitle";
/**
* Key associated with the raw data. The key needs to be unique.
*/
public static final String COLUMN_KEY = "key";
/**
* UserId associated with the raw data.
*/
public static final String COLUMN_USER_ID = "user_id";
/**
* Identifier for the Payload object type.
* @hide
*/
public static final String PAYLOAD_TYPE = "payload_type";
/**
* Generic payload for improving Search result expressiveness.
* @hide
*/
public static final String PAYLOAD = "payload";
}
/**
* Constants related to a {@link SearchIndexableResource} and {@link SearchIndexableData}.
*
* This is a description of a data (thru its unique key) that cannot be indexed.
*/
public static final class NonIndexableKey extends BaseColumns {
private NonIndexableKey() {
}
public static final String MIME_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE +
"/" + NON_INDEXABLES_KEYS;
/**
* Key for the non indexable data.
*/
public static final String COLUMN_KEY_VALUE = "key";
}
/**
* The base columns.
*/
public static class BaseColumns {
private BaseColumns() {
}
/**
* Rank of the data. This is an integer used for ranking the search results. This is
* application specific.
*/
public static final String COLUMN_RANK = "rank";
/**
* Class name associated with the data (usually a Fragment class name).
*/
public static final String COLUMN_CLASS_NAME = "className";
/**
* Icon resource ID for the data.
*/
public static final String COLUMN_ICON_RESID = "iconResId";
/**
* Intent action associated with the data.
*/
public static final String COLUMN_INTENT_ACTION = "intentAction";
/**
* Intent target package associated with the data.
*/
public static final String COLUMN_INTENT_TARGET_PACKAGE = "intentTargetPackage";
/**
* Intent target class associated with the data.
*/
public static final String COLUMN_INTENT_TARGET_CLASS = "intentTargetClass";
}
}
|