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

Commit 65d20ad6 authored by Thomas Nguyen's avatar Thomas Nguyen
Browse files

Checking satellite provisioned in recommending satellite messaging

Bug: 343199632
Test: Test with live Skylo network and shield box.
More details in the bug b/346457821

Change-Id: Ie6a09832dcca24d2d17f07af1d7790ee92103c11
parent 0f7ebeba
Loading
Loading
Loading
Loading
+15 −4
Original line number Original line Diff line number Diff line
@@ -195,8 +195,7 @@ public class SatelliteSOSMessageRecommender extends Handler {
     *                   call.
     *                   call.
     */
     */
    public void onEmergencyCallStarted(@NonNull Connection connection) {
    public void onEmergencyCallStarted(@NonNull Connection connection) {
        if (!mSatelliteController.isSatelliteSupportedViaOem()
        if (!isSatelliteSupported()) {
                && !mSatelliteController.isSatelliteEmergencyMessagingSupportedViaCarrier()) {
            plogd("onEmergencyCallStarted: satellite is not supported");
            plogd("onEmergencyCallStarted: satellite is not supported");
            return;
            return;
        }
        }
@@ -227,8 +226,7 @@ public class SatelliteSOSMessageRecommender extends Handler {
    public void onEmergencyCallConnectionStateChanged(
    public void onEmergencyCallConnectionStateChanged(
            String callId, @Connection.ConnectionState int state) {
            String callId, @Connection.ConnectionState int state) {
        plogd("callId=" + callId + ", state=" + state);
        plogd("callId=" + callId + ", state=" + state);
        if (!mSatelliteController.isSatelliteSupportedViaOem()
        if (!isSatelliteSupported()) {
                && !mSatelliteController.isSatelliteEmergencyMessagingSupportedViaCarrier()) {
            plogd("onEmergencyCallConnectionStateChanged: satellite is not supported");
            plogd("onEmergencyCallConnectionStateChanged: satellite is not supported");
            return;
            return;
        }
        }
@@ -760,6 +758,19 @@ public class SatelliteSOSMessageRecommender extends Handler {
                || SystemProperties.getBoolean(BOOT_ALLOW_MOCK_MODEM_PROPERTY, false));
                || SystemProperties.getBoolean(BOOT_ALLOW_MOCK_MODEM_PROPERTY, false));
    }
    }


    private boolean isSatelliteSupported() {
        if (mSatelliteController.isSatelliteEmergencyMessagingSupportedViaCarrier()) return true;
        if (mSatelliteController.isSatelliteSupportedViaOem() && isSatelliteViaOemProvisioned()) {
            return true;
        }
        return false;
    }

    private boolean isSatelliteViaOemProvisioned() {
        Boolean provisioned = mSatelliteController.isSatelliteViaOemProvisioned();
        return (provisioned != null) && provisioned;
    }

    private static void logv(@NonNull String log) {
    private static void logv(@NonNull String log) {
        Rlog.v(TAG, log);
        Rlog.v(TAG, log);
    }
    }