Telephony support for SMS memory reporting to the network.

- Use ordered broadcast to allow receivers to set a result code.
- Ack SMS with result code.
- New RIL command to report memory status.
- Fixed a typo in a Gservices setting.
- Merge in CL 137895 (hold a wake lock while broadcasting SMS_RECEIVED).
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 559f224..5d10675 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2838,12 +2838,12 @@
          * out without asking for use permit, to limit the un-authorized SMS
          * usage.
          */
-        public static final String SMS_OUTGOING_CEHCK_INTERVAL_MS =
+        public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
                 "sms_outgoing_check_interval_ms";
 
         /**
          * The number of outgoing SMS sent without asking for user permit
-         * (of {@link #SMS_OUTGOING_CEHCK_INTERVAL_MS}
+         * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS}
          */
         public static final String SMS_OUTGOING_CEHCK_MAX_COUNT =
                 "sms_outgoing_check_max_count";
diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java
index a4145c4..4078fa6 100644
--- a/core/java/android/provider/Telephony.java
+++ b/core/java/android/provider/Telephony.java
@@ -466,6 +466,24 @@
          */
         public static final class Intents {
             /**
+             * Set by BroadcastReceiver. Indicates the message was handled
+             * successfully.
+             */
+            public static final int RESULT_SMS_HANDLED = 1;
+
+            /**
+             * Set by BroadcastReceiver. Indicates a generic error while
+             * processing the message.
+             */
+            public static final int RESULT_SMS_GENERIC_ERROR = 2;
+
+            /**
+             * Set by BroadcastReceiver. Indicates insufficient memory to store
+             * the message.
+             */
+            public static final int RESULT_SMS_OUT_OF_MEMORY = 3;
+
+            /**
              * Broadcast Action: A new text based SMS message has been received
              * by the device. The intent will have the following extra
              * values:</p>
@@ -476,7 +494,10 @@
              * </ul>
              *
              * <p>The extra values can be extracted using
-             * {@link #getMessagesFromIntent(Intent)}</p>
+             * {@link #getMessagesFromIntent(Intent)}.</p>
+             *
+             * <p>If a BroadcastReceiver encounters an error while processing
+             * this intent it should set the result code appropriately.</p>
              */
             @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
             public static final String SMS_RECEIVED_ACTION =
@@ -493,7 +514,10 @@
              * </ul>
              *
              * <p>The extra values can be extracted using
-             * {@link #getMessagesFromIntent(Intent)}</p>
+             * {@link #getMessagesFromIntent(Intent)}.</p>
+             *
+             * <p>If a BroadcastReceiver encounters an error while processing
+             * this intent it should set the result code appropriately.</p>
              */
             @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
             public static final String DATA_SMS_RECEIVED_ACTION =
@@ -510,6 +534,9 @@
              *   <li><em>pduType (Integer)</em> - The WAP PDU type</li>
              *   <li><em>data</em> - The data payload of the message</li>
              * </ul>
+             *
+             * <p>If a BroadcastReceiver encounters an error while processing
+             * this intent it should set the result code appropriately.</p>
              */
             @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
             public static final String WAP_PUSH_RECEIVED_ACTION =