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

Commit e66f7832 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati
Browse files

Support P2P SMS

When satellite is enabled in non-emergnecy mode and user sends P2P sms
then:
- SmsDispatchersController will forward the sms to DatagramDispatcher
- DatagramDispatcher will store the sms in a pending list until
  satellite is connected and modem is idle to send sms.
- Once modem is ready, DatagramDispatcher will send sms back to
  SmsDispatchersController to send the sms.
- DatagramDispatcher will also updateSendStatus as SENDING to
  PointingUI and SatelliteSessionController.
- After the sms is sent, SmsDispatchersController will update sent
  status to DatagramDispatcher. DatagramDispatcher will remove the sms
  from pending list and also update the sms sent status to
  PointingUI and SatelliteSessionController.
- If there are pending sms and pending datagrams, then
  DatagramDispatcher will prioritize sending datagrams over sms.
  Only sms or datagram is sent at a time in order to maintain mutual
  exclusivity.

Bug: 350514607
Test: atest DatagramDispatcherTest, atest SmsDispatchersTest, atest
SatelliteControllerTest
Manual Test: b/356400474
FLAG: com.android.internal.telephony.flags.carrier_roaming_nb_iot_ntn

Change-Id: Icf39522e24e4ff277cbbdd8a31c6ad37644235ba
parent 3f2d3a85
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -5497,4 +5497,13 @@ public class GsmCdmaPhone extends Phone {
            mSafetySource.refresh(mContext, refreshBroadcastId);
        }
    }

    /**
     * @return The sms dispatchers controller
     */
    @Override
    @Nullable
    public SmsDispatchersController getSmsDispatchersController() {
        return mIccSmsInterfaceManager.mDispatchersController;
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -96,7 +96,6 @@ public class IccSmsInterfaceManager {
    final protected Context mContext;
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
    final protected AppOpsManager mAppOps;
    @VisibleForTesting
    public SmsDispatchersController mDispatchersController;
    private SmsPermissions mSmsPermissions;

+2 −2
Original line number Diff line number Diff line
@@ -202,9 +202,9 @@ public class ImsSmsDispatcher extends SMSDispatcher {
                        tracker.onSent(mContext);
                        mTrackers.remove(token);
                        mPhone.notifySmsSent(tracker.mDestAddress);
                        mSmsDispatchersController.notifySmsSentToEmergencyStateTracker(
                        mSmsDispatchersController.notifySmsSent(
                                tracker.mDestAddress, tracker.mMessageId, true,
                                tracker.isSinglePartOrLastPart());
                                tracker.isSinglePartOrLastPart(), true /*success*/);
                        break;
                    case ImsSmsImplBase.SEND_STATUS_ERROR:
                        tracker.onFailed(mContext, reason, networkReasonCode);
+8 −0
Original line number Diff line number Diff line
@@ -4920,6 +4920,14 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        return mDataNetworkController;
    }

    /**
     * @return The sms dispatchers controller
     */
    @Nullable
    public SmsDispatchersController getSmsDispatchersController() {
        return null;
    }

    /**
     * @return The data settings manager
     */
+4 −4
Original line number Diff line number Diff line
@@ -1017,8 +1017,8 @@ public abstract class SMSDispatcher extends Handler {
     */
    protected void notifySmsSentFailedToEmergencyStateTracker(SmsTracker tracker,
            boolean isOverIms) {
        mSmsDispatchersController.notifySmsSentFailedToEmergencyStateTracker(
                tracker.mDestAddress, tracker.mMessageId, isOverIms);
        mSmsDispatchersController.notifySmsSent(tracker.mDestAddress, tracker.mMessageId,
                isOverIms, true /*isLastSmsPart*/, false /*success*/);
    }

    /**
@@ -1053,9 +1053,9 @@ public abstract class SMSDispatcher extends Handler {
            }
            tracker.onSent(mContext);
            mPhone.notifySmsSent(tracker.mDestAddress);
            mSmsDispatchersController.notifySmsSentToEmergencyStateTracker(
            mSmsDispatchersController.notifySmsSent(
                    tracker.mDestAddress, tracker.mMessageId, false,
                    tracker.isSinglePartOrLastPart());
                    tracker.isSinglePartOrLastPart(), true /*success*/);

            mPhone.getSmsStats().onOutgoingSms(
                    tracker.mImsRetry > 0 /* isOverIms */,
Loading