List of usage examples for android.telephony SubscriptionManager getPhoneId
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) public static int getPhoneId(int subId)
From source file:com.android.mms.transaction.MessagingNotification.java
private static final NotificationInfo getNewIccMessageNotificationInfo(Context context, boolean isSms, String address, String message, String subject, int subId, long timeMillis, Bitmap attachmentBitmap, Contact contact, int attachmentType) { Intent clickIntent = new Intent(context, ManageSimMessages.class); clickIntent.setFlags(/*from w ww. j av a2s .co m*/ Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP); clickIntent.putExtra(PhoneConstants.PHONE_KEY, SubscriptionManager.getPhoneId(subId)); String senderInfo = buildTickerMessage(context, address, null, null).toString(); String senderInfoName = senderInfo.substring(0, senderInfo.length()); CharSequence simName = MessageUtils.getSimName(context, subId); CharSequence ticker = buildTickerMessage(context, address, subject, message); return new NotificationInfo(isSms, clickIntent, message, subject, simName, ticker, timeMillis, senderInfoName, attachmentBitmap, contact, attachmentType, 0); }