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

Commit d34aceac authored by Jake Hamby's avatar Jake Hamby
Browse files

Enable CMAS alert tone and alert dialog for AMBER alerts.

The CMAS UI did not play the CMAS alert tone for AMBER alerts,
showing them as a regular notification instead. Carrier requirements
state that the CMAS alert tone should play for all CMAS alerts.
Remove the AMBER alert exception from
CellBroadcastMessage.isEmergencyAlertMessage().

Bug: 7417676
Change-Id: If24f6b4ebd4633f671beebbe7784b6cc012c358a
parent 151274cf
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -22,10 +22,6 @@ import android.database.Cursor;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.Telephony;
import android.telephony.SmsCbCmasInfo;
import android.telephony.SmsCbEtwsInfo;
import android.telephony.SmsCbLocation;
import android.telephony.SmsCbMessage;
import android.text.format.DateUtils;

/**
@@ -323,20 +319,12 @@ public class CellBroadcastMessage implements Parcelable {

    /**
     * Returns whether the broadcast is an emergency (PWS) message type,
     * including test messages, but excluding lower priority Amber alert broadcasts.
     * including test messages and AMBER alerts.
     *
     * @return true if the message is PWS type, excluding Amber alerts
     * @return true if the message is PWS type (ETWS or CMAS)
     */
    public boolean isEmergencyAlertMessage() {
        if (!mSmsCbMessage.isEmergencyMessage()) {
            return false;
        }
        SmsCbCmasInfo cmasInfo = mSmsCbMessage.getCmasWarningInfo();
        if (cmasInfo != null &&
                cmasInfo.getMessageClass() == SmsCbCmasInfo.CMAS_CLASS_CHILD_ABDUCTION_EMERGENCY) {
            return false;
        }
        return true;
        return mSmsCbMessage.isEmergencyMessage();
    }

    /**