1e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood/* 2e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * Copyright (C) 2010 The Android Open Source Project 3e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * 4e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * Licensed under the Apache License, Version 2.0 (the "License"); 5e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * you may not use this file except in compliance with the License. 6e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * You may obtain a copy of the License at 7e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * 8e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * http://www.apache.org/licenses/LICENSE-2.0 9e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * 10e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * Unless required by applicable law or agreed to in writing, software 11e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * distributed under the License is distributed on an "AS IS" BASIS, 12e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * See the License for the specific language governing permissions and 14e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * limitations under the License. 15e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood */ 16e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwoodpackage com.android.quicksearchbox.tests.naughty; 17e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 18e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwoodimport android.app.SearchManager; 19e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwoodimport android.content.ContentProvider; 20e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwoodimport android.content.ContentValues; 21e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwoodimport android.content.res.AssetFileDescriptor; 22e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwoodimport android.net.Uri; 23e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwoodimport android.os.Bundle; 24e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 25e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood/** 26e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood * Base class for 'naughty' suggestion providers. 27e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood */ 28e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwoodpublic abstract class NaughtySuggestionProvider extends ContentProvider { 29e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 30e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood @Override 31e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood public boolean onCreate() { 32e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood return true; 33e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood } 34e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 35e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood protected abstract void beNaughty(); 36e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 37e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood @Override 38e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood public String getType(Uri uri) { 39e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood return SearchManager.SUGGEST_MIME_TYPE; 40e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood } 41e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 42e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood @Override 43e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood public Uri insert(Uri uri, ContentValues values) { 44e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood throw new UnsupportedOperationException(); 45e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood } 46e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 47e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood @Override 48e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood public int update(Uri uri, ContentValues values, String selection, 49e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood String[] selectionArgs) { 50e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood throw new UnsupportedOperationException(); 51e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood } 52e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 53e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood @Override 54e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood public int delete(Uri uri, String selection, String[] selectionArgs) { 55e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood throw new UnsupportedOperationException(); 56e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood } 57e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 58e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood @Override 59e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood public AssetFileDescriptor openTypedAssetFile(Uri uri, String mimeTypeFilter, Bundle opts) { 60e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood beNaughty(); 61e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood return null; 62e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood } 63e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood 64e29d52aa72c96c3147fa91d83aeb8dafc6d1f578Mathew Inwood} 65