Hi,
After more investigation, it seems that the "subscription" extra was indeed removed from Android 6.0 in the default case.
The difference can be seen in the "com/android/server/TelephonyRegistry.java" class, in the "
broadcastCallStateChanged" method :Telephony for Android 5.0Telephony for Android 6.0Under Android 5.x, the extra "
subscription" is added unconditionally in the intent :
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
Under Android 6.0+, the extra "subscription" is only added if the TelephonyManager was instantiated for a specific subscription (ie SIM card).
// If a valid subId was specified, we should fire off a subId-specific state
// change intent and include the subId.
if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
intent.setAction(PhoneConstants.ACTION_SUBSCRIPTION_PHONE_STATE_CHANGED);
intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
}
Note : the code is identical in 6.0, 7.0 and "master" (all subsequent versions).
So, it is true that the "subscription" extra is not present anymore in the default case starting in Android 6.0, but the TelephonyManager can be instantiated for a specific subscription/SIM card, which will contain the "subscription" extra.
Do you think is it feasible to integrate this feature into Automate ?
Thanks in advance,
Best regards,