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 32 */ 33 @Deprecated 34 @SystemApi 35 public final class EphemeralIntentFilter implements Parcelable { 36 private final InstantAppIntentFilter mInstantAppIntentFilter; 37 EphemeralIntentFilter(@ullable String splitName, @NonNull List<IntentFilter> filters)38 public EphemeralIntentFilter(@Nullable String splitName, @NonNull List<IntentFilter> filters) { 39 mInstantAppIntentFilter = new InstantAppIntentFilter(splitName, filters); 40 } 41 EphemeralIntentFilter(@onNull InstantAppIntentFilter intentFilter)42 EphemeralIntentFilter(@NonNull InstantAppIntentFilter intentFilter) { 43 mInstantAppIntentFilter = intentFilter; 44 } 45 EphemeralIntentFilter(Parcel in)46 EphemeralIntentFilter(Parcel in) { 47 mInstantAppIntentFilter = in.readParcelable(null /*loader*/); 48 } 49 getSplitName()50 public String getSplitName() { 51 return mInstantAppIntentFilter.getSplitName(); 52 } 53 getFilters()54 public List<IntentFilter> getFilters() { 55 return mInstantAppIntentFilter.getFilters(); 56 } 57 58 /** @hide */ getInstantAppIntentFilter()59 InstantAppIntentFilter getInstantAppIntentFilter() { 60 return mInstantAppIntentFilter; 61 } 62 63 @Override describeContents()64 public int describeContents() { 65 return 0; 66 } 67 68 @Override writeToParcel(Parcel out, int flags)69 public void writeToParcel(Parcel out, int flags) { 70 out.writeParcelable(mInstantAppIntentFilter, flags); 71 } 72 73 public static final Parcelable.Creator<EphemeralIntentFilter> CREATOR 74 = new Parcelable.Creator<EphemeralIntentFilter>() { 75 @Override 76 public EphemeralIntentFilter createFromParcel(Parcel in) { 77 return new EphemeralIntentFilter(in); 78 } 79 @Override 80 public EphemeralIntentFilter[] newArray(int size) { 81 return new EphemeralIntentFilter[size]; 82 } 83 }; 84 } 85