Methods Summary |
---|
public void | attachInfo(android.content.Context context, android.content.pm.ProviderInfo info)Implementation is provided by the parent class.
mAuthority = info.authority;
mMatcher = new UriMatcher(UriMatcher.NO_MATCH);
mMatcher.addURI(mAuthority, SearchIndexablesContract.INDEXABLES_XML_RES_PATH,
MATCH_RES_CODE);
mMatcher.addURI(mAuthority, SearchIndexablesContract.INDEXABLES_RAW_PATH,
MATCH_RAW_CODE);
mMatcher.addURI(mAuthority, SearchIndexablesContract.NON_INDEXABLES_KEYS_PATH,
MATCH_NON_INDEXABLE_KEYS_CODE);
// Sanity check our setup
if (!info.exported) {
throw new SecurityException("Provider must be exported");
}
if (!info.grantUriPermissions) {
throw new SecurityException("Provider must grantUriPermissions");
}
if (!android.Manifest.permission.READ_SEARCH_INDEXABLES.equals(info.readPermission)) {
throw new SecurityException("Provider must be protected by READ_SEARCH_INDEXABLES");
}
super.attachInfo(context, info);
|
public final int | delete(android.net.Uri uri, java.lang.String selection, java.lang.String[] selectionArgs)Implementation is provided by the parent class. Throws by default, and cannot be overriden.
throw new UnsupportedOperationException("Delete not supported");
|
public java.lang.String | getType(android.net.Uri uri)
switch (mMatcher.match(uri)) {
case MATCH_RES_CODE:
return SearchIndexablesContract.XmlResource.MIME_TYPE;
case MATCH_RAW_CODE:
return SearchIndexablesContract.RawData.MIME_TYPE;
case MATCH_NON_INDEXABLE_KEYS_CODE:
return SearchIndexablesContract.NonIndexableKey.MIME_TYPE;
default:
throw new IllegalArgumentException("Unknown URI " + uri);
}
|
public final android.net.Uri | insert(android.net.Uri uri, android.content.ContentValues values)Implementation is provided by the parent class. Throws by default, and cannot be overriden.
throw new UnsupportedOperationException("Insert not supported");
|
public android.database.Cursor | query(android.net.Uri uri, java.lang.String[] projection, java.lang.String selection, java.lang.String[] selectionArgs, java.lang.String sortOrder)
switch (mMatcher.match(uri)) {
case MATCH_RES_CODE:
return queryXmlResources(null);
case MATCH_RAW_CODE:
return queryRawData(null);
case MATCH_NON_INDEXABLE_KEYS_CODE:
return queryNonIndexableKeys(null);
default:
throw new UnsupportedOperationException("Unknown Uri " + uri);
}
|
public abstract android.database.Cursor | queryNonIndexableKeys(java.lang.String[] projection)Returns all {@link android.provider.SearchIndexablesContract.NonIndexableKey}.
Those are the non indexable data keys.
|
public abstract android.database.Cursor | queryRawData(java.lang.String[] projection)Returns all {@link android.provider.SearchIndexablesContract.RawData}.
Those are the raw indexable data.
|
public abstract android.database.Cursor | queryXmlResources(java.lang.String[] projection)Returns all {@link android.provider.SearchIndexablesContract.XmlResource}.
Those are Xml resource IDs to some {@link android.preference.PreferenceScreen}.
|
public final int | update(android.net.Uri uri, android.content.ContentValues values, java.lang.String selection, java.lang.String[] selectionArgs)Implementation is provided by the parent class. Throws by default, and cannot be overriden.
throw new UnsupportedOperationException("Update not supported");
|