blob: 5d091c91abfbb3c5e08c8197927f78b4b6c3d327 [file] [log] [blame]
Gustav Sennton6258dcd2015-10-30 19:25:37 +00001/*
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
17package android.webkit;
18
Gustav Sennton1c177d82016-03-29 20:43:11 +010019import android.annotation.SystemApi;
Gustav Sennton6258dcd2015-10-30 19:25:37 +000020import android.os.Parcel;
21import android.os.Parcelable;
Gustav Sennton6258dcd2015-10-30 19:25:37 +000022
23import java.util.Arrays;
24
Gustav Sennton1c177d82016-03-29 20:43:11 +010025/**
26 * @hide
27 */
28@SystemApi
Gustav Senntondbf5eb02016-03-30 14:53:03 +010029public final class WebViewProviderInfo implements Parcelable {
Gustav Sennton6258dcd2015-10-30 19:25:37 +000030
Gustav Senntondbf5eb02016-03-30 14:53:03 +010031 public WebViewProviderInfo(String packageName, String description,
32 boolean availableByDefault, boolean isFallback, String[] signatures) {
Gustav Sennton6258dcd2015-10-30 19:25:37 +000033 this.packageName = packageName;
34 this.description = description;
Gustav Senntonc83e3fa2016-02-18 12:19:13 +000035 this.availableByDefault = availableByDefault;
36 this.isFallback = isFallback;
Gustav Sennton5c2454c2015-12-17 15:49:33 +000037 this.signatures = signatures;
Gustav Sennton6258dcd2015-10-30 19:25:37 +000038 }
39
Gustav Sennton6258dcd2015-10-30 19:25:37 +000040 // aidl stuff
41 public static final Parcelable.Creator<WebViewProviderInfo> CREATOR =
42 new Parcelable.Creator<WebViewProviderInfo>() {
43 public WebViewProviderInfo createFromParcel(Parcel in) {
44 return new WebViewProviderInfo(in);
45 }
46
47 public WebViewProviderInfo[] newArray(int size) {
48 return new WebViewProviderInfo[size];
49 }
50 };
51
52 private WebViewProviderInfo(Parcel in) {
53 packageName = in.readString();
54 description = in.readString();
Gustav Sennton8b179262016-03-14 11:31:14 +000055 availableByDefault = (in.readInt() > 0);
56 isFallback = (in.readInt() > 0);
Gustav Sennton5c2454c2015-12-17 15:49:33 +000057 signatures = in.createStringArray();
Gustav Sennton6258dcd2015-10-30 19:25:37 +000058 }
59
60 @Override
61 public int describeContents() {
62 return 0;
63 }
64
65 @Override
66 public void writeToParcel(Parcel out, int flags) {
67 out.writeString(packageName);
68 out.writeString(description);
Gustav Sennton8b179262016-03-14 11:31:14 +000069 out.writeInt(availableByDefault ? 1 : 0);
70 out.writeInt(isFallback ? 1 : 0);
Gustav Sennton5c2454c2015-12-17 15:49:33 +000071 out.writeStringArray(signatures);
Gustav Sennton6258dcd2015-10-30 19:25:37 +000072 }
73
74 // fields read from framework resource
Gustav Senntondbf5eb02016-03-30 14:53:03 +010075 public final String packageName;
76 public final String description;
77 public final boolean availableByDefault;
78 public final boolean isFallback;
79 public final String[] signatures;
Jeff Sharkeyc5967e92016-01-07 18:50:29 -070080}