Show tolled support number when click travel abroad.
Bug: 29105266 Change-Id: I3020039bafe26e8a494075ad2f192dba07ab6dd0
This commit is contained in:
@@ -18,6 +18,8 @@ package com.android.settings.support;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import java.text.ParseException;
|
||||
@@ -25,7 +27,7 @@ import java.text.ParseException;
|
||||
/**
|
||||
* Data model for a support phone number.
|
||||
*/
|
||||
public final class SupportPhone {
|
||||
public final class SupportPhone implements Parcelable {
|
||||
|
||||
public final String language;
|
||||
public final String number;
|
||||
@@ -42,6 +44,12 @@ public final class SupportPhone {
|
||||
number = tokens[2];
|
||||
}
|
||||
|
||||
protected SupportPhone(Parcel in) {
|
||||
language = in.readString();
|
||||
number = in.readString();
|
||||
isTollFree = in.readInt() != 0;
|
||||
}
|
||||
|
||||
public Intent getDialIntent() {
|
||||
return new Intent(Intent.ACTION_DIAL)
|
||||
.setData(new Uri.Builder()
|
||||
@@ -49,4 +57,28 @@ public final class SupportPhone {
|
||||
.appendPath(number)
|
||||
.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel dest, int flags) {
|
||||
dest.writeString(language);
|
||||
dest.writeString(number);
|
||||
dest.writeInt(isTollFree ? 1 : 0);
|
||||
}
|
||||
|
||||
public static final Creator<SupportPhone> CREATOR = new Creator<SupportPhone>() {
|
||||
@Override
|
||||
public SupportPhone createFromParcel(Parcel in) {
|
||||
return new SupportPhone(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupportPhone[] newArray(int size) {
|
||||
return new SupportPhone[size];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user