Home | History | Annotate | Download | only in android
      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 
     17 package com.android.layoutlib.bridge.android;
     18 
     19 import android.content.ContentProviderOperation;
     20 import android.content.ContentProviderResult;
     21 import android.content.ContentValues;
     22 import android.content.IContentProvider;
     23 import android.content.OperationApplicationException;
     24 import android.content.res.AssetFileDescriptor;
     25 import android.database.Cursor;
     26 import android.net.Uri;
     27 import android.os.Bundle;
     28 import android.os.IBinder;
     29 import android.os.ICancellationSignal;
     30 import android.os.ParcelFileDescriptor;
     31 import android.os.RemoteException;
     32 
     33 import java.io.FileNotFoundException;
     34 import 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  */
     41 public 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(
     85             String callingPackage, Uri arg0, String arg1, ICancellationSignal signal)
     86             throws RemoteException, FileNotFoundException {
     87         // TODO Auto-generated method stub
     88         return null;
     89     }
     90 
     91     @Override
     92     public ParcelFileDescriptor openFile(
     93             String callingPackage, Uri arg0, String arg1, ICancellationSignal signal, IBinder token)
     94             throws RemoteException, FileNotFoundException {
     95         // TODO Auto-generated method stub
     96         return null;
     97     }
     98 
     99     @Override
    100     public Cursor query(String callingPackage, Uri arg0, String[] arg1,
    101             Bundle arg3, ICancellationSignal arg4) throws RemoteException {
    102         // TODO Auto-generated method stub
    103         return null;
    104     }
    105 
    106     @Override
    107     public int update(String callingPackage, Uri arg0, ContentValues arg1, String arg2,
    108             String[] arg3) throws RemoteException {
    109         // TODO Auto-generated method stub
    110         return 0;
    111     }
    112 
    113     @Override
    114     public IBinder asBinder() {
    115         // TODO Auto-generated method stub
    116         return null;
    117     }
    118 
    119     @Override
    120     public String[] getStreamTypes(Uri arg0, String arg1) throws RemoteException {
    121         // TODO Auto-generated method stub
    122         return null;
    123     }
    124 
    125     @Override
    126     public AssetFileDescriptor openTypedAssetFile(String callingPackage, Uri arg0, String arg1,
    127             Bundle arg2, ICancellationSignal signal) throws RemoteException, FileNotFoundException {
    128         // TODO Auto-generated method stub
    129         return null;
    130     }
    131 
    132     @Override
    133     public ICancellationSignal createCancellationSignal() throws RemoteException {
    134         // TODO Auto-generated method stub
    135         return null;
    136     }
    137 
    138 
    139     @Override
    140     public Uri canonicalize(String callingPkg, Uri uri) throws RemoteException {
    141         return null;
    142     }
    143 
    144     @Override
    145     public Uri uncanonicalize(String callingPkg, Uri uri) throws RemoteException {
    146         return null;
    147     }
    148 
    149     @Override
    150     public boolean refresh(String callingPkg, Uri url, Bundle args,
    151                     ICancellationSignal cancellationSignal) throws RemoteException {
    152         return false;
    153     }
    154 }
    155