Show subId info for getMessagesFromIntent log if it available only

getMessagesFromIntent with default SMS subId log is shown from
AppSmsManager for MT SMS always since an intent without subId info is
delivered to AppSmsManager first.
It might be confusing when checking MT SMS log for multi-sim devices.

Bug: 161156506
Test: MT SMS and Check log

Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
Change-Id: I66da0d5d9802c4427572cb1674be452582066450
This commit is contained in:
Taesu Lee
2020-05-27 12:48:57 +09:00
parent 1371e73894
commit 7e26fe7ce3

View File

@@ -1331,8 +1331,7 @@ public final class Telephony {
Object[] messages;
try {
messages = (Object[]) intent.getSerializableExtra("pdus");
}
catch (ClassCastException e) {
} catch (ClassCastException e) {
Rlog.e(TAG, "getMessagesFromIntent: " + e);
return null;
}
@@ -1344,9 +1343,12 @@ public final class Telephony {
String format = intent.getStringExtra("format");
int subId = intent.getIntExtra(SubscriptionManager.EXTRA_SUBSCRIPTION_INDEX,
SubscriptionManager.getDefaultSmsSubscriptionId());
Rlog.v(TAG, " getMessagesFromIntent sub_id : " + subId);
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
if (subId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
Rlog.v(TAG, "getMessagesFromIntent with valid subId : " + subId);
} else {
Rlog.v(TAG, "getMessagesFromIntent");
}
int pduCount = messages.length;
SmsMessage[] msgs = new SmsMessage[pduCount];