1 /*
2  * Copyright (C) 2024 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 android.provider;
18 
19 import android.content.res.AssetFileDescriptor;
20 import android.database.Cursor;
21 import android.graphics.Point;
22 import android.os.Bundle;
23 import android.os.ParcelFileDescriptor;
24 
25 /**
26  * Used to store the returned results from CloudProviderApis.
27  */
28 class CmpApiResult {
29     private String mApi;
30     private Cursor mCursor;
31     private Bundle mBundle;
32     private Point mDimensions;
33     private ParcelFileDescriptor mParcelFileDescriptor;
34     private AssetFileDescriptor mAssetFileDescriptor;
35 
CmpApiResult(String api, Cursor c)36     CmpApiResult(String api, Cursor c) {
37         mApi = api;
38         mCursor = c;
39     }
40 
CmpApiResult(String api, AssetFileDescriptor afd, Point dimensions)41     CmpApiResult(String api, AssetFileDescriptor afd, Point dimensions) {
42         mApi = api;
43         mAssetFileDescriptor = afd;
44         mDimensions = dimensions;
45     }
46 
CmpApiResult(String api, Bundle bundle)47     CmpApiResult(String api, Bundle bundle) {
48         mApi = api;
49         mBundle = bundle;
50     }
51 
CmpApiResult(String api, ParcelFileDescriptor pfd)52     CmpApiResult(String api, ParcelFileDescriptor pfd) {
53         mApi = api;
54         mParcelFileDescriptor = pfd;
55     }
56 
getApi()57     String getApi() {
58         return mApi;
59     }
60 
getCursor()61     Cursor getCursor() {
62         return mCursor;
63     }
64 
getBundle()65     Bundle getBundle() {
66         return mBundle;
67     }
68 
getDimensions()69     Point getDimensions() {
70         return mDimensions;
71     }
72 
getParcelFileDescriptor()73     ParcelFileDescriptor getParcelFileDescriptor() {
74         return mParcelFileDescriptor;
75     }
76 
getAssetFileDescriptor()77     AssetFileDescriptor getAssetFileDescriptor() {
78         return mAssetFileDescriptor;
79     }
80 }
81