BridgeContentProvider.java revision 01f8c0e27756599b2395514e27bd3b238326f220
165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian/*
265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * Copyright (C) 2010 The Android Open Source Project
365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian *
465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * Licensed under the Apache License, Version 2.0 (the "License");
565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * you may not use this file except in compliance with the License.
665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * You may obtain a copy of the License at
765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian *
865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian *      http://www.apache.org/licenses/LICENSE-2.0
965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian *
1065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * Unless required by applicable law or agreed to in writing, software
1165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * distributed under the License is distributed on an "AS IS" BASIS,
1265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * See the License for the specific language governing permissions and
1465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * limitations under the License.
1565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian */
1665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
1765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianpackage com.android.layoutlib.bridge.android;
1865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
1965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.content.ContentProviderOperation;
2065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.content.ContentProviderResult;
2165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.content.ContentValues;
2265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.content.IContentProvider;
2365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.content.OperationApplicationException;
2465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.content.res.AssetFileDescriptor;
2565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.database.Cursor;
2665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.net.Uri;
2765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.os.Bundle;
2865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.os.IBinder;
2965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.os.ICancellationSignal;
3065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.os.ParcelFileDescriptor;
3165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport android.os.RemoteException;
3265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
3365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport java.io.FileNotFoundException;
3465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopianimport java.util.ArrayList;
35799a70e7028a4d714436c3a744a775acfbd31aaeDima Zavin
3665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian/**
3765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian * Mock implementation of {@link IContentProvider}.
385462fc9a38fa8c9dff434cd53fa5fb1782ae3042Mathias Agopian *
395462fc9a38fa8c9dff434cd53fa5fb1782ae3042Mathias Agopian * TODO: never return null when the method is not supposed to. Return fake data instead.
405462fc9a38fa8c9dff434cd53fa5fb1782ae3042Mathias Agopian */
4164760240f931714858a59c1579f07264d7182ba2Dima Zavinpublic final class BridgeContentProvider implements IContentProvider {
427394a4f358fa9908a9f0a7c954b65c399f4268e6Dima Zavin    @Override
4365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public ContentProviderResult[] applyBatch(String callingPackage,
4465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            ArrayList<ContentProviderOperation> arg0)
4565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            throws RemoteException, OperationApplicationException {
46feb0db689c17dced50afaee54c659f1676e2d505Eric Laurent        // TODO Auto-generated method stub
47feb0db689c17dced50afaee54c659f1676e2d505Eric Laurent        return null;
4865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
4965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
5065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
5165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public int bulkInsert(String callingPackage, Uri arg0, ContentValues[] arg1)
5265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            throws RemoteException {
5365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
5465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return 0;
5565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
5665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
5765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
5865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public Bundle call(String callingPackage, String arg0, String arg1, Bundle arg2)
5965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            throws RemoteException {
6065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
6165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
6265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
6365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
6465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
6565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public int delete(String callingPackage, Uri arg0, String arg1, String[] arg2)
665462fc9a38fa8c9dff434cd53fa5fb1782ae3042Mathias Agopian            throws RemoteException {
675462fc9a38fa8c9dff434cd53fa5fb1782ae3042Mathias Agopian        // TODO Auto-generated method stub
685462fc9a38fa8c9dff434cd53fa5fb1782ae3042Mathias Agopian        return 0;
6965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
705462fc9a38fa8c9dff434cd53fa5fb1782ae3042Mathias Agopian
7165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
725462fc9a38fa8c9dff434cd53fa5fb1782ae3042Mathias Agopian    public String getType(Uri arg0) throws RemoteException {
7365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
7465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
7565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
7665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
7765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
7865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public Uri insert(String callingPackage, Uri arg0, ContentValues arg1) throws RemoteException {
7965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
8065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
810d255b2d9061ba31f13ada3fc0f7e51916407176Jean-Michel Trivi    }
820d255b2d9061ba31f13ada3fc0f7e51916407176Jean-Michel Trivi
8365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
8465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public AssetFileDescriptor openAssetFile(
8565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            String callingPackage, Uri arg0, String arg1, ICancellationSignal signal)
8665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            throws RemoteException, FileNotFoundException {
8765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
8865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
8965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
9065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
9165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
920d255b2d9061ba31f13ada3fc0f7e51916407176Jean-Michel Trivi    public ParcelFileDescriptor openFile(
9365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            String callingPackage, Uri arg0, String arg1, ICancellationSignal signal)
9465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            throws RemoteException, FileNotFoundException {
9565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
9665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
9765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
9865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
9965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
10065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public Cursor query(String callingPackage, Uri arg0, String[] arg1, String arg2, String[] arg3,
10165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            String arg4, ICancellationSignal arg5) throws RemoteException {
10265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
10365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
10465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
10565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
10665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
10765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public int update(String callingPackage, Uri arg0, ContentValues arg1, String arg2,
10865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            String[] arg3) throws RemoteException {
10965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
11065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return 0;
11165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
11265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
11365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
11465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public IBinder asBinder() {
11565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
11665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
11765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
11865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
11965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
12065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public String[] getStreamTypes(Uri arg0, String arg1) throws RemoteException {
12165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
12265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
12365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
12465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
12565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
12665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public AssetFileDescriptor openTypedAssetFile(String callingPackage, Uri arg0, String arg1,
12765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian            Bundle arg2, ICancellationSignal signal) throws RemoteException, FileNotFoundException {
12865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
12965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
13065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
13165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
13265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
13365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public ICancellationSignal createCancellationSignal() throws RemoteException {
13465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        // TODO Auto-generated method stub
13565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
13665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
13765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
13865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
13965ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public Uri canonicalize(String callingPkg, Uri uri) throws RemoteException {
14065ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
14165ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
14265ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian
14365ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    @Override
14465ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    public Uri uncanonicalize(String callingPkg, Uri uri) throws RemoteException {
14565ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian        return null;
14665ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian    }
14765ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian}
14865ab47156e1c7dfcd8cc4266253a5ff30219e7f0Mathias Agopian