From 52a08cf683a6d183222d795862cfd135cec5694f Mon Sep 17 00:00:00 2001 From: Sungmin Choi Date: Thu, 21 Mar 2013 15:29:37 +0900 Subject: [PATCH] make new API to retrieve group identifier level1 For mvno, user can add or edit mvno data field. To pre-provide the mvno data of the edited apn when the user selects one of the mvno types, need to support IMSI, SPN, and GID1 data. To support GID1, make API to retrieve group identifier level1. bug:6445254 Change-Id: I1bc280054cc7cd37e78a279866cefd62872a19fb --- api/current.txt | 1 + .../android/telephony/TelephonyManager.java | 18 ++++++++++++++++++ .../internal/telephony/IPhoneSubInfo.aidl | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/api/current.txt b/api/current.txt index f4b4d5320e85e..4caa18907084a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -21205,6 +21205,7 @@ package android.telephony { method public int getDataState(); method public java.lang.String getDeviceId(); method public java.lang.String getDeviceSoftwareVersion(); + method public java.lang.String getGroupIdLevel1(); method public java.lang.String getLine1Number(); method public java.util.List getNeighboringCellInfo(); method public java.lang.String getNetworkCountryIso(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 8c47332a0b9f2..4aee902b75631 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -906,6 +906,24 @@ public class TelephonyManager { } } + /** + * Returns the Group Identifier Level1 for a GSM phone. + * Return null if it is unavailable. + *

+ * Requires Permission: + * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} + */ + public String getGroupIdLevel1() { + try { + return getSubscriberInfo().getGroupIdLevel1(); + } catch (RemoteException ex) { + return null; + } catch (NullPointerException ex) { + // This could happen before phone restarts due to crashing + return null; + } + } + /** * Returns the phone number string for line 1, for example, the MSISDN * for a GSM phone. Return null if it is unavailable. diff --git a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl index da0326c4721eb..03940dcdd4b18 100644 --- a/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl +++ b/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl @@ -38,6 +38,11 @@ interface IPhoneSubInfo { */ String getSubscriberId(); + /** + * Retrieves the Group Identifier Level1 for GSM phones. + */ + String getGroupIdLevel1(); + /** * Retrieves the serial number of the ICC, if applicable. */