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

Commit dab3190c authored by Thomas Nguyen's avatar Thomas Nguyen Committed by Android (Google) Code Review
Browse files

Merge changes from topic "Cache satellite states 2" into udc-dev

* changes:
  Change return type of isSatelliteSupported from Boolean to boolean
  Revert "Revert "Cache satellite service states and restructure c..."
parents 0eb74774 93c001b8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3034,6 +3034,13 @@ public interface CommandsInterface {
     */
    default void getSatellitePowerState(Message result) {}

    /**
     * Get satellite provision state.
     *
     * @param result Message that will be sent back to the requester
     */
    default void getSatelliteProvisionState(Message result) {}

    /**
     * Check whether satellite modem is supported by the device.
     *
+8 −0
Original line number Diff line number Diff line
@@ -5315,6 +5315,14 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mCi.isSatelliteSupported(result);
    }

    /**
     * Check whether the satellite modem is provisioned.
     * @param result The Message to send the result of the operation to.
     */
    public void isSatelliteProvisioned(Message result) {
        mCi.getSatelliteProvisionState(result);
    }

    /**
     * Get the satellite capabilities.
     * @param result The Message to send the result of the operation to.
+15 −0
Original line number Diff line number Diff line
@@ -5788,6 +5788,21 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    /**
     * Get satellite provision state.
     *
     * @param result Message that will be sent back to the requester
     */
    @Override
    public void getSatelliteProvisionState(Message result) {
        // Satellite HAL APIs are not supported before Android V.
        if (result != null) {
            AsyncResult.forMessage(result, null,
                    CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
            result.sendToTarget();
        }
    }

    /**
     * Provision the subscription with a satellite provider. This is needed to register the
     * subscription if the provider allows dynamic registration.
+13 −0
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ public class DatagramController {
        mSendErrorCode = errorCode;
        mPointingAppController.updateSendDatagramTransferState(subId, datagramTransferState,
                sendPendingCount, errorCode);
        notifyDatagramTransferStateChangedToSessionController();
    }

    /**
@@ -211,6 +212,7 @@ public class DatagramController {
        mReceiveErrorCode = errorCode;
        mPointingAppController.updateReceiveDatagramTransferState(subId, datagramTransferState,
                receivePendingCount, errorCode);
        notifyDatagramTransferStateChangedToSessionController();
    }

    /**
@@ -221,6 +223,17 @@ public class DatagramController {
        return mReceivePendingCount;
    }

    private void notifyDatagramTransferStateChangedToSessionController() {
        SatelliteSessionController sessionController = SatelliteSessionController.getInstance();
        if (sessionController == null) {
            loge("notifyDatagramTransferStateChangeToSessionController: SatelliteSessionController"
                    + " is not initialized yet");
        } else {
            sessionController.onDatagramTransferStateChanged(
                    mSendDatagramTransferState, mReceiveDatagramTransferState);
        }
    }

    private static void logd(@NonNull String log) {
        Rlog.d(TAG, log);
    }
+0 −4
Original line number Diff line number Diff line
@@ -471,8 +471,6 @@ public class DatagramReceiver extends Handler {
            satelliteDatagramListenerHandler = new SatelliteDatagramListenerHandler(
                    mBackgroundHandler.getLooper(), validSubId);
            if (SatelliteModemInterface.getInstance().isSatelliteServiceSupported()) {
                // TODO: remove this as SatelliteModemInterface can register for incoming datagrams
                // on boot up itself.
                SatelliteModemInterface.getInstance().registerForSatelliteDatagramsReceived(
                        satelliteDatagramListenerHandler,
                        SatelliteDatagramListenerHandler.EVENT_SATELLITE_DATAGRAM_RECEIVED, null);
@@ -597,6 +595,4 @@ public class DatagramReceiver extends Handler {
    private static void loge(@NonNull String log) {
        Rlog.e(TAG, log);
    }

    // TODO: An api change - do not pass the binder from Telephony to Applications
}
Loading