diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-03-19 16:36:32 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2010-03-19 16:36:32 -0700 |
commit | 1da49e45a8b5c656a364f0fad42b92fd4dd18b59 (patch) | |
tree | b8f7cc4dbfbbb0b7a19b989023465d5c39ffff0d /telephony | |
parent | 7243c042c3eb6ef013c3b4eb0ba6d867dd449f55 (diff) | |
parent | 239750ff8ee5424d792cb21a99311d95589cc8e1 (diff) | |
download | frameworks_base-1da49e45a8b5c656a364f0fad42b92fd4dd18b59.zip frameworks_base-1da49e45a8b5c656a364f0fad42b92fd4dd18b59.tar.gz frameworks_base-1da49e45a8b5c656a364f0fad42b92fd4dd18b59.tar.bz2 |
merge from open-source master
Change-Id: I23af6296f0867bea2a2da72d4eb3dda93025b1ac
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/SMSDispatcher.java | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/SMSDispatcher.java b/telephony/java/com/android/internal/telephony/SMSDispatcher.java index 53c0bef..fc0aa06 100644 --- a/telephony/java/com/android/internal/telephony/SMSDispatcher.java +++ b/telephony/java/com/android/internal/telephony/SMSDispatcher.java @@ -109,6 +109,12 @@ public abstract class SMSDispatcher extends Handler { /** Stop the sending */ static final protected int EVENT_STOP_SENDING = 10; + /** Memory status reporting is acknowledged by RIL */ + static final protected int EVENT_REPORT_MEMORY_STATUS_DONE = 11; + + /** Radio is ON */ + static final protected int EVENT_RADIO_ON = 12; + protected Phone mPhone; protected Context mContext; protected ContentResolver mResolver; @@ -152,6 +158,7 @@ public abstract class SMSDispatcher extends Handler { private SmsMessageBase.SubmitPduBase mSubmitPduBase; protected boolean mStorageAvailable = true; + protected boolean mReportMemoryStatusPending = false; protected static int getNextConcatenatedRef() { sConcatenatedRef += 1; @@ -235,6 +242,7 @@ public abstract class SMSDispatcher extends Handler { mCm.setOnNewSMS(this, EVENT_NEW_SMS, null); mCm.setOnSmsStatus(this, EVENT_NEW_SMS_STATUS_REPORT, null); mCm.setOnIccSmsFull(this, EVENT_ICC_FULL, null); + mCm.registerForOn(this, EVENT_RADIO_ON, null); // Don't always start message ref at 0. sConcatenatedRef = new Random().nextInt(256); @@ -253,6 +261,7 @@ public abstract class SMSDispatcher extends Handler { mCm.unSetOnNewSMS(this); mCm.unSetOnSmsStatus(this); mCm.unSetOnIccSmsFull(this); + mCm.unregisterForOn(this); } protected void finalize() { @@ -370,6 +379,26 @@ public abstract class SMSDispatcher extends Handler { removeMessages(EVENT_ALERT_TIMEOUT, msg.obj); } break; + + case EVENT_REPORT_MEMORY_STATUS_DONE: + ar = (AsyncResult)msg.obj; + if (ar.exception != null) { + mReportMemoryStatusPending = true; + Log.v(TAG, "Memory status report to modem pending : mStorageAvailable = " + + mStorageAvailable); + } else { + mReportMemoryStatusPending = false; + } + break; + + case EVENT_RADIO_ON: + if (mReportMemoryStatusPending) { + Log.v(TAG, "Sending pending memory status report : mStorageAvailable = " + + mStorageAvailable); + mCm.reportSmsMemoryStatus(mStorageAvailable, + obtainMessage(EVENT_REPORT_MEMORY_STATUS_DONE)); + } + break; } } @@ -940,10 +969,10 @@ public abstract class SMSDispatcher extends Handler { public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_DEVICE_STORAGE_LOW)) { mStorageAvailable = false; - mCm.reportSmsMemoryStatus(false, null); + mCm.reportSmsMemoryStatus(false, obtainMessage(EVENT_REPORT_MEMORY_STATUS_DONE)); } else if (intent.getAction().equals(Intent.ACTION_DEVICE_STORAGE_OK)) { mStorageAvailable = true; - mCm.reportSmsMemoryStatus(true, null); + mCm.reportSmsMemoryStatus(true, obtainMessage(EVENT_REPORT_MEMORY_STATUS_DONE)); } else { // Assume the intent is one of the SMS receive intents that // was sent as an ordered broadcast. Check result and ACK. |