From 96dd9e4dfe39817d4c9287b9c732905970bc692d Mon Sep 17 00:00:00 2001 From: Malcolm Chen Date: Wed, 27 Mar 2019 19:21:11 -0700 Subject: [PATCH] Add @hide API to return whether a modem stack is enabled or not. Bug: 129296702 Test: TelephonyManagerTestApp Change-Id: I7ef4ad8322cf85e5a159363e90dde303ac7240de Merged-In: I7ef4ad8322cf85e5a159363e90dde303ac7240de --- .../android/telephony/TelephonyManager.java | 19 +++++++++++++++++++ .../internal/telephony/ITelephony.aidl | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index f9d9baba0bebc..2b4209c519b12 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -10695,6 +10695,25 @@ public class TelephonyManager { return ret; } + /** + * It indicates whether modem is enabled or not per slot. + * It's the corresponding status of {@link #enableModemForSlot}. + * + * @param slotIndex which slot it's checking. + * @hide + */ + public boolean isModemEnabledForSlot(int slotIndex) { + try { + ITelephony telephony = getITelephony(); + if (telephony != null) { + return telephony.isModemEnabledForSlot(slotIndex, mContext.getOpPackageName()); + } + } catch (RemoteException ex) { + Log.e(TAG, "enableModem RemoteException", ex); + } + return false; + } + /** * Indicate if the user is allowed to use multiple SIM cards at the same time to register * on the network (e.g. Dual Standby or Dual Active) when the device supports it, or if the diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 26d0c82b2d000..d173cc9c44e5c 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -1955,5 +1955,7 @@ interface ITelephony { /** * Get the IRadio HAL Version encoded as 100 * MAJOR_VERSION + MINOR_VERSION or -1 if unknown */ - int getRadioHalVersion(); + int getRadioHalVersion(); + + boolean isModemEnabledForSlot(int slotIndex, String callingPackage); }