1 /*
2  * Copyright (C) 2015 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.webkit;
18 
19 import android.annotation.NonNull;
20 import android.annotation.Nullable;
21 import android.compat.annotation.UnsupportedAppUsage;
22 import android.content.pm.PackageInfo;
23 import android.os.Parcel;
24 import android.os.Parcelable;
25 
26 /** @hide */
27 public final class WebViewProviderResponse implements Parcelable {
28 
WebViewProviderResponse(PackageInfo packageInfo, int status)29     public WebViewProviderResponse(PackageInfo packageInfo, int status) {
30         this.packageInfo = packageInfo;
31         this.status = status;
32     }
33 
34     // aidl stuff
35     public static final @NonNull Parcelable.Creator<WebViewProviderResponse> CREATOR =
36         new Parcelable.Creator<WebViewProviderResponse>() {
37             public WebViewProviderResponse createFromParcel(Parcel in) {
38                 return new WebViewProviderResponse(in);
39             }
40 
41             public WebViewProviderResponse[] newArray(int size) {
42                 return new WebViewProviderResponse[size];
43             }
44         };
45 
WebViewProviderResponse(Parcel in)46     private WebViewProviderResponse(Parcel in) {
47         packageInfo = in.readTypedObject(PackageInfo.CREATOR);
48         status = in.readInt();
49     }
50 
51     @Override
describeContents()52     public int describeContents() {
53         return 0;
54     }
55 
56     @Override
writeToParcel(Parcel out, int flags)57     public void writeToParcel(Parcel out, int flags) {
58         out.writeTypedObject(packageInfo, flags);
59         out.writeInt(status);
60     }
61 
62     @UnsupportedAppUsage
63     @Nullable
64     public final PackageInfo packageInfo;
65     public final int status;
66 }
67