1 package com.android.cts.verifier.nfc.hce; 2 3 import android.os.Parcel; 4 import android.os.Parcelable; 5 6 public class CommandApdu implements Parcelable { 7 private String mApdu; 8 private boolean mReachable; 9 CommandApdu(String apdu, boolean reachable)10 public CommandApdu(String apdu, boolean reachable) { 11 mApdu = apdu; 12 mReachable = reachable; 13 } 14 isReachable()15 public boolean isReachable() { 16 return mReachable; 17 } 18 getApdu()19 public String getApdu() { 20 return mApdu; 21 } 22 23 @Override describeContents()24 public int describeContents() { 25 return 0; 26 } 27 28 public static final Parcelable.Creator<CommandApdu> CREATOR = 29 new Parcelable.Creator<CommandApdu>() { 30 @Override 31 public CommandApdu createFromParcel(Parcel source) { 32 String apdu = source.readString(); 33 boolean reachable = source.readInt() != 0 ? true : false; 34 return new CommandApdu(apdu, reachable); 35 } 36 37 @Override 38 public CommandApdu[] newArray(int size) { 39 return new CommandApdu[size]; 40 } 41 }; 42 43 @Override writeToParcel(Parcel dest, int flags)44 public void writeToParcel(Parcel dest, int flags) { 45 dest.writeString(mApdu); 46 dest.writeInt(mReachable ? 1 : 0); 47 } 48 49 } 50