1/*
2 * Copyright (C) 2016 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.content.pm;
18
19import android.annotation.NonNull;
20import android.annotation.Nullable;
21import android.annotation.SystemApi;
22import android.content.IntentFilter;
23import android.os.Parcel;
24import android.os.Parcelable;
25
26import java.util.ArrayList;
27import java.util.List;
28
29/**
30 * Information about an ephemeral application intent filter.
31 * @hide
32 * @removed
33 */
34@Deprecated
35@SystemApi
36public final class EphemeralIntentFilter implements Parcelable {
37    private final InstantAppIntentFilter mInstantAppIntentFilter;
38
39    public EphemeralIntentFilter(@Nullable String splitName, @NonNull List<IntentFilter> filters) {
40        mInstantAppIntentFilter = new InstantAppIntentFilter(splitName, filters);
41    }
42
43    EphemeralIntentFilter(@NonNull InstantAppIntentFilter intentFilter) {
44        mInstantAppIntentFilter = intentFilter;
45    }
46
47    EphemeralIntentFilter(Parcel in) {
48        mInstantAppIntentFilter = in.readParcelable(null /*loader*/);
49    }
50
51    public String getSplitName() {
52        return mInstantAppIntentFilter.getSplitName();
53    }
54
55    public List<IntentFilter> getFilters() {
56        return mInstantAppIntentFilter.getFilters();
57    }
58
59    /** @hide */
60    InstantAppIntentFilter getInstantAppIntentFilter() {
61        return mInstantAppIntentFilter;
62    }
63
64    @Override
65    public int describeContents() {
66        return 0;
67    }
68
69    @Override
70    public void writeToParcel(Parcel out, int flags) {
71        out.writeParcelable(mInstantAppIntentFilter, flags);
72    }
73
74    public static final Parcelable.Creator<EphemeralIntentFilter> CREATOR
75            = new Parcelable.Creator<EphemeralIntentFilter>() {
76        @Override
77        public EphemeralIntentFilter createFromParcel(Parcel in) {
78            return new EphemeralIntentFilter(in);
79        }
80        @Override
81        public EphemeralIntentFilter[] newArray(int size) {
82            return new EphemeralIntentFilter[size];
83        }
84    };
85}
86