Loading android/app/src/com/android/bluetooth/map/BluetoothMapContent.java +3 −2 Original line number Diff line number Diff line Loading @@ -3709,9 +3709,10 @@ public class BluetoothMapContent { if (charset == MAP_MESSAGE_CHARSET_NATIVE) { if (type == 1) { //Inbox message.setSmsBodyPdus( BluetoothMapSmsPdu.getDeliverPdus(msgBody, phone, time)); BluetoothMapSmsPdu.getDeliverPdus(mContext, msgBody, phone, time)); } else { message.setSmsBodyPdus(BluetoothMapSmsPdu.getSubmitPdus(msgBody, phone)); message.setSmsBodyPdus( BluetoothMapSmsPdu.getSubmitPdus(mContext, msgBody, phone)); } } else /*if (charset == MAP_MESSAGE_CHARSET_UTF8)*/ { message.setSmsBody(msgBody); Loading android/app/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java +8 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.bluetooth.map; import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA; import android.content.Context; import android.telephony.PhoneNumberUtils; import android.telephony.SmsManager; import android.telephony.SmsMessage; Loading Loading @@ -503,14 +504,14 @@ public class BluetoothMapSmsPdu { return sConcatenatedRef; } public static ArrayList<SmsPdu> getSubmitPdus(String messageText, String address) { public static ArrayList<SmsPdu> getSubmitPdus(Context context, String messageText, String address) { /* Use the generic GSM/CDMA SMS Message functionality within Android to generate the * SMS PDU's as once generated to send the SMS message. */ int activePhone = TelephonyManager.getDefault() .getCurrentPhoneType(); // TODO: Change to use: ((TelephonyManager)myContext // .getSystemService(Context.TELEPHONY_SERVICE)) int activePhone = context.getSystemService(TelephonyManager.class) .getCurrentPhoneType(); int phoneType; GsmAlphabet.TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ? com.android.internal.telephony.cdma.SmsMessage.calculateLength( Loading Loading @@ -609,8 +610,9 @@ public class BluetoothMapSmsPdu { * @param date The delivery time stamp. * @return */ public static ArrayList<SmsPdu> getDeliverPdus(String messageText, String address, long date) { ArrayList<SmsPdu> deliverPdus = getSubmitPdus(messageText, address); public static ArrayList<SmsPdu> getDeliverPdus(Context context, String messageText, String address, long date) { ArrayList<SmsPdu> deliverPdus = getSubmitPdus(context, messageText, address); /* * For CDMA the only difference between deliver and submit pdus are the messageType, Loading Loading
android/app/src/com/android/bluetooth/map/BluetoothMapContent.java +3 −2 Original line number Diff line number Diff line Loading @@ -3709,9 +3709,10 @@ public class BluetoothMapContent { if (charset == MAP_MESSAGE_CHARSET_NATIVE) { if (type == 1) { //Inbox message.setSmsBodyPdus( BluetoothMapSmsPdu.getDeliverPdus(msgBody, phone, time)); BluetoothMapSmsPdu.getDeliverPdus(mContext, msgBody, phone, time)); } else { message.setSmsBodyPdus(BluetoothMapSmsPdu.getSubmitPdus(msgBody, phone)); message.setSmsBodyPdus( BluetoothMapSmsPdu.getSubmitPdus(mContext, msgBody, phone)); } } else /*if (charset == MAP_MESSAGE_CHARSET_UTF8)*/ { message.setSmsBody(msgBody); Loading
android/app/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java +8 −6 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.bluetooth.map; import static android.telephony.TelephonyManager.PHONE_TYPE_CDMA; import android.content.Context; import android.telephony.PhoneNumberUtils; import android.telephony.SmsManager; import android.telephony.SmsMessage; Loading Loading @@ -503,14 +504,14 @@ public class BluetoothMapSmsPdu { return sConcatenatedRef; } public static ArrayList<SmsPdu> getSubmitPdus(String messageText, String address) { public static ArrayList<SmsPdu> getSubmitPdus(Context context, String messageText, String address) { /* Use the generic GSM/CDMA SMS Message functionality within Android to generate the * SMS PDU's as once generated to send the SMS message. */ int activePhone = TelephonyManager.getDefault() .getCurrentPhoneType(); // TODO: Change to use: ((TelephonyManager)myContext // .getSystemService(Context.TELEPHONY_SERVICE)) int activePhone = context.getSystemService(TelephonyManager.class) .getCurrentPhoneType(); int phoneType; GsmAlphabet.TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ? com.android.internal.telephony.cdma.SmsMessage.calculateLength( Loading Loading @@ -609,8 +610,9 @@ public class BluetoothMapSmsPdu { * @param date The delivery time stamp. * @return */ public static ArrayList<SmsPdu> getDeliverPdus(String messageText, String address, long date) { ArrayList<SmsPdu> deliverPdus = getSubmitPdus(messageText, address); public static ArrayList<SmsPdu> getDeliverPdus(Context context, String messageText, String address, long date) { ArrayList<SmsPdu> deliverPdus = getSubmitPdus(context, messageText, address); /* * For CDMA the only difference between deliver and submit pdus are the messageType, Loading