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