1/* 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.layoutlib.bridge.android; 18 19import android.content.ContentProviderOperation; 20import android.content.ContentProviderResult; 21import android.content.ContentValues; 22import android.content.IContentProvider; 23import android.content.OperationApplicationException; 24import android.content.res.AssetFileDescriptor; 25import android.database.Cursor; 26import android.net.Uri; 27import android.os.Bundle; 28import android.os.IBinder; 29import android.os.ICancellationSignal; 30import android.os.ParcelFileDescriptor; 31import android.os.RemoteException; 32 33import java.io.FileNotFoundException; 34import java.util.ArrayList; 35 36/** 37 * Mock implementation of {@link IContentProvider}. 38 * 39 * TODO: never return null when the method is not supposed to. Return fake data instead. 40 */ 41public final class BridgeContentProvider implements IContentProvider { 42 @Override 43 public ContentProviderResult[] applyBatch(String callingPackage, 44 ArrayList<ContentProviderOperation> arg0) 45 throws RemoteException, OperationApplicationException { 46 // TODO Auto-generated method stub 47 return null; 48 } 49 50 @Override 51 public int bulkInsert(String callingPackage, Uri arg0, ContentValues[] arg1) 52 throws RemoteException { 53 // TODO Auto-generated method stub 54 return 0; 55 } 56 57 @Override 58 public Bundle call(String callingPackage, String arg0, String arg1, Bundle arg2) 59 throws RemoteException { 60 // TODO Auto-generated method stub 61 return null; 62 } 63 64 @Override 65 public int delete(String callingPackage, Uri arg0, String arg1, String[] arg2) 66 throws RemoteException { 67 // TODO Auto-generated method stub 68 return 0; 69 } 70 71 @Override 72 public String getType(Uri arg0) throws RemoteException { 73 // TODO Auto-generated method stub 74 return null; 75 } 76 77 @Override 78 public Uri insert(String callingPackage, Uri arg0, ContentValues arg1) throws RemoteException { 79 // TODO Auto-generated method stub 80 return null; 81 } 82 83 @Override 84 public AssetFileDescriptor openAssetFile(String callingPackage, Uri arg0, String arg1) 85 throws RemoteException, FileNotFoundException { 86 // TODO Auto-generated method stub 87 return null; 88 } 89 90 @Override 91 public ParcelFileDescriptor openFile(String callingPackage, Uri arg0, String arg1) 92 throws RemoteException, FileNotFoundException { 93 // TODO Auto-generated method stub 94 return null; 95 } 96 97 @Override 98 public Cursor query(String callingPackage, Uri arg0, String[] arg1, String arg2, String[] arg3, 99 String arg4, ICancellationSignal arg5) throws RemoteException { 100 // TODO Auto-generated method stub 101 return null; 102 } 103 104 @Override 105 public int update(String callingPackage, Uri arg0, ContentValues arg1, String arg2, 106 String[] arg3) throws RemoteException { 107 // TODO Auto-generated method stub 108 return 0; 109 } 110 111 @Override 112 public IBinder asBinder() { 113 // TODO Auto-generated method stub 114 return null; 115 } 116 117 @Override 118 public String[] getStreamTypes(Uri arg0, String arg1) throws RemoteException { 119 // TODO Auto-generated method stub 120 return null; 121 } 122 123 @Override 124 public AssetFileDescriptor openTypedAssetFile(String callingPackage, Uri arg0, String arg1, 125 Bundle arg2) throws RemoteException, FileNotFoundException { 126 // TODO Auto-generated method stub 127 return null; 128 } 129 130 @Override 131 public ICancellationSignal createCancellationSignal() throws RemoteException { 132 // TODO Auto-generated method stub 133 return null; 134 } 135} 136