| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
package android.service.euicc; |
| 17 |
|
| 18 |
import android.annotation.Nullable; |
| 19 |
import android.annotation.SystemApi; |
| 20 |
import android.compat.annotation.UnsupportedAppUsage; |
| 21 |
import android.os.Build; |
| 22 |
import android.os.Parcel; |
| 23 |
import android.os.Parcelable; |
| 24 |
import android.telephony.euicc.DownloadableSubscription; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
@SystemApi |
| 31 |
public final class GetDownloadableSubscriptionMetadataResult implements Parcelable { |
| 32 |
|
| 33 |
public static final @android.annotation.NonNull Creator<GetDownloadableSubscriptionMetadataResult> CREATOR = |
| 34 |
new Creator<GetDownloadableSubscriptionMetadataResult>() { |
| 35 |
@Override |
| 36 |
public GetDownloadableSubscriptionMetadataResult createFromParcel(Parcel in) { |
| 37 |
return new GetDownloadableSubscriptionMetadataResult(in); |
| 38 |
} |
| 39 |
|
| 40 |
@Override |
| 41 |
public GetDownloadableSubscriptionMetadataResult[] newArray(int size) { |
| 42 |
return new GetDownloadableSubscriptionMetadataResult[size]; |
| 43 |
} |
| 44 |
}; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
@Deprecated |
| 51 |
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) |
| 52 |
public final int result; |
| 53 |
|
| 54 |
@Nullable |
| 55 |
private final DownloadableSubscription mSubscription; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
public int getResult() { |
| 64 |
return result; |
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
@Nullable |
| 73 |
public DownloadableSubscription getDownloadableSubscription() { |
| 74 |
return mSubscription; |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
public GetDownloadableSubscriptionMetadataResult(int result, |
| 87 |
@Nullable DownloadableSubscription subscription) { |
| 88 |
this.result = result; |
| 89 |
if (this.result == EuiccService.RESULT_OK) { |
| 90 |
this.mSubscription = subscription; |
| 91 |
} else { |
| 92 |
if (subscription != null) { |
| 93 |
throw new IllegalArgumentException( |
| 94 |
"Error result with non-null subscription: " + result); |
| 95 |
} |
| 96 |
this.mSubscription = null; |
| 97 |
} |
| 98 |
} |
| 99 |
|
| 100 |
private GetDownloadableSubscriptionMetadataResult(Parcel in) { |
| 101 |
this.result = in.readInt(); |
| 102 |
this.mSubscription = in.readTypedObject(DownloadableSubscription.CREATOR); |
| 103 |
} |
| 104 |
|
| 105 |
@Override |
| 106 |
public void writeToParcel(Parcel dest, int flags) { |
| 107 |
dest.writeInt(result); |
| 108 |
dest.writeTypedObject(this.mSubscription, flags); |
| 109 |
} |
| 110 |
|
| 111 |
@Override |
| 112 |
public int describeContents() { |
| 113 |
return 0; |
| 114 |
} |
| 115 |
} |