diff options
-rw-r--r-- | api/test-current.txt | 1 | ||||
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 24 | ||||
-rw-r--r-- | telephony/java/com/android/internal/telephony/ITelephony.aidl | 5 |
3 files changed, 30 insertions, 0 deletions
diff --git a/api/test-current.txt b/api/test-current.txt index fa9a5d3350d9..0a8d80b19de4 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -2235,6 +2235,7 @@ package android.telephony { public class TelephonyManager { method public int checkCarrierPrivilegesForPackage(String); method public int getCarrierIdListVersion(); + method public android.util.Pair<java.lang.Integer,java.lang.Integer> getRadioHalVersion(); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile(); method public void setCarrierTestOverride(String, String, String, String, String, String, String); field public static final int CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES = -2; // 0xfffffffe diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index ced4f4ab6573..0b72679cdf2a 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -10375,4 +10375,28 @@ public class TelephonyManager { } return false; } + + /** + * Retrieve the Radio HAL Version for this device. + * + * Get the HAL version for the IRadio interface for test purposes. + * + * @return a Pair of (major version, minor version) or (-1,-1) if unknown. + * + * @hide + */ + @TestApi + public Pair<Integer, Integer> getRadioHalVersion() { + try { + ITelephony service = getITelephony(); + if (service != null) { + int version = service.getRadioHalVersion(); + if (version == -1) return new Pair<Integer, Integer>(-1, -1); + return new Pair<Integer, Integer>(version / 100, version % 100); + } + } catch (RemoteException e) { + Log.e(TAG, "getRadioHalVersion() RemoteException", e); + } + return new Pair<Integer, Integer>(-1, -1); + } } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 7089ee5671c2..c54a60629ecb 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1855,4 +1855,9 @@ interface ITelephony { * Get the mapping from logical slots to physical slots. */ int[] getSlotsMapping(); + + /** + * Get the IRadio HAL Version encoded as 100 * MAJOR_VERSION + MINOR_VERSION or -1 if unknown + */ + int getRadioHalVersion(); } |