blob: 12724c673c8358120c6157494ad08350a7781b75 [file] [log] [blame]
Paul Miller2ed4f502015-03-16 17:22:30 -07001/*
2 * Copyright (C) 2010 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
17package com.android.bookmarkprovider;
18
Svetoslavde0e3882015-06-05 16:34:21 -070019import android.content.ContentProvider;
Paul Miller2ed4f502015-03-16 17:22:30 -070020import android.content.ContentValues;
Paul Miller2ed4f502015-03-16 17:22:30 -070021import android.database.Cursor;
Paul Miller2ed4f502015-03-16 17:22:30 -070022import android.database.MatrixCursor;
Paul Miller2ed4f502015-03-16 17:22:30 -070023import android.net.Uri;
Paul Miller2ed4f502015-03-16 17:22:30 -070024import android.provider.Browser;
Paul Miller2ed4f502015-03-16 17:22:30 -070025import android.provider.BrowserContract;
Paul Miller2ed4f502015-03-16 17:22:30 -070026
Svetoslavde0e3882015-06-05 16:34:21 -070027/**
28 * This class exists only for compatibility reasons to prevent apps
29 * querying it from getting null cursors they do not expect and crash.
30 */
31public class BookmarkProvider extends ContentProvider {
Paul Miller2ed4f502015-03-16 17:22:30 -070032
33 @Override
Svetoslavde0e3882015-06-05 16:34:21 -070034 public boolean onCreate() {
35 return true;
Paul Miller2ed4f502015-03-16 17:22:30 -070036 }
37
38 @Override
39 public String getType(Uri uri) {
Svetoslavde0e3882015-06-05 16:34:21 -070040 return BrowserContract.Bookmarks.CONTENT_TYPE;
41 }
42
43 @Override
44 public Uri insert(Uri uri, ContentValues values) {
Paul Miller2ed4f502015-03-16 17:22:30 -070045 return null;
46 }
47
Svetoslavde0e3882015-06-05 16:34:21 -070048 @Override
49 public int delete(Uri uri, String selection, String[] selectionArgs) {
50 return 0;
Paul Miller2ed4f502015-03-16 17:22:30 -070051 }
52
Svetoslavde0e3882015-06-05 16:34:21 -070053 @Override
54 public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
55 return 0;
Paul Miller2ed4f502015-03-16 17:22:30 -070056 }
57
58 @Override
59 public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
60 String sortOrder) {
Svetoslavde0e3882015-06-05 16:34:21 -070061 return new MatrixCursor(Browser.HISTORY_PROJECTION, 0);
Paul Miller2ed4f502015-03-16 17:22:30 -070062 }
Paul Miller2ed4f502015-03-16 17:22:30 -070063}