From 8163b80a7ec63e8869742c8eac7291629d9c32f8 Mon Sep 17 00:00:00 2001 From: Shuo Qian Date: Mon, 14 Oct 2019 13:10:11 -0700 Subject: Emergency number database config updater Test: https://paste.googleplex.com/5345498821033984 Bug: 64131637 Change-Id: I0fbd48fe8ef5e008af714312859b513a22679fcb --- api/system-current.txt | 1 + core/java/android/os/ConfigUpdate.java | 15 +++++++++ core/res/AndroidManifest.xml | 8 +++++ .../updates/EmergencyNumberDbInstallReceiver.java | 39 ++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 services/core/java/com/android/server/updates/EmergencyNumberDbInstallReceiver.java diff --git a/api/system-current.txt b/api/system-current.txt index 117be3bb4c7a..69a240247828 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5210,6 +5210,7 @@ package android.os { field public static final String ACTION_UPDATE_CARRIER_PROVISIONING_URLS = "android.intent.action.UPDATE_CARRIER_PROVISIONING_URLS"; field public static final String ACTION_UPDATE_CONVERSATION_ACTIONS = "android.intent.action.UPDATE_CONVERSATION_ACTIONS"; field public static final String ACTION_UPDATE_CT_LOGS = "android.intent.action.UPDATE_CT_LOGS"; + field public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB = "android.os.action.UPDATE_EMERGENCY_NUMBER_DB"; field public static final String ACTION_UPDATE_INTENT_FIREWALL = "android.intent.action.UPDATE_INTENT_FIREWALL"; field public static final String ACTION_UPDATE_LANG_ID = "android.intent.action.UPDATE_LANG_ID"; field public static final String ACTION_UPDATE_NETWORK_WATCHLIST = "android.intent.action.UPDATE_NETWORK_WATCHLIST"; diff --git a/core/java/android/os/ConfigUpdate.java b/core/java/android/os/ConfigUpdate.java index 767c15caefd0..9c999b202797 100644 --- a/core/java/android/os/ConfigUpdate.java +++ b/core/java/android/os/ConfigUpdate.java @@ -113,6 +113,21 @@ public final class ConfigUpdate { public static final String ACTION_UPDATE_CARRIER_ID_DB = "android.os.action.UPDATE_CARRIER_ID_DB"; + /** + * Broadcast intent action indicating that the updated emergency number database is available. + *

Extra: "VERSION" the numeric version of the new data. Devices should only install if the + * update version is newer than the current one. + *

Extra: "REQUIRED_HASH" the hash of the current update data. + *

Input: {@link android.content.Intent#getData} is URI of downloaded emergency number file. + * Devices should pick up the downloaded file and persist to the database + * {@code com.android.internal.telephony.emergency.EmergencyNumberTracker}. + * + * @hide + */ + @SystemApi + public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB = + "android.os.action.UPDATE_EMERGENCY_NUMBER_DB"; + private ConfigUpdate() { } } diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index f98ea2cbaa17..bd30699266c8 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -4951,6 +4951,14 @@ + + + + + + +