| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.telecom; |
| 18 |
|
| 19 |
import android.net.Uri; |
| 20 |
import android.os.Parcel; |
| 21 |
import android.os.Parcelable; |
| 22 |
import android.text.TextUtils; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
public class GatewayInfo implements Parcelable { |
| 38 |
|
| 39 |
private final String mGatewayProviderPackageName; |
| 40 |
private final Uri mGatewayAddress; |
| 41 |
private final Uri mOriginalAddress; |
| 42 |
|
| 43 |
public GatewayInfo(String packageName, Uri gatewayUri, Uri originalAddress) { |
| 44 |
mGatewayProviderPackageName = packageName; |
| 45 |
mGatewayAddress = gatewayUri; |
| 46 |
mOriginalAddress = originalAddress; |
| 47 |
} |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
public String getGatewayProviderPackageName() { |
| 55 |
return mGatewayProviderPackageName; |
| 56 |
} |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
public Uri getGatewayAddress() { |
| 62 |
return mGatewayAddress; |
| 63 |
} |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
public Uri getOriginalAddress() { |
| 69 |
return mOriginalAddress; |
| 70 |
} |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
public boolean isEmpty() { |
| 77 |
return TextUtils.isEmpty(mGatewayProviderPackageName) || mGatewayAddress == null; |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
public static final @android.annotation.NonNull Parcelable.Creator<GatewayInfo> CREATOR = |
| 84 |
new Parcelable.Creator<GatewayInfo> () { |
| 85 |
|
| 86 |
@Override |
| 87 |
public GatewayInfo createFromParcel(Parcel source) { |
| 88 |
String gatewayPackageName = source.readString(); |
| 89 |
Uri gatewayUri = Uri.CREATOR.createFromParcel(source); |
| 90 |
Uri originalAddress = Uri.CREATOR.createFromParcel(source); |
| 91 |
return new GatewayInfo(gatewayPackageName, gatewayUri, originalAddress); |
| 92 |
} |
| 93 |
|
| 94 |
@Override |
| 95 |
public GatewayInfo[] newArray(int size) { |
| 96 |
return new GatewayInfo[size]; |
| 97 |
} |
| 98 |
}; |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
@Override |
| 104 |
public int describeContents() { |
| 105 |
return 0; |
| 106 |
} |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
@Override |
| 112 |
public void writeToParcel(Parcel destination, int flags) { |
| 113 |
destination.writeString(mGatewayProviderPackageName); |
| 114 |
Uri.writeToParcel(destination, mGatewayAddress); |
| 115 |
Uri.writeToParcel(destination, mOriginalAddress); |
| 116 |
} |
| 117 |
} |