Merge changes I5c5c4eb3,I36712447,I5b78d449

am: fd5241f120

Change-Id: I656e66400a1a328e5236bd3e3dfd30d291f7d858
This commit is contained in:
Jack Yu
2019-12-13 22:05:05 -08:00
committed by android-build-merger
4 changed files with 28 additions and 15 deletions

View File

@@ -4117,20 +4117,6 @@ public final class Telephony {
*/
public static final String CID = "cid";
/**
* Message code. <em>OBSOLETE: merged into SERIAL_NUMBER.</em>
* <P>Type: INTEGER</P>
* @hide
*/
public static final String V1_MESSAGE_CODE = "message_code";
/**
* Message identifier. <em>OBSOLETE: renamed to SERVICE_CATEGORY.</em>
* <P>Type: INTEGER</P>
* @hide
*/
public static final String V1_MESSAGE_IDENTIFIER = "message_id";
/**
* Service category which represents the general topic of the message.
* <p>

View File

@@ -18,6 +18,7 @@ package android.telephony;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.os.Build;
import android.text.TextUtils;
import java.util.ArrayList;
@@ -257,6 +258,15 @@ public class CbGeoUtils {
return new Point(x - p.x, y - p.y);
}
}
@Override
public String toString() {
String str = "Polygon: ";
if (Build.IS_DEBUGGABLE) {
str += mVertices;
}
return str;
}
}
/**
@@ -284,6 +294,16 @@ public class CbGeoUtils {
public boolean contains(LatLng p) {
return mCenter.distance(p) <= mRadiusMeter;
}
@Override
public String toString() {
String str = "Circle: ";
if (Build.IS_DEBUGGABLE) {
str += mCenter + ", radius = " + mRadiusMeter;
}
return str;
}
}
/**

View File

@@ -533,7 +533,8 @@ public final class SmsCbMessage implements Parcelable {
+ ", priority=" + mPriority
+ (mEtwsWarningInfo != null ? (", " + mEtwsWarningInfo.toString()) : "")
+ (mCmasWarningInfo != null ? (", " + mCmasWarningInfo.toString()) : "")
+ ", maximumWaitingTime = " + mMaximumWaitTimeSec
+ ", maximumWaitingTime=" + mMaximumWaitTimeSec
+ ", received time=" + mReceivedTimeMillis
+ ", slotIndex = " + mSlotIndex
+ ", geo=" + (mGeometries != null
? CbGeoUtils.encodeGeometriesToString(mGeometries) : "null")

View File

@@ -2367,6 +2367,8 @@ public class TelephonyManager {
*
* @return the lowercase 2 character ISO-3166 country code, or empty string if not available.
*
* @throws IllegalArgumentException when the slotIndex is invalid.
*
* {@hide}
*/
@SystemApi
@@ -2374,6 +2376,10 @@ public class TelephonyManager {
@NonNull
public String getNetworkCountryIso(int slotIndex) {
try {
if (!SubscriptionManager.isValidSlotIndex(slotIndex)) {
throw new IllegalArgumentException("invalid slot index " + slotIndex);
}
ITelephony telephony = getITelephony();
if (telephony == null) return "";
return telephony.getNetworkCountryIsoForPhone(slotIndex);