From 3c9118900fc64e0172efb736a35f62dcc168e3a4 Mon Sep 17 00:00:00 2001 From: Malcolm Chen Date: Tue, 20 Jun 2017 11:36:01 -0700 Subject: [PATCH] Adding "Mobile data" and "Data usage" button in mobile settings. Grant "READ_NETWORK_USAGE_HISTORY" permission to phone because "Datat usage" button summary needs it. Settings provides new intent to open mobile data usage page. Bug: 62201918 Test: Manual Change-Id: Ie317109c723f3946ace4d34c743081a7ae046462 Merged-In: Ie317109c723f3946ace4d34c743081a7ae046462 --- core/java/android/provider/Settings.java | 18 ++++++++++++++++++ data/etc/privapp-permissions-platform.xml | 1 + proto/src/metrics_constants.proto | 10 ++++++++++ 3 files changed, 29 insertions(+) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index cbeeabe26335c..c83af98936dd0 100755 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -193,6 +193,24 @@ public final class Settings { public static final String ACTION_AIRPLANE_MODE_SETTINGS = "android.settings.AIRPLANE_MODE_SETTINGS"; + /** + * Activity Action: Show mobile data usage list. + *

+ * Input: {@link EXTRA_NETWORK_TEMPLATE} and {@link EXTRA_SUB_ID} should be included to specify + * how and what mobile data statistics should be collected. + *

+ * Output: Nothing + * @hide + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_MOBILE_DATA_USAGE = + "android.settings.MOBILE_DATA_USAGE"; + + /** @hide */ + public static final String EXTRA_NETWORK_TEMPLATE = "network_template"; + /** @hide */ + public static final String EXTRA_SUB_ID = "sub_id"; + /** * Activity Action: Modify Airplane mode settings using a voice command. *

diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml index 92b6aa3faedba..a79376ca774c5 100644 --- a/data/etc/privapp-permissions-platform.xml +++ b/data/etc/privapp-permissions-platform.xml @@ -147,6 +147,7 @@ applications that come with the platform + diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto index a4849fcd1ca0e..0e2c46b9e623a 100644 --- a/proto/src/metrics_constants.proto +++ b/proto/src/metrics_constants.proto @@ -4221,6 +4221,16 @@ message MetricsEvent { // ---- End O-DR1 Constants, all O-DR1 constants go above this line ---- + // ACTION: Settings > Network & Internet > Mobile network > Mobile data + // CATEGORY: SETTINGS + // OS: O MR + ACTION_MOBILE_NETWORK_MOBILE_DATA_TOGGLE = 1081; + + // ACTION: Settings > Network & Internet > Mobile network > Data usage + // CATEGORY: SETTINGS + // OS: O MR + ACTION_MOBILE_NETWORK_DATA_USAGE = 1082; + // Add new aosp constants above this line. // END OF AOSP CONSTANTS }