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

Commit d218526b authored by Jake Hamby's avatar Jake Hamby Committed by Android Git Automerger
Browse files

am d457053a: am 07936528: Merge "Cosmetic cleanups to SMSDispatcher classes." into gingerbread

Merge commit 'd457053a'

* commit 'd457053a':
  Cosmetic cleanups to SMSDispatcher classes.
parents bb2c2c14 d457053a
Loading
Loading
Loading
Loading
+24 −35
Original line number Diff line number Diff line
@@ -44,10 +44,6 @@ import android.util.Config;
import android.util.Log;
import android.view.WindowManager;

import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.SmsMessageBase;
import com.android.internal.telephony.SmsResponse;
import com.android.internal.telephony.WapPushOverSms;
import com.android.internal.util.HexDump;

import java.io.ByteArrayOutputStream;
@@ -75,7 +71,7 @@ public abstract class SMSDispatcher extends Handler {
    private static final int DEFAULT_SMS_MAX_COUNT = 100;

    /** Default timeout for SMS sent query */
    private static final int DEFAULT_SMS_TIMOUEOUT = 6000;
    private static final int DEFAULT_SMS_TIMEOUT = 6000;

    protected static final String[] RAW_PROJECTION = new String[] {
        "pdu",
@@ -83,8 +79,6 @@ public abstract class SMSDispatcher extends Handler {
        "destination_port",
    };

    static final int MAIL_SEND_SMS = 1;

    static final protected int EVENT_NEW_SMS = 1;

    static final protected int EVENT_SEND_SMS_COMPLETE = 2;
@@ -154,10 +148,6 @@ public abstract class SMSDispatcher extends Handler {
     */
    private final int WAKE_LOCK_TIMEOUT = 5000;

    private static SmsMessage mSmsMessage;
    private static SmsMessageBase mSmsMessageBase;
    private SmsMessageBase.SubmitPduBase mSubmitPduBase;

    protected boolean mStorageAvailable = true;
    protected boolean mReportMemoryStatusPending = false;

@@ -838,7 +828,7 @@ public abstract class SMSDispatcher extends Handler {

        mSTrackers.add(tracker);
        sendMessageDelayed ( obtainMessage(EVENT_ALERT_TIMEOUT, d),
                DEFAULT_SMS_TIMOUEOUT);
                DEFAULT_SMS_TIMEOUT);
    }

    protected String getAppNameByIntent(PendingIntent intent) {
@@ -932,7 +922,7 @@ public abstract class SMSDispatcher extends Handler {
    }

    /**
     * Keeps track of an SMS that has been sent to the RIL, until it it has
     * Keeps track of an SMS that has been sent to the RIL, until it has
     * successfully been sent, or we're done trying.
     *
     */
@@ -994,6 +984,5 @@ public abstract class SMSDispatcher extends Handler {
                acknowledgeLastIncomingSms(success, rc, null);
            }
        }

    };
}
+7 −11
Original line number Diff line number Diff line
@@ -28,21 +28,20 @@ import android.database.SQLException;
import android.os.AsyncResult;
import android.os.Message;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.Telephony;
import android.provider.Telephony.Sms.Intents;
import android.preference.PreferenceManager;
import android.util.Config;
import android.util.Log;
import android.telephony.SmsManager;
import android.telephony.SmsMessage.MessageClass;
import android.util.Config;
import android.util.Log;

import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.SMSDispatcher;
import com.android.internal.telephony.SmsHeader;
import com.android.internal.telephony.SmsMessageBase;
import com.android.internal.telephony.SMSDispatcher;
import com.android.internal.telephony.SmsMessageBase.TextEncodingDetails;
import com.android.internal.telephony.cdma.SmsMessage;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.cdma.sms.SmsEnvelope;
import com.android.internal.telephony.cdma.sms.UserData;
import com.android.internal.util.HexDump;
@@ -56,14 +55,11 @@ import java.util.HashMap;
final class CdmaSMSDispatcher extends SMSDispatcher {
    private static final String TAG = "CDMA";

    private CDMAPhone mCdmaPhone;

    private byte[] mLastDispatchedSmsFingerprint;
    private byte[] mLastAcknowledgedSmsFingerprint;

    CdmaSMSDispatcher(CDMAPhone phone) {
        super(phone);
        mCdmaPhone = phone;
    }

    /**
@@ -130,7 +126,7 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
            Log.d(TAG, "Voicemail count=" + voicemailCount);
            // Store the voicemail count in preferences.
            SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(
                    ((CDMAPhone) mPhone).getContext());
                    mPhone.getContext());
            SharedPreferences.Editor editor = sp.edit();
            editor.putInt(CDMAPhone.VM_COUNT_CDMA, voicemailCount);
            editor.commit();
@@ -445,7 +441,7 @@ final class CdmaSMSDispatcher extends SMSDispatcher {
    protected void sendSms(SmsTracker tracker) {
        HashMap<String, Object> map = tracker.mData;

        byte smsc[] = (byte[]) map.get("smsc");
        // byte smsc[] = (byte[]) map.get("smsc");  // unused for CDMA
        byte pdu[] = (byte[]) map.get("pdu");

        Message reply = obtainMessage(EVENT_SEND_SMS_COMPLETE, tracker);
+6 −7
Original line number Diff line number Diff line
@@ -27,13 +27,12 @@ import android.telephony.ServiceState;
import android.util.Config;
import android.util.Log;

import com.android.internal.telephony.IccUtils;
import com.android.internal.telephony.SmsMessageBase.TextEncodingDetails;
import com.android.internal.telephony.gsm.SmsMessage;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.IccUtils;
import com.android.internal.telephony.SMSDispatcher;
import com.android.internal.telephony.SmsHeader;
import com.android.internal.telephony.SmsMessageBase;
import com.android.internal.telephony.SmsMessageBase.TextEncodingDetails;

import java.util.ArrayList;
import java.util.HashMap;
@@ -99,20 +98,20 @@ final class GsmSMSDispatcher extends SMSDispatcher {
        if (sms.isTypeZero()) {
            // As per 3GPP TS 23.040 9.2.3.9, Type Zero messages should not be
            // Displayed/Stored/Notified. They should only be acknowledged.
            Log.d(TAG, "Received short message type 0, Dont display or store it. Send Ack");
            Log.d(TAG, "Received short message type 0, Don't display or store it. Send Ack");
            return Intents.RESULT_SMS_HANDLED;
        }

        // Special case the message waiting indicator messages
        if (sms.isMWISetMessage()) {
            mGsmPhone.updateMessageWaitingIndicator(true);
            handled |= sms.isMwiDontStore();
            handled = sms.isMwiDontStore();
            if (Config.LOGD) {
                Log.d(TAG, "Received voice mail indicator set SMS shouldStore=" + !handled);
            }
        } else if (sms.isMWIClearMessage()) {
            mGsmPhone.updateMessageWaitingIndicator(false);
            handled |= sms.isMwiDontStore();
            handled = sms.isMwiDontStore();
            if (Config.LOGD) {
                Log.d(TAG, "Received voice mail indicator clear SMS shouldStore=" + !handled);
            }