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

Commit e9a3a78f authored by Hakjun Choi's avatar Hakjun Choi Committed by Thomas Nguyen
Browse files

Add keepAlive message type in send request API for satellite service

Bug: 327032155
Test: atest DatagramControllerTest DatagramDispatcherTest PointingAppControllerTest
SatelliteManagerTestOnMockService
SMS/MMS/Call with live network

Change-Id: I7576171b92e4d1436605209334cbc54a3d4bc1b3
parent ddb4c887
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -26,11 +26,13 @@ oneway interface ISatelliteTransmissionUpdateCallback {
    /**
     * Called when satellite datagram send state changed.
     *
     * @param datagramType The datagram type of currently being sent.
     * @param state The new send datagram transfer state.
     * @param sendPendingCount The number of datagrams that are currently being sent.
     * @param errorCode If datagram transfer failed, the reason for failure.
     */
    void onSendDatagramStateChanged(in int state, in int sendPendingCount, in int errorCode);
    void onSendDatagramStateChanged(int datagramType, int state, int sendPendingCount,
            int errorCode);

    /**
     * Called when satellite datagram receive state changed.
@@ -39,7 +41,7 @@ oneway interface ISatelliteTransmissionUpdateCallback {
     * @param receivePendingCount The number of datagrams that are currently pending to be received.
     * @param errorCode If datagram transfer failed, the reason for failure.
     */
    void onReceiveDatagramStateChanged(in int state, in int receivePendingCount, in int errorCode);
    void onReceiveDatagramStateChanged(int state, int receivePendingCount, int errorCode);

    /**
     * Called when the satellite position changed.
+15 −3
Original line number Diff line number Diff line
@@ -992,12 +992,19 @@ public final class SatelliteManager {
     */
    @FlaggedApi(Flags.FLAG_OEM_ENABLED_SATELLITE_FLAG)
    public static final int DATAGRAM_TYPE_LOCATION_SHARING = 2;
    /**
     * This type of datagram is used to keep the device in satellite connected state or check if
     * there is any incoming message.
     * @hide
     */
    public static final int DATAGRAM_TYPE_KEEP_ALIVE = 3;

    /** @hide */
    @IntDef(prefix = "DATAGRAM_TYPE_", value = {
            DATAGRAM_TYPE_UNKNOWN,
            DATAGRAM_TYPE_SOS_MESSAGE,
            DATAGRAM_TYPE_LOCATION_SHARING
            DATAGRAM_TYPE_LOCATION_SHARING,
            DATAGRAM_TYPE_KEEP_ALIVE
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface DatagramType {}
@@ -1077,8 +1084,13 @@ public final class SatelliteManager {
                            }

                            @Override
                            public void onSendDatagramStateChanged(int state, int sendPendingCount,
                                    int errorCode) {
                            public void onSendDatagramStateChanged(int datagramType, int state,
                                    int sendPendingCount, int errorCode) {
                                executor.execute(() -> Binder.withCleanCallingIdentity(
                                        () -> callback.onSendDatagramStateChanged(datagramType,
                                                state, sendPendingCount, errorCode)));

                                // For backward compatibility
                                executor.execute(() -> Binder.withCleanCallingIdentity(
                                        () -> callback.onSendDatagramStateChanged(
                                                state, sendPendingCount, errorCode)));
+13 −0
Original line number Diff line number Diff line
@@ -51,6 +51,19 @@ public interface SatelliteTransmissionUpdateCallback {
            @SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount,
            @SatelliteManager.SatelliteResult int errorCode);

    /**
     * Called when satellite datagram send state changed.
     *
     * @param datagramType The datagram type of currently being sent.
     * @param state The new send datagram transfer state.
     * @param sendPendingCount The number of datagrams that are currently being sent.
     * @param errorCode If datagram transfer failed, the reason for failure.
     *
     * @hide
     */
    void onSendDatagramStateChanged(@SatelliteManager.DatagramType int datagramType,
            @SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount,
            @SatelliteManager.SatelliteResult int errorCode);
    /**
     * Called when satellite datagram receive state changed.
     *