From 6a7df3f4e8dbbaa6835fe82a44d1d3def7670d71 Mon Sep 17 00:00:00 2001 From: Rambo Wang Date: Mon, 15 Mar 2021 21:15:48 -0700 Subject: Expose ServiceState#getDataNetworkType in telephony provider Data network type is key information to make the switching decision. Exporting to telephony provider can let application get the information without location permission. Bug: 182601774 Test: atest com.android.phone.ServiceStateProviderTest Change-Id: I9753eee2619baf6b1627835624444c0e4f0cd410 --- core/api/current.txt | 1 + core/java/android/provider/Telephony.java | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'core') diff --git a/core/api/current.txt b/core/api/current.txt index 04d5f0f5137e..dbb5ce47e3a9 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -34219,6 +34219,7 @@ package android.provider { method public static android.net.Uri getUriForSubscriptionIdAndField(int, String); field public static final String AUTHORITY = "service-state"; field public static final android.net.Uri CONTENT_URI; + field public static final String DATA_NETWORK_TYPE = "data_network_type"; field public static final String IS_MANUAL_NETWORK_SELECTION = "is_manual_network_selection"; field public static final String VOICE_OPERATOR_NUMERIC = "voice_operator_numeric"; field public static final String VOICE_REG_STATE = "voice_reg_state"; diff --git a/core/java/android/provider/Telephony.java b/core/java/android/provider/Telephony.java index 753abea2cfe2..9b65a7ce0509 100644 --- a/core/java/android/provider/Telephony.java +++ b/core/java/android/provider/Telephony.java @@ -4572,6 +4572,13 @@ public final class Telephony { * This is the same as {@link ServiceState#getIsManualSelection()}. */ public static final String IS_MANUAL_NETWORK_SELECTION = "is_manual_network_selection"; + + /** + * The current data network type. + *

+ * This is the same as {@link TelephonyManager#getDataNetworkType()}. + */ + public static final String DATA_NETWORK_TYPE = "data_network_type"; } /** -- cgit v1.2.3