Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91aa3f31 authored by Ying Xu's avatar Ying Xu Committed by Android (Google) Code Review
Browse files

Merge "Remove the ActivityThread#currentApplication()"

parents 39a02fae 21f88853
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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) {
@@ -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);
    }
+2 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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,
@@ -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