Loading src/java/com/android/internal/telephony/BtSmsInterfaceManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -17,11 +17,11 @@ package com.android.internal.telephony; import android.app.ActivityThread; import android.app.PendingIntent; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.net.Uri; import android.telecom.PhoneAccount; import android.telephony.SmsManager; Loading @@ -39,7 +39,7 @@ public class BtSmsInterfaceManager { /** * Sends text through connected Bluetooth device */ public void sendText(String destAddr, String text, PendingIntent sentIntent, public void sendText(Context context, String destAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, SubscriptionInfo info) { BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter(); if (btAdapter == null) { Loading @@ -53,7 +53,7 @@ public class BtSmsInterfaceManager { sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_INVALID_BLUETOOTH_ADDRESS); return; } btAdapter.getProfileProxy(ActivityThread.currentApplication().getApplicationContext(), btAdapter.getProfileProxy(context.getApplicationContext(), new MapMessageSender(destAddr, text, device, sentIntent, deliveryIntent), BluetoothProfile.MAP_CLIENT); } Loading src/java/com/android/internal/telephony/SmsController.java +2 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import static com.android.internal.telephony.util.TelephonyUtils.checkDumpPermis import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.app.ActivityThread; import android.app.AppOpsManager; import android.app.PendingIntent; import android.content.Context; Loading Loading @@ -187,7 +186,7 @@ public class SmsController extends ISmsImplBase { private void sendBluetoothText(SubscriptionInfo info, String destAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent) { BtSmsInterfaceManager btSmsInterfaceManager = new BtSmsInterfaceManager(); btSmsInterfaceManager.sendText(destAddr, text, sentIntent, deliveryIntent, info); btSmsInterfaceManager.sendText(mContext, destAddr, text, sentIntent, deliveryIntent, info); } private void sendIccText(int subId, String callingPackage, String destAddr, Loading Loading @@ -365,7 +364,7 @@ public class SmsController extends ISmsImplBase { @Override public boolean isSmsSimPickActivityNeeded(int subId) { final Context context = ActivityThread.currentApplication().getApplicationContext(); final Context context = mContext.getApplicationContext(); ActivityManager am = context.getSystemService(ActivityManager.class); // Don't show the SMS SIM Pick activity if it is not foreground. boolean isCallingProcessForeground = am != null Loading Loading
src/java/com/android/internal/telephony/BtSmsInterfaceManager.java +3 −3 Original line number Diff line number Diff line Loading @@ -17,11 +17,11 @@ package com.android.internal.telephony; import android.app.ActivityThread; import android.app.PendingIntent; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothProfile; import android.content.Context; import android.net.Uri; import android.telecom.PhoneAccount; import android.telephony.SmsManager; Loading @@ -39,7 +39,7 @@ public class BtSmsInterfaceManager { /** * Sends text through connected Bluetooth device */ public void sendText(String destAddr, String text, PendingIntent sentIntent, public void sendText(Context context, String destAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent, SubscriptionInfo info) { BluetoothAdapter btAdapter = BluetoothAdapter.getDefaultAdapter(); if (btAdapter == null) { Loading @@ -53,7 +53,7 @@ public class BtSmsInterfaceManager { sendErrorInPendingIntent(sentIntent, SmsManager.RESULT_INVALID_BLUETOOTH_ADDRESS); return; } btAdapter.getProfileProxy(ActivityThread.currentApplication().getApplicationContext(), btAdapter.getProfileProxy(context.getApplicationContext(), new MapMessageSender(destAddr, text, device, sentIntent, deliveryIntent), BluetoothProfile.MAP_CLIENT); } Loading
src/java/com/android/internal/telephony/SmsController.java +2 −3 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ import static com.android.internal.telephony.util.TelephonyUtils.checkDumpPermis import android.annotation.Nullable; import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.app.ActivityThread; import android.app.AppOpsManager; import android.app.PendingIntent; import android.content.Context; Loading Loading @@ -187,7 +186,7 @@ public class SmsController extends ISmsImplBase { private void sendBluetoothText(SubscriptionInfo info, String destAddr, String text, PendingIntent sentIntent, PendingIntent deliveryIntent) { BtSmsInterfaceManager btSmsInterfaceManager = new BtSmsInterfaceManager(); btSmsInterfaceManager.sendText(destAddr, text, sentIntent, deliveryIntent, info); btSmsInterfaceManager.sendText(mContext, destAddr, text, sentIntent, deliveryIntent, info); } private void sendIccText(int subId, String callingPackage, String destAddr, Loading Loading @@ -365,7 +364,7 @@ public class SmsController extends ISmsImplBase { @Override public boolean isSmsSimPickActivityNeeded(int subId) { final Context context = ActivityThread.currentApplication().getApplicationContext(); final Context context = mContext.getApplicationContext(); ActivityManager am = context.getSystemService(ActivityManager.class); // Don't show the SMS SIM Pick activity if it is not foreground. boolean isCallingProcessForeground = am != null Loading