diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 2acc4a05792ae..7154aeee08d48 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -1566,6 +1566,30 @@ public class Intent implements Parcelable, Cloneable { */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_DEVICE_STORAGE_OK = "android.intent.action.DEVICE_STORAGE_OK"; + /** + * Broadcast Action: A sticky broadcast that indicates a memory full + * condition on the device. This is intended for activities that want + * to be able to fill the data partition completely, leaving only + * enough free space to prevent system-wide SQLite failures. + * + *
This is a protected intent that can only be sent + * by the system. + * + * {@hide} + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_DEVICE_STORAGE_FULL = "android.intent.action.DEVICE_STORAGE_FULL"; + /** + * Broadcast Action: Indicates memory full condition on the device + * no longer exists. + * + *
This is a protected intent that can only be sent
+ * by the system.
+ *
+ * {@hide}
+ */
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_DEVICE_STORAGE_NOT_FULL = "android.intent.action.DEVICE_STORAGE_NOT_FULL";
/**
* Broadcast Action: Indicates low memory condition notification acknowledged by user
* and package management should be started.
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 78a384b653176..7c80420e1a83a 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2961,31 +2961,31 @@ public final class Settings {
public static final String WTF_IS_FATAL = "wtf_is_fatal";
/**
- * Maximum age of entries kept by {@link android.os.IDropBox}.
+ * Maximum age of entries kept by {@link com.android.internal.os.IDropBoxManagerService}.
* @hide
*/
public static final String DROPBOX_AGE_SECONDS =
"dropbox_age_seconds";
/**
- * Maximum number of entry files which {@link android.os.IDropBox} will keep around.
+ * Maximum number of entry files which {@link com.android.internal.os.IDropBoxManagerService} will keep around.
* @hide
*/
public static final String DROPBOX_MAX_FILES =
"dropbox_max_files";
/**
- * Maximum amount of disk space used by {@link android.os.IDropBox} no matter what.
+ * Maximum amount of disk space used by {@link com.android.internal.os.IDropBoxManagerService} no matter what.
* @hide
*/
public static final String DROPBOX_QUOTA_KB =
"dropbox_quota_kb";
/**
- * Percent of free disk (excluding reserve) which {@link android.os.IDropBox} will use.
+ * Percent of free disk (excluding reserve) which {@link com.android.internal.os.IDropBoxManagerService} will use.
* @hide
*/
public static final String DROPBOX_QUOTA_PERCENT =
"dropbox_quota_percent";
/**
- * Percent of total disk which {@link android.os.IDropBox} will never dip into.
+ * Percent of total disk which {@link com.android.internal.os.IDropBoxManagerService} will never dip into.
* @hide
*/
public static final String DROPBOX_RESERVE_PERCENT =
@@ -3044,6 +3044,15 @@ public final class Settings {
public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
"sys_storage_threshold_percentage";
+ /**
+ * Minimum bytes of free storage on the device before the data
+ * partition is considered full. By default, 1 MB is reserved
+ * to avoid system-wide SQLite disk full exceptions.
+ * @hide
+ */
+ public static final String SYS_STORAGE_FULL_THRESHOLD_BYTES =
+ "sys_storage_full_threshold_bytes";
+
/**
* The interval in milliseconds after which Wi-Fi is considered idle.
* When idle, it is possible for the device to be switched from Wi-Fi to
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 0323b7044b53a..a9e4971348dc4 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -50,6 +50,8 @@
PendingIntent is
- * broadcast when the message is sucessfully sent, or failed.
+ * broadcast when the message is successfully sent, or failed.
* The result code will be Activity.RESULT_OK for success,
* or one of these errors:
* RESULT_ERROR_GENERIC_FAILURE
@@ -67,7 +67,7 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
* the extra "errorCode" containing a radio technology specific value,
* generally only useful for troubleshooting.
* The per-application based SMS control checks sentIntent. If sentIntent
- * is NULL the caller will be checked against all unknown applicaitons,
+ * is NULL the caller will be checked against all unknown applications,
* which cause smaller number of SMS to be sent in checking period.
* @param deliveryIntent if not NULL this PendingIntent is
* broadcast when the message is delivered to the recipient. The
@@ -94,7 +94,7 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
* the current default SMSC
* @param text the body of the message to send
* @param sentIntent if not NULL this PendingIntent is
- * broadcast when the message is sucessfully sent, or failed.
+ * broadcast when the message is successfully sent, or failed.
* The result code will be Activity.RESULT_OK for success,
* or one of these errors:
* RESULT_ERROR_GENERIC_FAILURE
@@ -140,7 +140,7 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
* RESULT_ERROR_RADIO_OFF
* RESULT_ERROR_NULL_PDU.
* The per-application based SMS control checks sentIntent. If sentIntent
- * is NULL the caller will be checked against all unknown applicaitons,
+ * is NULL the caller will be checked against all unknown applications,
* which cause smaller number of SMS to be sent in checking period.
* @param deliveryIntents if not null, an ArrayList of
* PendingIntents (one for each message part) that is
diff --git a/telephony/java/com/android/internal/telephony/SMSDispatcher.java b/telephony/java/com/android/internal/telephony/SMSDispatcher.java
index 606b52d609605..917e1d823a8ab 100644
--- a/telephony/java/com/android/internal/telephony/SMSDispatcher.java
+++ b/telephony/java/com/android/internal/telephony/SMSDispatcher.java
@@ -32,9 +32,11 @@ import android.database.Cursor;
import android.database.SQLException;
import android.net.Uri;
import android.os.AsyncResult;
+import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
+import android.os.StatFs;
import android.provider.Telephony;
import android.provider.Telephony.Sms.Intents;
import android.provider.Settings;
@@ -240,11 +242,9 @@ public abstract class SMSDispatcher extends Handler {
// Register for device storage intents. Use these to notify the RIL
// that storage for SMS is or is not available.
- // TODO: Revisit this for a later release. Storage reporting should
- // rely more on application indication.
IntentFilter filter = new IntentFilter();
- filter.addAction(Intent.ACTION_DEVICE_STORAGE_LOW);
- filter.addAction(Intent.ACTION_DEVICE_STORAGE_OK);
+ filter.addAction(Intent.ACTION_DEVICE_STORAGE_FULL);
+ filter.addAction(Intent.ACTION_DEVICE_STORAGE_NOT_FULL);
mContext.registerReceiver(mResultReceiver, filter);
}
@@ -679,7 +679,7 @@ public abstract class SMSDispatcher extends Handler {
* the extra "errorCode" containing a radio technology specific value,
* generally only useful for troubleshooting.
* The per-application based SMS control checks sentIntent. If sentIntent
- * is NULL the caller will be checked against all unknown applicaitons,
+ * is NULL the caller will be checked against all unknown applications,
* which cause smaller number of SMS to be sent in checking period.
* @param deliveryIntent if not NULL this PendingIntent is
* broadcast when the message is delivered to the recipient. The
@@ -732,7 +732,7 @@ public abstract class SMSDispatcher extends Handler {
* RESULT_ERROR_RADIO_OFF
* RESULT_ERROR_NULL_PDU.
* The per-application based SMS control checks sentIntent. If sentIntent
- * is NULL the caller will be checked against all unknown applicaitons,
+ * is NULL the caller will be checked against all unknown applications,
* which cause smaller number of SMS to be sent in checking period.
* @param deliveryIntents if not null, an ArrayList of
* PendingIntents (one for each message part) that is
@@ -748,7 +748,7 @@ public abstract class SMSDispatcher extends Handler {
* Send a SMS
*
* @param smsc the SMSC to send the message through, or NULL for the
- * defatult SMSC
+ * default SMSC
* @param pdu the raw PDU to send
* @param sentIntent if not NULL this Intent is
* broadcast when the message is successfully sent, or failed.
@@ -758,7 +758,7 @@ public abstract class SMSDispatcher extends Handler {
* RESULT_ERROR_RADIO_OFF
* RESULT_ERROR_NULL_PDU.
* The per-application based SMS control checks sentIntent. If sentIntent
- * is NULL the caller will be checked against all unknown applicaitons,
+ * is NULL the caller will be checked against all unknown applications,
* which cause smaller number of SMS to be sent in checking period.
* @param deliveryIntent if not NULL this Intent is
* broadcast when the message is delivered to the recipient. The
@@ -965,10 +965,10 @@ public abstract class SMSDispatcher extends Handler {
private BroadcastReceiver mResultReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
- if (intent.getAction().equals(Intent.ACTION_DEVICE_STORAGE_LOW)) {
+ if (intent.getAction().equals(Intent.ACTION_DEVICE_STORAGE_FULL)) {
mStorageAvailable = false;
mCm.reportSmsMemoryStatus(false, obtainMessage(EVENT_REPORT_MEMORY_STATUS_DONE));
- } else if (intent.getAction().equals(Intent.ACTION_DEVICE_STORAGE_OK)) {
+ } else if (intent.getAction().equals(Intent.ACTION_DEVICE_STORAGE_NOT_FULL)) {
mStorageAvailable = true;
mCm.reportSmsMemoryStatus(true, obtainMessage(EVENT_REPORT_MEMORY_STATUS_DONE));
} else {
diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
index 4508e9a4d7417..f48c956356a10 100755
--- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
+++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java
@@ -100,7 +100,6 @@ public class CDMAPhone extends PhoneBase {
CdmaCallTracker mCT;
CdmaSMSDispatcher mSMS;
CdmaServiceStateTracker mSST;
- RuimFileHandler mRuimFileHandler;
RuimRecords mRuimRecords;
RuimCard mRuimCard;
ArrayList