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

Commit 71576ff7 authored by Mitsuhashi Nanase's avatar Mitsuhashi Nanase Committed by android-build-merger
Browse files

Merge "Show an error toast if there is not available SMS app when sending SMS"

am: 223ccf7e

Change-Id: Iacc53d522d3221f7cc64acd67f1d612ae0ccbbcc
parents b37f195d 223ccf7e
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -18,12 +18,17 @@ package com.android.server.telecom;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.UserHandle;
import android.telecom.Log;
import android.widget.Toast;

import com.android.server.telecom.ui.CallRedirectionConfirmDialogActivity;
import com.android.server.telecom.ui.ConfirmCallDialogActivity;

import java.util.List;

public final class TelecomBroadcastIntentProcessor {
    /** The action used to send SMS response for the missed call notification. */
    public static final String ACTION_SEND_SMS_FROM_NOTIFICATION =
@@ -119,7 +124,15 @@ public final class TelecomBroadcastIntentProcessor {

                Intent callIntent = new Intent(Intent.ACTION_SENDTO, intent.getData());
                callIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                PackageManager packageManager = mContext.getPackageManager();
                List<ResolveInfo> activities = packageManager.queryIntentActivitiesAsUser(
                        callIntent, PackageManager.MATCH_DEFAULT_ONLY, userHandle.getIdentifier());
                if (activities.size() > 0) {
                    mContext.startActivityAsUser(callIntent, userHandle);
                } else {
                    Toast.makeText(mContext, com.android.internal.R.string.noApplications,
                            Toast.LENGTH_SHORT).show();
                }

                // Call back recent caller from the missed call notification.
            } else if (ACTION_CALL_BACK_FROM_NOTIFICATION.equals(action)) {