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

Commit f24e76fb authored by Fan Zhang's avatar Fan Zhang Committed by android-build-merger
Browse files

Guard against disabled app when launcing emergency dialer

am: a54c3d72

Change-Id: I3e62c93ea3320b2a791450bf262951a819724d1e
parents 0bee179e a54c3d72
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
@@ -1473,6 +1474,11 @@ public class TelecomServiceImpl {
                    com.android.internal.R.string.config_emergency_dialer_package);
            Intent intent = new Intent(Intent.ACTION_DIAL_EMERGENCY)
                    .setPackage(packageName);
            ResolveInfo resolveInfo = mPackageManager.resolveActivity(intent, 0 /* flags*/);
            if (resolveInfo == null) {
                // No matching activity from config, fallback to default platform implementation
                intent.setPackage(null);
            }
            if (!TextUtils.isEmpty(number) && TextUtils.isDigitsOnly(number)) {
                intent.setData(Uri.parse("tel:" + number));
            }