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

Commit 7bf95784 authored by Sarah Chin's avatar Sarah Chin Committed by Automerger Merge Worker
Browse files

Merge "Update satellite APIs from modem requirements" into udc-dev am: ffa5709a am: b6c7bb90

parents a61da8bd b6c7bb90
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -166,8 +166,8 @@ public class SatelliteManager {
    public static final String KEY_SATELLITE_NEXT_VISIBILITY = "satellite_next_visibility";

    /**
     * Bundle key to get the respoonse from
     * {@link #sendSatelliteDatagram(long, int, SatelliteDatagram, Executor, OutcomeReceiver)}.
     * Bundle key to get the respoonse from {@link
     * #sendSatelliteDatagram(long, int, SatelliteDatagram, boolean, Executor, OutcomeReceiver)}.
     * @hide
     */
    public static final String KEY_SEND_SATELLITE_DATAGRAM = "send_satellite_datagram";
@@ -700,6 +700,10 @@ public class SatelliteManager {
     * Satellite modem is powered off.
     */
    public static final int SATELLITE_MODEM_STATE_OFF = 4;
    /**
     * Satellite modem is unavailable.
     */
    public static final int SATELLITE_MODEM_STATE_UNAVAILABLE = 5;
    /**
     * Satellite modem state is unknown. This generic modem state should be used only when the
     * modem state cannot be mapped to other specific modem states.
@@ -713,6 +717,7 @@ public class SatelliteManager {
            SATELLITE_MODEM_STATE_DATAGRAM_TRANSFERRING,
            SATELLITE_MODEM_STATE_DATAGRAM_RETRYING,
            SATELLITE_MODEM_STATE_OFF,
            SATELLITE_MODEM_STATE_UNAVAILABLE,
            SATELLITE_MODEM_STATE_UNKNOWN
    })
    @Retention(RetentionPolicy.SOURCE)
+4 −3
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ oneway interface ISatellite {
     * Register the callback interface with satellite service.
     *
     * @param listener The callback interface to handle satellite service indications.
     * @param errorCallback The callback to receive the error code result of the operation.
     *
     * Valid error codes returned:
     *   SatelliteError:ERROR_NONE
@@ -43,7 +42,7 @@ oneway interface ISatellite {
     *   SatelliteError:REQUEST_NOT_SUPPORTED
     *   SatelliteError:NO_RESOURCES
     */
    void setSatelliteListener(in ISatelliteListener listener, in IIntegerConsumer errorCallback);
    void setSatelliteListener(in ISatelliteListener listener);

    /**
     * Request to enable or disable the satellite service listening mode.
@@ -51,6 +50,8 @@ oneway interface ISatellite {
     *
     * @param enable True to enable satellite listening mode and false to disable.
     * @param isDemoMode Whether demo mode is enabled.
     * @param timeout How long the satellite modem should wait for the next incoming page before
     *                disabling listening mode.
     * @param errorCallback The callback to receive the error code result of the operation.
     *
     * Valid error codes returned:
@@ -63,7 +64,7 @@ oneway interface ISatellite {
     *   SatelliteError:REQUEST_NOT_SUPPORTED
     *   SatelliteError:NO_RESOURCES
     */
    void requestSatelliteListeningEnabled(in boolean enable, in boolean isDemoMode,
    void requestSatelliteListeningEnabled(in boolean enable, in boolean isDemoMode, in int timeout,
            in IIntegerConsumer errorCallback);

    /**
+3 −3
Original line number Diff line number Diff line
@@ -36,10 +36,10 @@ oneway interface ISatelliteListener {
    /**
     * Indicates that new datagrams have been received on the device.
     *
     * @param datagrams Array of new datagrams received.
     * @param pendingCount The number of datagrams that are pending.
     * @param datagram New datagram that was received.
     * @param pendingCount Number of additional datagrams yet to be received.
     */
    void onSatelliteDatagramsReceived(in SatelliteDatagram[] datagrams, in int pendingCount);
    void onSatelliteDatagramReceived(in SatelliteDatagram datagram, in int pendingCount);

    /**
     * Indicates that the satellite has pending datagrams for the device to be pulled.
+9 −9
Original line number Diff line number Diff line
@@ -63,19 +63,19 @@ public class SatelliteImplBase extends SatelliteService {

    private final IBinder mBinder = new ISatellite.Stub() {
        @Override
        public void setSatelliteListener(ISatelliteListener listener,
                IIntegerConsumer errorCallback) throws RemoteException {
        public void setSatelliteListener(ISatelliteListener listener) throws RemoteException {
            executeMethodAsync(
                    () -> SatelliteImplBase.this.setSatelliteListener(listener, errorCallback),
                    () -> SatelliteImplBase.this.setSatelliteListener(listener),
                    "setSatelliteListener");
        }

        @Override
        public void requestSatelliteListeningEnabled(boolean enable, boolean isDemoMode,
                IIntegerConsumer errorCallback) throws RemoteException {
                int timeout, IIntegerConsumer errorCallback) throws RemoteException {
            executeMethodAsync(
                    () -> SatelliteImplBase.this
                            .requestSatelliteListeningEnabled(enable, isDemoMode, errorCallback),
                            .requestSatelliteListeningEnabled(
                                    enable, isDemoMode, timeout, errorCallback),
                    "requestSatelliteListeningEnabled");
        }

@@ -229,7 +229,6 @@ public class SatelliteImplBase extends SatelliteService {
     * Register the callback interface with satellite service.
     *
     * @param listener The callback interface to handle satellite service indications.
     * @param errorCallback The callback to receive the error code result of the operation.
     *
     * Valid error codes returned:
     *   SatelliteError:ERROR_NONE
@@ -241,8 +240,7 @@ public class SatelliteImplBase extends SatelliteService {
     *   SatelliteError:REQUEST_NOT_SUPPORTED
     *   SatelliteError:NO_RESOURCES
     */
    public void setSatelliteListener(@NonNull ISatelliteListener listener,
            @NonNull IIntegerConsumer errorCallback) {
    public void setSatelliteListener(@NonNull ISatelliteListener listener) {
        // stub implementation
    }

@@ -252,6 +250,8 @@ public class SatelliteImplBase extends SatelliteService {
     *
     * @param enable True to enable satellite listening mode and false to disable.
     * @param isDemoMode Whether demo mode is enabled.
     * @param timeout How long the satellite modem should wait for the next incoming page before
     *                disabling listening mode.
     * @param errorCallback The callback to receive the error code result of the operation.
     *
     * Valid error codes returned:
@@ -264,7 +264,7 @@ public class SatelliteImplBase extends SatelliteService {
     *   SatelliteError:REQUEST_NOT_SUPPORTED
     *   SatelliteError:NO_RESOURCES
     */
    public void requestSatelliteListeningEnabled(boolean enable, boolean isDemoMode,
    public void requestSatelliteListeningEnabled(boolean enable, boolean isDemoMode, int timeout,
            @NonNull IIntegerConsumer errorCallback) {
        // stub implementation
    }
+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ enum SatelliteModemState {
     * Satellite modem is powered off.
     */
    SATELLITE_MODEM_STATE_OFF = 4,
    /**
     * Satellite modem is unavailable.
     */
    SATELLITE_MODEM_STATE_UNAVAILABLE = 5,
    /**
     * Satellite modem state is unknown. This generic modem state should be used only when the
     * modem state cannot be mapped to other specific modem states.