blob: 1dbbf816ed9339a4ebd5a7ee0f2b6deda31e8268 [file] [log] [blame]
Todd Kennedye5195dd2016-10-19 15:29:19 -07001/*
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
Jeff Sharkey84789112017-08-11 14:45:43 -060032 * @removed
Todd Kennedye5195dd2016-10-19 15:29:19 -070033 */
Todd Kennedy1fb34042017-03-01 13:56:58 -080034@Deprecated
Todd Kennedye5195dd2016-10-19 15:29:19 -070035@SystemApi
36public final class EphemeralIntentFilter implements Parcelable {
Todd Kennedy1fb34042017-03-01 13:56:58 -080037 private final InstantAppIntentFilter mInstantAppIntentFilter;
Todd Kennedye5195dd2016-10-19 15:29:19 -070038
39 public EphemeralIntentFilter(@Nullable String splitName, @NonNull List<IntentFilter> filters) {
Todd Kennedy1fb34042017-03-01 13:56:58 -080040 mInstantAppIntentFilter = new InstantAppIntentFilter(splitName, filters);
41 }
42
43 EphemeralIntentFilter(@NonNull InstantAppIntentFilter intentFilter) {
44 mInstantAppIntentFilter = intentFilter;
Todd Kennedye5195dd2016-10-19 15:29:19 -070045 }
46
47 EphemeralIntentFilter(Parcel in) {
Todd Kennedy1fb34042017-03-01 13:56:58 -080048 mInstantAppIntentFilter = in.readParcelable(null /*loader*/);
Todd Kennedye5195dd2016-10-19 15:29:19 -070049 }
50
51 public String getSplitName() {
Todd Kennedy1fb34042017-03-01 13:56:58 -080052 return mInstantAppIntentFilter.getSplitName();
Todd Kennedye5195dd2016-10-19 15:29:19 -070053 }
54
55 public List<IntentFilter> getFilters() {
Todd Kennedy1fb34042017-03-01 13:56:58 -080056 return mInstantAppIntentFilter.getFilters();
57 }
58
59 /** @hide */
60 InstantAppIntentFilter getInstantAppIntentFilter() {
61 return mInstantAppIntentFilter;
Todd Kennedye5195dd2016-10-19 15:29:19 -070062 }
63
64 @Override
65 public int describeContents() {
66 return 0;
67 }
68
69 @Override
70 public void writeToParcel(Parcel out, int flags) {
Todd Kennedy1fb34042017-03-01 13:56:58 -080071 out.writeParcelable(mInstantAppIntentFilter, flags);
Todd Kennedye5195dd2016-10-19 15:29:19 -070072 }
73
74 public static final Parcelable.Creator<EphemeralIntentFilter> CREATOR
75 = new Parcelable.Creator<EphemeralIntentFilter>() {
Todd Kennedy1fb34042017-03-01 13:56:58 -080076 @Override
Todd Kennedye5195dd2016-10-19 15:29:19 -070077 public EphemeralIntentFilter createFromParcel(Parcel in) {
78 return new EphemeralIntentFilter(in);
79 }
Todd Kennedy1fb34042017-03-01 13:56:58 -080080 @Override
Todd Kennedye5195dd2016-10-19 15:29:19 -070081 public EphemeralIntentFilter[] newArray(int size) {
82 return new EphemeralIntentFilter[size];
83 }
84 };
Todd Kennedye5195dd2016-10-19 15:29:19 -070085}