diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java index 1858ddc7f4526..066ba6e8678e9 100644 --- a/core/java/android/provider/Telephony.java +++ b/core/java/android/provider/Telephony.java @@ -4117,20 +4117,6 @@ public final class Telephony { */ public static final String CID = "cid"; - /** - * Message code. OBSOLETE: merged into SERIAL_NUMBER. - *

Type: INTEGER

- * @hide - */ - public static final String V1_MESSAGE_CODE = "message_code"; - - /** - * Message identifier. OBSOLETE: renamed to SERVICE_CATEGORY. - *

Type: INTEGER

- * @hide - */ - public static final String V1_MESSAGE_IDENTIFIER = "message_id"; - /** * Service category which represents the general topic of the message. *

diff --git a/telephony/java/android/telephony/CbGeoUtils.java b/telephony/java/android/telephony/CbGeoUtils.java index f4ce6e75769ce..ce5e3f38e78b4 100644 --- a/telephony/java/android/telephony/CbGeoUtils.java +++ b/telephony/java/android/telephony/CbGeoUtils.java @@ -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; + } } /** diff --git a/telephony/java/android/telephony/SmsCbMessage.java b/telephony/java/android/telephony/SmsCbMessage.java index c7f952954d5ff..045d1ebb56404 100644 --- a/telephony/java/android/telephony/SmsCbMessage.java +++ b/telephony/java/android/telephony/SmsCbMessage.java @@ -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") diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index f789d1930bf12..da1a9938935ff 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -2378,6 +2378,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 @@ -2385,6 +2387,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);