diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-03-22 15:55:38 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2010-03-22 15:55:38 -0700 |
commit | 02034d3568fb3b984e8d185d70e18ba19e592ba3 (patch) | |
tree | f17e33269cfecca5687d1175fd3858a1c265ac51 /telephony/java/com | |
parent | 19eca316ca4a6c3c59f7eb469b33473e0ad0405a (diff) | |
parent | a2d776b2d36b38d94a30fc5692fd71ce9697fe9c (diff) | |
download | frameworks_base-02034d3568fb3b984e8d185d70e18ba19e592ba3.zip frameworks_base-02034d3568fb3b984e8d185d70e18ba19e592ba3.tar.gz frameworks_base-02034d3568fb3b984e8d185d70e18ba19e592ba3.tar.bz2 |
merge from open-source master
Change-Id: Ie60db5faf407344b8fbe3d5c1e7c01e927ff251e
Diffstat (limited to 'telephony/java/com')
-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 4a4282f..764d12e 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. |