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

Commit fd8271c7 authored by Sooraj Sasindran's avatar Sooraj Sasindran Committed by Android (Google) Code Review
Browse files

Merge "DO NOT MERGE Change ILongConsumer to Consumer<Long> for...

Merge "DO NOT MERGE Change ILongConsumer to Consumer<Long> for onSatelliteDatagramReceived api." into udc-dev
parents 4fbed237 850a1d54
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -132,8 +132,8 @@ public class DatagramController {
     *
     * This method requests modem to check if there are any pending datagrams to be received over
     * satellite. If there are any incoming datagrams, they will be received via
     * {@link android.telephony.satellite.SatelliteDatagramCallback
     * #onSatelliteDatagramReceived(long, SatelliteDatagram, int, ILongConsumer)}
     * {@link android.telephony.satellite.SatelliteDatagramCallback#onSatelliteDatagramReceived(
     * long, SatelliteDatagram, int, Consumer)}
     *
     * @param subId The subId of the subscription used for receiving datagrams.
     * @param callback The callback to get {@link SatelliteManager.SatelliteError} of the request.
+18 −30
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ import android.util.Pair;

import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.telephony.ILongConsumer;
import com.android.internal.telephony.IVoidConsumer;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.metrics.SatelliteStats;
import com.android.internal.telephony.satellite.metrics.ControllerMetricsStats;
@@ -282,35 +282,23 @@ public class DatagramReceiver extends Handler {

        private void onSatelliteDatagramReceived(@NonNull DatagramRetryArgument argument) {
            try {
                argument.listener.onSatelliteDatagramReceived(argument.datagramId,
                        argument.datagram, argument.pendingCount,
                        new ILongConsumer.Stub() {
                IVoidConsumer internalAck = new IVoidConsumer.Stub() {
                    /**
                     * This callback will be used by datagram receiver app
                     * to send ack back to Telephony. If the callback is not
                     * received within five minutes, then Telephony will
                     * resend the datagram again.
                             *
                             * @param datagramId An id that uniquely identifies
                             *                   datagram received by satellite
                             *                   datagram receiver app. This should
                             *                   match with datagramId passed in
                             *                   {@link android.telephony.satellite
                             *                   .SatelliteDatagramCallback
                             *                   #onSatelliteDatagramReceived(long,
                             *                   SatelliteDatagram, int,
                             *                   ISatelliteDatagramReceiverAck)}
                             *                   Upon receiving the ack, Telephony
                             *                   will remove the datagram from
                             *                   the persistent memory.
                     */
                    @Override
                            public void accept(long datagramId) {
                    public void accept() {
                        logd("acknowledgeSatelliteDatagramReceived: "
                                        + "datagramId=" + datagramId);
                                + "datagramId=" + argument.datagramId);
                        sendMessage(obtainMessage(EVENT_RECEIVED_ACK, argument));
                    }
                        });
                };

                argument.listener.onSatelliteDatagramReceived(argument.datagramId,
                        argument.datagram, argument.pendingCount, internalAck);
            } catch (RemoteException e) {
                logd("EVENT_SATELLITE_DATAGRAM_RECEIVED RemoteException: " + e);
            }
@@ -528,7 +516,7 @@ public class DatagramReceiver extends Handler {
     * This method requests modem to check if there are any pending datagrams to be received over
     * satellite. If there are any incoming datagrams, they will be received via
     * {@link android.telephony.satellite.SatelliteDatagramCallback
     * #onSatelliteDatagramReceived(long, SatelliteDatagram, int, ILongConsumer)}
     * #onSatelliteDatagramReceived(long, SatelliteDatagram, int, Consumer)}
     *
     * @param subId The subId of the subscription used for receiving datagrams.
     * @param callback The callback to get {@link SatelliteManager.SatelliteError} of the request.
+2 −2
Original line number Diff line number Diff line
@@ -1286,8 +1286,8 @@ public class SatelliteController extends Handler {
     *
     * This method requests modem to check if there are any pending datagrams to be received over
     * satellite. If there are any incoming datagrams, they will be received via
     * {@link android.telephony.satellite.SatelliteDatagramCallback
     * #onSatelliteDatagramReceived(long, SatelliteDatagram, int, ILongConsumer)}
     * {@link android.telephony.satellite.SatelliteDatagramCallback#onSatelliteDatagramReceived(
     * long, SatelliteDatagram, int, Consumer)}
     *
     * @param subId The subId of the subscription used for receiving datagrams.
     * @param callback The callback to get {@link SatelliteManager.SatelliteError} of the request.