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

Commit 09ecd683 authored by Thomas Nguyen's avatar Thomas Nguyen
Browse files

Enforce the event EVENT_DISPLAY_SOS_MESSAGE sent only for emergency call

Bug: 268542899
Test: manually triggerd emergency call in live network.
atest android.telecom.cts.CallDetailsTest
atest android.telecom.cts.EmergencyCallTests

Change-Id: I2a46f917000a71844c3a3014d90cda92be687af5
parent 5f7b7caf
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.telecom;

import static android.provider.CallLog.Calls.MISSED_REASON_NOT_MISSED;
import static android.telecom.Call.EVENT_DISPLAY_SOS_MESSAGE;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -4072,6 +4073,12 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable,
                l.onReceivedCallQualityReport(this, callQuality);
            }
        } else {
            if (event.equals(EVENT_DISPLAY_SOS_MESSAGE) && !isEmergencyCall()) {
                Log.w(this, "onConnectionEvent: EVENT_DISPLAY_SOS_MESSAGE is sent "
                        + "without an emergency call");
                return;
            }

            for (Listener l : mListeners) {
                l.onConnectionEvent(this, event, extras);
            }