Merge "make new API to retrieve group identifier level1" into jb-mr2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
279e22bd35
@@ -906,6 +906,24 @@ public class TelephonyManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Group Identifier Level1 for a GSM phone.
|
||||
* Return null if it is unavailable.
|
||||
* <p>
|
||||
* 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.
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user