diff options
| author | 2019-02-06 18:59:19 -0800 | |
|---|---|---|
| committer | 2019-02-15 09:56:00 -0800 | |
| commit | 69e0ed19e10407bceded9ee0091b3cf6f03660f0 (patch) | |
| tree | 386cbc93701425a2ac23e08edfbb155e7d680d11 | |
| parent | e3ae238f4a7f0acb52b2e6fe05e7b06c513e98a1 (diff) | |
Expose the Radio HAL Version for Test Purposes
To properly check that values are being populated by
devices supporting newer HALs, it is necessary to
avoid enforcement on devices using older HAL versions.
Exposing the HAL version for test purposes allows that.
Bug: 122834594
Test: compilation
Change-Id: Idadc2fc8dd4f7b4765af90d92b62eea3e017a843
| -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 c9d176979a65..dc97dd061578 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -1479,6 +1479,7 @@ package android.telephony { public class TelephonyManager { 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 UNKNOWN_CARRIER_ID_LIST_VERSION = -1; // 0xffffffff diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 1433b2ac9280..e4195776d9c4 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -10310,4 +10310,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 e6a55585506c..ce2b00f2cbf5 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1852,4 +1852,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(); } |