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

Commit 5abd4681 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Remove call preventing video calls when TTY enabled.

This code was originally put in Telecom, and it really doesn't belong
there.  There is no reason why we should impose a telephony restriction
in Telecom.
Further, the code which generates a Toast in this scenario actually causes
Telecom to crash.
Moving this check to Telephony instead.

Bug: 20090652
Change-Id: I777c0a8bfad59f9aea9abc6680f46284548912c4
parent 57db6988
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -97,9 +97,6 @@
    <!-- Message shown when the user tries to make a video call when already in a video call. -->
    <string name ="duplicate_video_call_not_allowed">Call cannot be added at this time.</string>

    <!-- Message indicating video calls not allowed if user enabled TTY Mode -->
    <string name="video_call_not_allowed_if_tty_enabled">Please disable TTY Mode to make video calls.</string>

    <!-- missing voicemail number -->
    <!-- Title of the "Missing voicemail number" dialog -->
    <string name="no_vm_number">Missing voicemail number</string>
+0 −16
Original line number Diff line number Diff line
@@ -123,27 +123,11 @@ public class UserCallIntentProcessor {
                VideoProfile.STATE_AUDIO_ONLY);
        Log.d(this, "processOutgoingCallIntent videoState = " + videoState);

        if (VideoProfile.isVideo(videoState) && isTtyModeEnabled() &&
                !TelephonyUtil.shouldProcessAsEmergency(mContext, handle)) {

            Toast.makeText(mContext, mContext.getResources().getString(R.string.
                    video_call_not_allowed_if_tty_enabled), Toast.LENGTH_SHORT).show();
            Log.d(this, "Rejecting video calls as tty is enabled");
            return;
        }

        intent.putExtra(CallIntentProcessor.KEY_IS_PRIVILEGED_DIALER,
                isDefaultOrSystemDialer(callingPackageName));
        sendBroadcastToReceiver(intent);
    }

    private boolean isTtyModeEnabled() {
        return (android.provider.Settings.Secure.getInt(
                mContext.getContentResolver(),
                android.provider.Settings.Secure.PREFERRED_TTY_MODE,
                TelecomManager.TTY_MODE_OFF) != TelecomManager.TTY_MODE_OFF);
    }

    private boolean isDefaultOrSystemDialer(String callingPackageName) {
        if (TextUtils.isEmpty(callingPackageName)) {
            return false;