Merge "Updating the error message for clear understanding of Deprecated methods. Test: manual Bug: 234089071" into tm-dev
diff --git a/telephony/java/android/telephony/UiccCardInfo.java b/telephony/java/android/telephony/UiccCardInfo.java
index 249f740..e5e8f0a 100644
--- a/telephony/java/android/telephony/UiccCardInfo.java
+++ b/telephony/java/android/telephony/UiccCardInfo.java
@@ -162,7 +162,8 @@
@Deprecated
public String getIccId() {
if (mIccIdAccessRestricted) {
- throw new UnsupportedOperationException("getIccId from UiccPortInfo");
+ throw new UnsupportedOperationException("getIccId() is not supported by UiccCardInfo."
+ + " Please Use UiccPortInfo API instead");
}
//always return ICCID from first port.
return getPorts().stream().findFirst().get().getIccId();
diff --git a/telephony/java/android/telephony/UiccSlotInfo.java b/telephony/java/android/telephony/UiccSlotInfo.java
index dd3639a..06c5b5c 100644
--- a/telephony/java/android/telephony/UiccSlotInfo.java
+++ b/telephony/java/android/telephony/UiccSlotInfo.java
@@ -161,7 +161,8 @@
@Deprecated
public boolean getIsActive() {
if (mLogicalSlotAccessRestricted) {
- throw new UnsupportedOperationException("get port status from UiccPortInfo");
+ throw new UnsupportedOperationException("getIsActive() is not supported by "
+ + "UiccSlotInfo. Please Use UiccPortInfo API instead");
}
//always return status from first port.
return getPorts().stream().findFirst().get().isActive();
@@ -198,7 +199,8 @@
@Deprecated
public int getLogicalSlotIdx() {
if (mLogicalSlotAccessRestricted) {
- throw new UnsupportedOperationException("get logical slot index from UiccPortInfo");
+ throw new UnsupportedOperationException("getLogicalSlotIdx() is not supported by "
+ + "UiccSlotInfo. Please use UiccPortInfo API instead");
}
//always return logical slot index from first port.
//portList always have at least one element.