From cfc669e34f9d56a8883f5ad6526cb4f062edc46d Mon Sep 17 00:00:00 2001 From: Jayachandran C Date: Thu, 18 Oct 2018 10:14:12 -0700 Subject: Add a new intent ACTION_MMSSMS_DATABASE_LOST This intent is to catch the mmssms.db getting mysteriously lost. The is a hide@ API and is protected with MODIFY_PHONE_STATE permission. Bug: 115990430 Test: Simulated mmsmsm.db corruption and verified that the intent is broadcasted and received by application with MODIFY_PHONE_STATE permission Merged-in: I3474df294c550b503b74bde25f10ae43ab5863a1 Change-Id: I3474df294c550b503b74bde25f10ae43ab5863a1 --- .../java/android/telephony/TelephonyManager.java | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 37cdb52f7a35..21a93febd7a1 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1177,6 +1177,38 @@ public class TelephonyManager { */ public static final String EXTRA_RECOVERY_ACTION = "recoveryAction"; + /** + * Broadcast intent action indicating that the telephony provider DB got lost. + * + *

+ * The {@link #EXTRA_IS_CORRUPTED} extra indicates whether the database is lost + * due to corruption or not + * + *

+ * Requires the MODIFY_PHONE_STATE permission. + * + *

+ * This is a protected intent that can only be sent by the system. + * + * @see #EXTRA_IS_CORRUPTED + * + * @hide + */ + @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) + public static final String ACTION_MMSSMS_DATABASE_LOST = + "android.intent.action.MMSSMS_DATABASE_LOST"; + + /** + * A boolean extra used with {@link #ACTION_MMSSMS_DATABASE_LOST} to indicate + * whether the database is lost due to corruption or not. + * + * @see #ACTION_MMSSMS_DATABASE_LOST + * + * @hide + */ + public static final String EXTRA_IS_CORRUPTED = "isCorrupted"; + // // // Device Info -- cgit v1.2.3-59-g8ed1b