From 8a1ecd711a9d57cb40b0107dbc8e86d6be1330c2 Mon Sep 17 00:00:00 2001 From: Jonathan Basseri Date: Fri, 4 Aug 2017 00:18:28 +0000 Subject: [PATCH] Revert "Move getNetworkCountryIso impl from TM to PIM." This reverts commit 2b9aa9e9d1b6c4d5b9a7db128818f7d0c5d42ff5. Change-Id: I2787f2bd9cd5afe3fde8afdbb62dc255718fe654 --- .../java/android/telephony/TelephonyManager.java | 12 +++--------- .../com/android/internal/telephony/ITelephony.aidl | 7 ------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 1544218a71c0..2e7b19a2d1c8 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1654,7 +1654,8 @@ public class TelephonyManager { * @hide */ public String getNetworkCountryIso(int subId) { - return getNetworkCountryIsoForPhone(getPhoneId(subId)); + int phoneId = SubscriptionManager.getPhoneId(subId); + return getNetworkCountryIsoForPhone(phoneId); } /** @@ -1669,14 +1670,7 @@ public class TelephonyManager { */ /** {@hide} */ public String getNetworkCountryIsoForPhone(int phoneId) { - try { - ITelephony telephony = getITelephony(); - if (telephony != null) - return ""; - return telephony.getNetworkCountryIsoForPhone(phoneId); - } catch (RemoteException ex) { - return ""; - } + return getTelephonyProperty(phoneId, TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, ""); } /** Network type is unknown */ diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 654adb280310..a0e5b7b0a1d6 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -376,13 +376,6 @@ interface ITelephony { Bundle getCellLocation(String callingPkg); - /** - * Returns the ISO country code equivalent of the current registered - * operator's MCC (Mobile Country Code). - * @see android.telephony.TelephonyManager#getNetworkCountryIso - */ - String getNetworkCountryIsoForPhone(int phoneId); - /** * Returns the neighboring cell information of the device. */ -- GitLab