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

Commit 081627e8 authored by Tyler Gunn's avatar Tyler Gunn Committed by Automerger Merge Worker
Browse files

Merge "Fix createLaunchEmergencyDialerIntent API behavior when Telecom...

Merge "Fix createLaunchEmergencyDialerIntent API behavior when Telecom unavailable." into rvc-dev am: 99b3d748 am: 28ba0673 am: 79a5d387

Change-Id: I9e844dbccdf5ee6bef240e76814edf741e58f46e
parents 2f0dca39 79a5d387
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -2218,15 +2218,23 @@ public class TelecomManager {
    @NonNull
    public Intent createLaunchEmergencyDialerIntent(@Nullable String number) {
        ITelecomService service = getTelecomService();
        Intent result = null;
        if (service != null) {
            try {
                result = service.createLaunchEmergencyDialerIntent(number);
                return service.createLaunchEmergencyDialerIntent(number);
            } catch (RemoteException e) {
                Log.e(TAG, "Error createLaunchEmergencyDialerIntent", e);
            }
        } else {
            Log.w(TAG, "createLaunchEmergencyDialerIntent - Telecom service not available.");
        }
        return result;

        // Telecom service knows the package name of the expected emergency dialer package; if it
        // is not available, then fallback to not targeting a specific package.
        Intent intent = new Intent(Intent.ACTION_DIAL_EMERGENCY);
        if (!TextUtils.isEmpty(number) && TextUtils.isDigitsOnly(number)) {
            intent.setData(Uri.fromParts(PhoneAccount.SCHEME_TEL, number, null));
        }
        return intent;
    }

    /**