diff options
| author | 2019-10-21 13:38:20 -0700 | |
|---|---|---|
| committer | 2019-10-21 13:38:20 -0700 | |
| commit | a1c60871574e07f90fd39e03828833e998f61bd0 (patch) | |
| tree | bd2f023cdc6fc44b82669a477955cf22b4164acd | |
| parent | ac53ebf4ba31dc4a7549dd9dad720508713cb723 (diff) | |
| parent | 9208fc5a0ac3cea85424aaa8d2ee08782242c8bd (diff) | |
Merge "Emergency number database config updater" am: ca0f14ec1a
am: 9208fc5a0a
Change-Id: Id32674a1021f1902444b996b0ee5eb4be5fe30a1
| -rw-r--r-- | api/system-current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/os/ConfigUpdate.java | 15 | ||||
| -rw-r--r-- | core/res/AndroidManifest.xml | 8 | ||||
| -rw-r--r-- | services/core/java/com/android/server/updates/EmergencyNumberDbInstallReceiver.java | 39 |
4 files changed, 63 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 7012a2001772..b81dec044ab7 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5157,6 +5157,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. + * <p>Extra: "VERSION" the numeric version of the new data. Devices should only install if the + * update version is newer than the current one. + * <p>Extra: "REQUIRED_HASH" the hash of the current update data. + * <p>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 c933a8ab3b21..9aacbe65e480 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -4926,6 +4926,14 @@ </intent-filter> </receiver> + <receiver android:name="com.android.server.updates.EmergencyNumberDbInstallReceiver" + android:permission="android.permission.UPDATE_CONFIG"> + <intent-filter> + <action android:name="android.os.action.UPDATE_EMERGENCY_NUMBER_DB" /> + <data android:scheme="content" android:host="*" android:mimeType="*/*" /> + </intent-filter> + </receiver> + <receiver android:name="com.android.server.MasterClearReceiver" android:permission="android.permission.MASTER_CLEAR"> <intent-filter diff --git a/services/core/java/com/android/server/updates/EmergencyNumberDbInstallReceiver.java b/services/core/java/com/android/server/updates/EmergencyNumberDbInstallReceiver.java new file mode 100644 index 000000000000..852f70779f77 --- /dev/null +++ b/services/core/java/com/android/server/updates/EmergencyNumberDbInstallReceiver.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.server.updates; + +import android.content.Context; +import android.content.Intent; +import android.util.Slog; + +/** + * Emergency Number Database Install Receiver. + */ +public class EmergencyNumberDbInstallReceiver extends ConfigUpdateInstallReceiver { + + private static final String TAG = "EmergencyNumberDbInstallReceiver"; + + public EmergencyNumberDbInstallReceiver() { + super("/data/misc/emergencynumberdb", "emergency_number_db", "metadata/", "version"); + } + + @Override + protected void postInstall(Context context, Intent intent) { + Slog.i(TAG, "Emergency number database is updated in file partition"); + // TODO Send a notification to EmergencyNumberTracker for updating of emergency number db. + } +} |