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

Commit dd991040 authored by David Lin's avatar David Lin Committed by Android (Google) Code Review
Browse files

Merge "Checking satellite provisioned in recommending satellite messaging" into 24D1-dev

parents a99e7157 65d20ad6
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -195,8 +195,7 @@ public class SatelliteSOSMessageRecommender extends Handler {
     *                   call.
     */
    public void onEmergencyCallStarted(@NonNull Connection connection) {
        if (!mSatelliteController.isSatelliteSupportedViaOem()
                && !mSatelliteController.isSatelliteEmergencyMessagingSupportedViaCarrier()) {
        if (!isSatelliteSupported()) {
            plogd("onEmergencyCallStarted: satellite is not supported");
            return;
        }
@@ -227,8 +226,7 @@ public class SatelliteSOSMessageRecommender extends Handler {
    public void onEmergencyCallConnectionStateChanged(
            String callId, @Connection.ConnectionState int state) {
        plogd("callId=" + callId + ", state=" + state);
        if (!mSatelliteController.isSatelliteSupportedViaOem()
                && !mSatelliteController.isSatelliteEmergencyMessagingSupportedViaCarrier()) {
        if (!isSatelliteSupported()) {
            plogd("onEmergencyCallConnectionStateChanged: satellite is not supported");
            return;
        }
@@ -760,6 +758,19 @@ public class SatelliteSOSMessageRecommender extends Handler {
                || 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) {
        Rlog.v(TAG, log);
    }