From e477e36fc0aa75544a56e31c78d4ed97d792d0d7 Mon Sep 17 00:00:00 2001 From: Jayachandran C Date: Mon, 16 Dec 2019 18:49:50 -0800 Subject: Expose ACTION_NETWORK_SET_TIME as system API This CL also uses android.telephony prefix Bug: 146388552 Test: Build Change-Id: I5afb7ef87ace11c7f97e2f6a75a409ecee537a18 --- api/system-current.txt | 1 + core/res/AndroidManifest.xml | 2 +- .../android/server/NetworkTimeUpdateServiceImpl.java | 6 +++--- .../timedetector/TimeDetectorStrategyImpl.java | 6 +++--- .../java/android/telephony/TelephonyManager.java | 20 ++++++++++++++++++++ .../android/internal/telephony/TelephonyIntents.java | 16 ---------------- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 38baa4eb1064..c99d4dfd383f 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8982,6 +8982,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public void updateTestOtaEmergencyNumberDbFilePath(@NonNull String); field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final String ACTION_ANOMALY_REPORTED = "android.telephony.action.ANOMALY_REPORTED"; field public static final String ACTION_EMERGENCY_ASSISTANCE = "android.telephony.action.EMERGENCY_ASSISTANCE"; + field public static final String ACTION_NETWORK_SET_TIME = "android.telephony.action.NETWORK_SET_TIME"; field public static final String ACTION_SIM_APPLICATION_STATE_CHANGED = "android.telephony.action.SIM_APPLICATION_STATE_CHANGED"; field public static final String ACTION_SIM_CARD_STATE_CHANGED = "android.telephony.action.SIM_CARD_STATE_CHANGED"; field public static final String ACTION_SIM_SLOT_STATUS_CHANGED = "android.telephony.action.SIM_SLOT_STATUS_CHANGED"; diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 8dc84c804055..3b6e1e54e435 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -635,7 +635,7 @@ - + + *
    + *
  • time - The time as a long in UTC milliseconds.
  • + *
+ * + *

+ * Requires the READ_PHONE_STATE permission. + * + *

This is a protected intent that can only be sent + * by the system. + * + * @hide + */ + @SystemApi + public static final String ACTION_NETWORK_SET_TIME = "android.telephony.action.NETWORK_SET_TIME"; + // // // Device Info diff --git a/telephony/java/com/android/internal/telephony/TelephonyIntents.java b/telephony/java/com/android/internal/telephony/TelephonyIntents.java index b2c3fc79025b..8e1a78c56e0a 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyIntents.java +++ b/telephony/java/com/android/internal/telephony/TelephonyIntents.java @@ -224,22 +224,6 @@ public class TelephonyIntents { public static final String EXTRA_REBROADCAST_ON_UNLOCK= "rebroadcastOnUnlock"; - /** - * Broadcast Action: The time was set by the carrier (typically by the NITZ string). - * This is a sticky broadcast. - * The intent will have the following extra values:

- *
    - *
  • time - The time as a long in UTC milliseconds.
  • - *
- * - *

- * Requires the READ_PHONE_STATE permission. - * - *

This is a protected intent that can only be sent - * by the system. - */ - public static final String ACTION_NETWORK_SET_TIME = "android.intent.action.NETWORK_SET_TIME"; - /** *

Broadcast Action: It indicates the Emergency callback mode blocks datacall/sms *

. -- cgit v1.2.3-59-g8ed1b