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

Commit 6e1e05c9 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6313343 from cefa4768 to qt-qpr3-release

Change-Id: I1a31beed7663ec61f1a2429fc4d0290285a5d486
parents cfef7cdd cefa4768
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -24,16 +24,24 @@ import android.telephony.TelephonyManager;
public class PhoneNumberUtilsAdapterImpl implements PhoneNumberUtilsAdapter {
    @Override
    public boolean isLocalEmergencyNumber(Context context, String number) {
        try {
            TelephonyManager tm = (TelephonyManager) context.getSystemService(
                    Context.TELEPHONY_SERVICE);
            return tm.isEmergencyNumber(number);
        } catch (IllegalStateException ise) {
            return false;
        }
    }

    @Override
    public boolean isPotentialLocalEmergencyNumber(Context context, String number) {
        try {
            TelephonyManager tm = (TelephonyManager) context.getSystemService(
                    Context.TELEPHONY_SERVICE);
            return tm.isPotentialEmergencyNumber(number);
        } catch (IllegalStateException ise) {
            return false;
        }
    }

    @Override
+7 −3
Original line number Diff line number Diff line
@@ -70,8 +70,12 @@ public final class TelephonyUtil {
    }

    public static boolean shouldProcessAsEmergency(Context context, Uri handle) {
        try {
            TelephonyManager tm = (TelephonyManager) context.getSystemService(
                    Context.TELEPHONY_SERVICE);
            return handle != null && tm.isEmergencyNumber(handle.getSchemeSpecificPart());
        } catch (IllegalStateException ise) {
            return false;
        }
    }
}