aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java')
-rw-r--r--src/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java46
1 files changed, 11 insertions, 35 deletions
diff --git a/src/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java b/src/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
index 8a80b4570c..b3a8038833 100644
--- a/src/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
+++ b/src/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
@@ -20,16 +20,16 @@ import static com.android.internal.telephony.SmsResponse.NO_ERROR_CODE;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.AsyncResult;
+import android.os.Build;
import android.os.Message;
-import android.provider.Telephony.Sms.Intents;
import android.telephony.ServiceState;
-import android.util.Pair;
import com.android.internal.telephony.GsmAlphabet.TextEncodingDetails;
import com.android.internal.telephony.InboundSmsHandler;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.SMSDispatcher;
import com.android.internal.telephony.SmsConstants;
+import com.android.internal.telephony.SmsController;
import com.android.internal.telephony.SmsDispatchersController;
import com.android.internal.telephony.SmsHeader;
import com.android.internal.telephony.SmsMessageBase;
@@ -49,7 +49,7 @@ public final class GsmSMSDispatcher extends SMSDispatcher {
private AtomicReference<IccRecords> mIccRecords = new AtomicReference<IccRecords>();
private AtomicReference<UiccCardApplication> mUiccApplication =
new AtomicReference<UiccCardApplication>();
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private GsmInboundSmsHandler mGsmInboundSmsHandler;
/** Status report received */
@@ -72,7 +72,7 @@ public final class GsmSMSDispatcher extends SMSDispatcher {
mUiccController.unregisterForIccChanged(this);
}
- @UnsupportedAppUsage
+ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@Override
protected String getFormat() {
return SmsConstants.FORMAT_3GPP;
@@ -132,40 +132,16 @@ public final class GsmSMSDispatcher extends SMSDispatcher {
}
/**
- * Called when a status report is received. This should correspond to
- * a previously successful SEND.
+ * Called when a status report is received. This should correspond to a previously successful
+ * SEND.
*
- * @param ar AsyncResult passed into the message handler. ar.result should
- * be a String representing the status report PDU, as ASCII hex.
+ * @param ar AsyncResult passed into the message handler. ar.result should be a byte array for
+ * the status report PDU.
*/
private void handleStatusReport(AsyncResult ar) {
byte[] pdu = (byte[]) ar.result;
- SmsMessage sms = SmsMessage.newFromCDS(pdu);
- boolean handled = false;
-
- if (sms != null) {
- int messageRef = sms.mMessageRef;
- for (int i = 0, count = deliveryPendingList.size(); i < count; i++) {
- SmsTracker tracker = deliveryPendingList.get(i);
- if (tracker.mMessageRef == messageRef) {
- Pair<Boolean, Boolean> result = mSmsDispatchersController.handleSmsStatusReport(
- tracker,
- getFormat(),
- pdu);
- if (result.second) {
- deliveryPendingList.remove(i);
- }
- handled = true;
- break; // Only expect to see one tracker matching this messageref
- }
- }
- if (!handled) {
- // Try to find the sent SMS from the map in ImsSmsDispatcher.
- mSmsDispatchersController.handleSentOverImsStatusReport(
- messageRef, getFormat(), pdu);
- }
- }
- mCi.acknowledgeLastIncomingGsmSms(true, Intents.RESULT_SMS_HANDLED, null);
+ mSmsDispatchersController.handleSmsStatusReport(SmsConstants.FORMAT_3GPP, pdu);
+ mCi.acknowledgeLastIncomingGsmSms(true, 0 /* cause */, null);
}
/** {@inheritDoc} */
@@ -181,7 +157,7 @@ public final class GsmSMSDispatcher extends SMSDispatcher {
+ " mMessageRef=" + tracker.mMessageRef
+ " mUsesImsServiceForIms=" + tracker.mUsesImsServiceForIms
+ " SS=" + ss
- + " id=" + tracker.mMessageId);
+ + " " + SmsController.formatCrossStackMessageId(tracker.mMessageId));
// if sms over IMS is not supported on data and voice is not available...
if (!isIms() && ss != ServiceState.STATE_IN_SERVICE) {