diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 0dd6c0bb5d04c..c8ff08c5fec63 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -6611,5 +6611,26 @@ public class TelephonyManager { } return false; } + + /** + * Get the most recently available signal strength information. + * + * Get the most recent SignalStrength information reported by the modem. Due + * to power saving this information may not always be current. + * @return the most recent cached signal strength info from the modem + * @hide + */ + @Nullable + public SignalStrength getSignalStrength() { + try { + ITelephony service = getITelephony(); + if (service != null) { + return service.getSignalStrength(getSubId()); + } + } catch (RemoteException e) { + Log.e(TAG, "Error calling ITelephony#getSignalStrength", e); + } + return null; + } } diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index 7c74729ba5868..c53f5d3a2d08c 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -34,6 +34,7 @@ import android.telephony.NeighboringCellInfo; import android.telephony.NetworkScanRequest; import android.telephony.RadioAccessFamily; import android.telephony.ServiceState; +import android.telephony.SignalStrength; import android.telephony.TelephonyHistogram; import android.telephony.VisualVoicemailSmsFilterSettings; import com.android.ims.internal.IImsServiceController; @@ -1343,4 +1344,15 @@ interface ITelephony { * @hide */ boolean getEmergencyCallbackMode(int subId); + + /** + * Get the most recently available signal strength information. + * + * Get the most recent SignalStrength information reported by the modem. Due + * to power saving this information may not always be current. + * @param subId Subscription index + * @return the most recent cached signal strength info from the modem + * @hide + */ + SignalStrength getSignalStrength(int subId); }