Loading telephony/java/android/telephony/TelephonyManager.java +19 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; import android.telecom.PhoneAccount; import android.util.Log; import com.android.internal.telecom.ITelecomService; Loading Loading @@ -4116,4 +4117,21 @@ public class TelephonyManager { ServiceState.rilRadioTechnologyToString(type)); } } /** * Returns the subscription ID for the given phone account. * @hide */ public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) { int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID; try { ITelephony service = getITelephony(); if (service != null) { retval = service.getSubIdForPhoneAccount(phoneAccount); } } catch (RemoteException e) { } return retval; } } telephony/java/com/android/internal/telephony/ITelephony.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.internal.telephony; import android.content.Intent; import android.os.Bundle; import android.telecom.PhoneAccount; import android.telephony.CellInfo; import android.telephony.IccOpenLogicalChannelResponse; import android.telephony.NeighboringCellInfo; Loading Loading @@ -879,4 +880,9 @@ interface ITelephony { * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ String getDeviceId(); /** * Returns the subscription ID associated with the specified PhoneAccount. */ int getSubIdForPhoneAccount(in PhoneAccount phoneAccount); } Loading
telephony/java/android/telephony/TelephonyManager.java +19 −1 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; import android.telecom.PhoneAccount; import android.util.Log; import com.android.internal.telecom.ITelecomService; Loading Loading @@ -4116,4 +4117,21 @@ public class TelephonyManager { ServiceState.rilRadioTechnologyToString(type)); } } /** * Returns the subscription ID for the given phone account. * @hide */ public int getSubIdForPhoneAccount(PhoneAccount phoneAccount) { int retval = SubscriptionManager.INVALID_SUBSCRIPTION_ID; try { ITelephony service = getITelephony(); if (service != null) { retval = service.getSubIdForPhoneAccount(phoneAccount); } } catch (RemoteException e) { } return retval; } }
telephony/java/com/android/internal/telephony/ITelephony.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.internal.telephony; import android.content.Intent; import android.os.Bundle; import android.telecom.PhoneAccount; import android.telephony.CellInfo; import android.telephony.IccOpenLogicalChannelResponse; import android.telephony.NeighboringCellInfo; Loading Loading @@ -879,4 +880,9 @@ interface ITelephony { * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ String getDeviceId(); /** * Returns the subscription ID associated with the specified PhoneAccount. */ int getSubIdForPhoneAccount(in PhoneAccount phoneAccount); }