Merge "Add feature provider for aware info."
diff --git a/res/drawable-nodpi/gesture_ambient_tap_screen b/res/drawable-nodpi/gesture_ambient_tap_screen
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/res/drawable-nodpi/gesture_ambient_tap_screen
diff --git a/res/drawable/ic_homepage_search.xml b/res/drawable/ic_homepage_search.xml
new file mode 100644
index 0000000..3895b6b
--- /dev/null
+++ b/res/drawable/ic_homepage_search.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24"
+ android:tint="?android:attr/colorAccent">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M20.49,19l-5.73,-5.73C15.53,12.2 16,10.91 16,9.5C16,5.91 13.09,3 9.5,3S3,5.91 3,9.5C3,13.09 5.91,16 9.5,16c1.41,0 2.7,-0.47 3.77,-1.24L19,20.49L20.49,19zM5,9.5C5,7.01 7.01,5 9.5,5S14,7.01 14,9.5S11.99,14 9.5,14S5,11.99 5,9.5z"/>
+</vector>
diff --git a/res/drawable/ic_lock.xml b/res/drawable/ic_lock.xml
index 975cbf5..d2ea5a2 100644
--- a/res/drawable/ic_lock.xml
+++ b/res/drawable/ic_lock.xml
@@ -14,11 +14,14 @@
limitations under the License
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="32dp"
- android:height="32dp"
- android:viewportHeight="24.0"
- android:viewportWidth="24.0">
+ android:width="32dp"
+ android:height="32dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
<path
android:fillColor="?android:attr/colorPrimary"
- android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z" />
+ android:pathData="M12,15m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"/>
+ <path
+ android:fillColor="?android:attr/colorPrimary"
+ android:pathData="M18,8h-1.5V5.5C16.5,3.01 14.49,1 12,1S7.5,3.01 7.5,5.5V8H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10C20,8.9 19.1,8 18,8zM9.5,5.5C9.5,4.12 10.62,3 12,3c1.38,0 2.5,1.12 2.5,2.5V8h-5V5.5zM18,20H6V10h1.5h9H18V20z"/>
</vector>
diff --git a/res/drawable/ic_settings_security.xml b/res/drawable/ic_settings_security.xml
index 6065dd9..d730ac9 100644
--- a/res/drawable/ic_settings_security.xml
+++ b/res/drawable/ic_settings_security.xml
@@ -21,8 +21,8 @@
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#FFFFFFFF"
- android:pathData="M18,8h-1V6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v0h2v0c0,-1.66 1.34,-3 3,-3s3,1.34 3,3v2H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10C20,8.9 19.1,8 18,8zM18,20H6V10h12V20z"/>
+ android:pathData="M12,15m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"/>
<path
android:fillColor="#FFFFFFFF"
- android:pathData="M12,15m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"/>
+ android:pathData="M18.5,1C16.01,1 14,3.01 14,5.5V8H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10c0,-1.1 -0.9,-2 -2,-2h-2V5.5C16,4.12 17.12,3 18.5,3C19.88,3 21,4.12 21,5.5V6h2V5.5C23,3.01 20.99,1 18.5,1zM18,10v10H6V10H18z"/>
</vector>
\ No newline at end of file
diff --git a/res/drawable/ic_settings_security_white.xml b/res/drawable/ic_settings_security_white.xml
index 1779402..4e2b1ee 100644
--- a/res/drawable/ic_settings_security_white.xml
+++ b/res/drawable/ic_settings_security_white.xml
@@ -20,9 +20,8 @@
android:viewportWidth="24">
<path
android:fillColor="#FFFFFFFF"
- android:pathData="M18,8h-1V6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v0h2v0c0,-1.66 1.34,-3 3,-3s3,1.34 3,3v2H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10C20,8.9 19.1,8 18,8zM18,20H6V10h12V20z"/>
+ android:pathData="M12,15m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"/>
<path
android:fillColor="#FFFFFFFF"
- android:pathData="M12,15m-2,0a2,2 0,1 1,4 0a2,2 0,1 1,-4 0"/>
-</vector>
-
+ android:pathData="M18.5,1C16.01,1 14,3.01 14,5.5V8H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10c0,-1.1 -0.9,-2 -2,-2h-2V5.5C16,4.12 17.12,3 18.5,3C19.88,3 21,4.12 21,5.5V6h2V5.5C23,3.01 20.99,1 18.5,1zM18,10v10H6V10H18z"/>
+</vector>
\ No newline at end of file
diff --git a/res/layout/search_bar.xml b/res/layout/search_bar.xml
index fe2f270..67e742c 100644
--- a/res/layout/search_bar.xml
+++ b/res/layout/search_bar.xml
@@ -29,7 +29,7 @@
android:layout_height="@dimen/search_bar_height"
android:background="?android:attr/selectableItemBackground"
android:contentInsetStartWithNavigation="@dimen/search_bar_content_inset"
- android:navigationIcon="@drawable/ic_search_24dp">
+ android:navigationIcon="@drawable/ic_homepage_search">
<TextView
android:id="@+id/search_action_bar_title"
style="@style/TextAppearance.SearchBar"
diff --git a/res/raw/gesture_ambient_tap_screen.mp4 b/res/raw/gesture_ambient_tap_screen.mp4
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/res/raw/gesture_ambient_tap_screen.mp4
diff --git a/res/values/config.xml b/res/values/config.xml
index 1a504dd..a6e5e1c 100755
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -172,9 +172,6 @@
<!-- ComponentName to launch a vendor-specific enrollment activity if available -->
<string name="config_face_enroll" translatable="false"></string>
- <!-- Max allowed value for screen timeout, in milliseconds -->
- <integer name="max_lock_after_timeout_ms">1800000</integer>
-
<!-- App intent -->
<string name="config_account_intent_uri" translatable="false"></string>
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 358a1f1..080f970 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -2724,6 +2724,8 @@
<string name="night_display_activation_on_custom">Turn on until <xliff:g name="time" example="6 AM">%1$s</xliff:g></string>
<!-- Display settings screen, deactivation button action for custom schedule [CHAR LIMIT=40] -->
<string name="night_display_activation_off_custom">Turn off until <xliff:g name="time" example="10 PM">%1$s</xliff:g></string>
+ <!-- Night display slice screen, subtitle of intensity setting when night light is off. [CHAR LIMIT=30] -->
+ <string name="night_display_not_currently_on">Night Light not currently on</string>
<!-- Sound & display settings screen, setting option name to change screen timeout -->
<string name="screen_timeout">Sleep</string>
@@ -5841,6 +5843,9 @@
Used in SetupWizard for XLarge screen [CHAR LIMIT=20] -->
<string name="wifi_setup_detail">Network details</string>
+ <!-- Do not translate. This is a stub which will be removed soon. -->
+ <string name="time_zone_auto_stub" translatable="false">Select Time Zone</string>
+
<!-- Content description of the enabled sync icon for accessibility. [CHAR LIMIT=NONE] -->
<string name="accessibility_sync_enabled">Sync enabled</string>
<!-- Content description of the disabled sync icon for accessibility. [CHAR LIMIT=NONE] -->
@@ -9730,6 +9735,16 @@
<!-- Summary text for ambient display [CHAR LIMIT=NONE]-->
<string name="ambient_display_wake_lock_screen_summary" product="default"></string>
+ <!-- Preference and settings suggestion title text for ambient display tap (phone) [CHAR LIMIT=60]-->
+ <string name="ambient_display_tap_screen_title" product="default">Tap to check phone</string>
+ <!-- Preference and settings suggestion title text for ambient display tap (tablet) [CHAR LIMIT=60]-->
+ <string name="ambient_display_tap_screen_title" product="tablet">Tap to check tablet</string>
+ <!-- Preference and settings suggestion title text for ambient display tap (device) [CHAR LIMIT=60]-->
+ <string name="ambient_display_tap_screen_title" product="device">Tap to check device</string>
+
+ <!-- Summary text for ambient display tap [CHAR LIMIT=NONE]-->
+ <string name="ambient_display_tap_screen_summary">To check time, notifications, and other info, tap your screen.</string>
+
<!-- Title text for swiping downwards on fingerprint sensor for notifications [CHAR LIMIT=80]-->
<string name="fingerprint_swipe_for_notifications_title">Swipe fingerprint for notifications</string>
<!-- Title text for fingerprint gesture preference screen [CHAR LIMIT=25] -->
@@ -10097,6 +10112,8 @@
<string name="gup_dashboard_title">Game Update Package Preferences</string>
<!-- Summary for Game Update Package dashboard [CHAR LIMIT=50] -->
<string name="gup_dashboard_summary">Modify Game Update Package settings</string>
+ <!-- Title for Game Update Package all apps preference [CHAR LIMIT=50] -->
+ <string name="gup_all_apps_switch_title">Enable for all apps</string>
<!-- Title for Game Update Package preference [CHAR LIMIT=50] -->
<string name="gup_app_preference_title">Select Graphics Driver</string>
<!-- The default value for Game Update Package preference [CHAR LIMIT=50] -->
@@ -10497,4 +10514,14 @@
<!-- Preference title text for silence gesture [CHAR LIMIT=60]-->
<string name="gesture_silence_title">Silence alerts gesture</string>
+
+ <!-- Text to display when no app used permission. [CHAR LIMIT=NONE] -->
+ <string name="permission_bar_chart_empty_text">0 apps used permissions</string>
+
+ <!-- Text for permission bar chart title in Privacy page. [CHAR LIMIT=NONE] -->
+ <string name="permission_bar_chart_title">Most-used permissions in last 24 hours</string>
+
+ <!-- Text for permission bar chart details in Privacy page. [CHAR LIMIT=NONE] -->
+ <string name="permission_bar_chart_details">See all usage</string>
+
</resources>
diff --git a/res/xml/date_time_prefs.xml b/res/xml/date_time_prefs.xml
index e8af64c..edda1ba 100644
--- a/res/xml/date_time_prefs.xml
+++ b/res/xml/date_time_prefs.xml
@@ -58,7 +58,7 @@
<com.android.settingslib.RestrictedPreference
android:fragment="com.android.settings.datetime.timezone.TimeZoneSettings"
android:key="timezone"
- android:title="@string/date_time_set_timezone_title"
+ android:title="@string/date_time_set_timezone"
android:summary="@string/summary_placeholder"
settings:userRestriction="no_config_date_time" />
</PreferenceCategory>
diff --git a/res/xml/gestures.xml b/res/xml/gestures.xml
index fe0f94c..cd834df 100644
--- a/res/xml/gestures.xml
+++ b/res/xml/gestures.xml
@@ -76,6 +76,12 @@
settings:controller="com.android.settings.gestures.SwipeUpPreferenceController" />
<Preference
+ android:key="gesture_tap_screen_input_summary"
+ android:title="@string/ambient_display_tap_screen_title"
+ android:fragment="com.android.settings.gestures.TapScreenGestureSettings"
+ settings:controller="com.android.settings.gestures.TapScreenGesturePreferenceController" />
+
+ <Preference
android:key="gesture_double_tap_screen_input_summary"
android:title="@string/ambient_display_title"
android:fragment="com.android.settings.gestures.DoubleTapScreenSettings"
diff --git a/res/xml/gup_settings.xml b/res/xml/gup_settings.xml
index 43ba39b..09bca71 100644
--- a/res/xml/gup_settings.xml
+++ b/res/xml/gup_settings.xml
@@ -21,6 +21,12 @@
android:key="gup_settings"
android:title="@string/gup_dashboard_title">
+ <SwitchPreference
+ android:key="gup_all_apps_preference"
+ android:title="@string/gup_all_apps_switch_title"
+ settings:controller="com.android.settings.development.gup.GupEnableForAllAppsPreferenceController">
+ </SwitchPreference>
+
<PreferenceCategory
android:key="gup_category"
android:title="@string/gup_app_preference_title"
diff --git a/res/xml/location_settings.xml b/res/xml/location_settings.xml
index f1c13cf..72ea312 100644
--- a/res/xml/location_settings.xml
+++ b/res/xml/location_settings.xml
@@ -23,6 +23,7 @@
<com.android.settingslib.widget.LayoutPreference
android:key="apps_dashboard"
android:layout="@layout/app_entities_header"
+ android:selectable="false"
settings:allowDividerBelow="true" />
<PreferenceCategory
diff --git a/res/xml/mobile_network_settings_v2.xml b/res/xml/mobile_network_settings_v2.xml
new file mode 100644
index 0000000..7a19c32
--- /dev/null
+++ b/res/xml/mobile_network_settings_v2.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res-auto"
+ android:key="mobile_network_pref_screen"
+ settings:initialExpandedChildrenCount="5">
+
+ <com.android.settings.datausage.DataUsageSummaryPreference
+ android:key="status_header"
+ android:visibility="gone"
+ android:selectable="false" />
+
+ <Preference
+ android:key="cdma_lte_data_service_key"
+ android:title="@string/cdma_lte_data_service"
+ settings:controller="com.android.settings.network.telephony.DataServiceSetupPreferenceController">
+ </Preference>
+
+ <SwitchPreference
+ android:key="mobile_data_enable"
+ android:title="@string/mobile_data_settings_title"
+ android:summary="@string/mobile_data_settings_summary"
+ settings:controller="com.android.settings.network.telephony.MobileDataPreferenceController"/>
+
+ <com.android.settingslib.RestrictedSwitchPreference
+ android:key="button_roaming_key"
+ android:title="@string/roaming"
+ android:persistent="false"
+ android:summaryOn="@string/roaming_enable"
+ android:summaryOff="@string/roaming_disable"
+ settings:userRestriction="no_data_roaming"
+ settings:controller="com.android.settings.network.telephony.RoamingPreferenceController"/>
+
+ <Preference
+ android:key="data_usage_summary"
+ android:title="@string/mobile_data_usage_title"
+ settings:controller="com.android.settings.network.telephony.DataUsagePreferenceController"/>
+
+ <SwitchPreference
+ android:key="enhanced_4g_lte"
+ android:title="@string/enhanced_4g_lte_mode_title"
+ android:persistent="false"
+ android:summary="@string/enhanced_4g_lte_mode_summary"
+ settings:controller="com.android.settings.network.telephony.Enhanced4gLtePreferenceController"/>
+
+ <ListPreference
+ android:key="preferred_network_mode_key"
+ android:title="@string/preferred_network_mode_title"
+ android:summary="@string/preferred_network_mode_summary"
+ android:entries="@array/preferred_network_mode_choices"
+ android:entryValues="@array/preferred_network_mode_values"
+ android:dialogTitle="@string/preferred_network_mode_dialogtitle"
+ settings:controller="com.android.settings.network.telephony.PreferredNetworkModePreferenceController"/>
+
+ <ListPreference
+ android:key="enabled_networks_key"
+ android:title="@string/preferred_network_mode_title"
+ android:summary="@string/preferred_network_mode_summary"
+ android:entries="@array/enabled_networks_choices"
+ android:entryValues="@array/enabled_networks_values"
+ android:dialogTitle="@string/preferred_network_mode_dialogtitle"
+ settings:controller="com.android.settings.network.telephony.EnabledNetworkModePreferenceController"/>
+
+ <Preference
+ android:key="carrier_settings_euicc_key"
+ android:title="@string/carrier_settings_euicc"
+ settings:controller="com.android.settings.network.telephony.EuiccPreferenceController" />
+
+ <PreferenceCategory
+ android:key="calling_category"
+ android:title="@string/call_category">
+
+ <PreferenceScreen
+ android:key="wifi_calling_key"
+ android:title="@string/wifi_calling_settings_title"
+ settings:controller="com.android.settings.network.telephony.WifiCallingPreferenceController" >
+ <intent android:action="android.intent.action.MAIN"
+ android:targetPackage="com.android.settings"
+ android:targetClass="com.android.settings.Settings$WifiCallingSettingsActivity">
+ <extra android:name="show_drawer_menu" android:value="true" />
+ </intent>
+ </PreferenceScreen>
+
+ <SwitchPreference
+ android:key="video_calling_key"
+ android:title="@string/video_calling_settings_title"
+ android:persistent="true"
+ settings:controller="com.android.settings.network.telephony.VideoCallingPreferenceController" />
+
+ </PreferenceCategory>
+
+ <com.android.settings.network.telephony.cdma.CdmaListPreference
+ android:key="cdma_system_select_key"
+ android:title="@string/cdma_system_select_title"
+ android:summary="@string/cdma_system_select_summary"
+ android:entries="@array/cdma_system_select_choices"
+ android:entryValues="@array/cdma_system_select_values"
+ android:dialogTitle="@string/cdma_system_select_dialogtitle"
+ settings:controller="com.android.settings.network.telephony.cdma.CdmaSystemSelectPreferenceController"/>
+
+ <com.android.settings.network.telephony.cdma.CdmaListPreference
+ android:key="cdma_subscription_key"
+ android:title="@string/cdma_subscription_title"
+ android:summary="@string/cdma_subscription_summary"
+ android:entries="@array/cdma_subscription_choices"
+ android:entryValues="@array/cdma_subscription_values"
+ android:dialogTitle="@string/cdma_subscription_dialogtitle"
+ settings:controller="com.android.settings.network.telephony.cdma.CdmaSubscriptionPreferenceController"/>
+
+ <PreferenceCategory
+ android:key="network_operators_category_key"
+ android:title="@string/network_operator_category"
+ settings:controller="com.android.settings.widget.PreferenceCategoryController">
+
+ <SwitchPreference
+ android:key="auto_select_key"
+ android:title="@string/select_automatically"
+ settings:controller="com.android.settings.network.telephony.gsm.AutoSelectPreferenceController"/>
+
+ <Preference
+ android:key="choose_network_key"
+ android:title="@string/choose_network_title"
+ android:fragment="com.android.phone.NetworkSelectSetting"
+ settings:controller="com.android.settings.network.telephony.gsm.OpenNetworkSelectPagePreferenceController"/>
+ </PreferenceCategory>
+
+ <!--We want separate APN setting from reset of settings because we want user to change it with caution-->
+ <com.android.settingslib.RestrictedPreference
+ android:key="telephony_apn_key"
+ android:persistent="false"
+ android:title="@string/mobile_network_apn_title"
+ settings:allowDividerAbove="true"
+ settings:controller="com.android.settings.network.telephony.ApnPreferenceController"/>
+
+ <Preference
+ android:key="carrier_settings_key"
+ android:title="@string/carrier_settings_title"
+ settings:controller="com.android.settings.network.telephony.CarrierPreferenceController">
+ </Preference>
+
+</PreferenceScreen>
diff --git a/res/xml/network_and_internet_v2.xml b/res/xml/network_and_internet_v2.xml
index bde7889..83499d7 100644
--- a/res/xml/network_and_internet_v2.xml
+++ b/res/xml/network_and_internet_v2.xml
@@ -78,12 +78,19 @@
settings:userRestriction="no_config_tethering"
settings:useAdminDisabledSummary="true" />
+ <com.android.settings.datausage.DataSaverPreference
+ android:key="restrict_background"
+ android:title="@string/data_saver_title"
+ android:icon="@drawable/ic_settings_data_usage"
+ android:order="10"
+ android:fragment="com.android.settings.datausage.DataSaverSummary"/>
+
<com.android.settingslib.RestrictedPreference
android:fragment="com.android.settings.vpn2.VpnSettings"
android:key="vpn_settings"
android:title="@string/vpn_settings_title"
android:icon="@drawable/ic_vpn_key"
- android:order="10"
+ android:order="15"
android:summary="@string/summary_placeholder"
settings:userRestriction="no_config_vpn"
settings:useAdminDisabledSummary="true" />
@@ -91,7 +98,7 @@
<com.android.settings.network.PrivateDnsModeDialogPreference
android:key="private_dns_settings"
android:title="@string/select_private_dns_configuration_title"
- android:order="15"
+ android:order="20"
android:dialogTitle="@string/select_private_dns_configuration_dialog_title"
android:dialogLayout="@layout/private_dns_mode_dialog"
android:positiveButtonText="@string/save"
diff --git a/res/xml/night_display_settings.xml b/res/xml/night_display_settings.xml
index b6f6251..07687ea 100644
--- a/res/xml/night_display_settings.xml
+++ b/res/xml/night_display_settings.xml
@@ -41,7 +41,8 @@
android:key="night_display_temperature"
android:title="@string/night_display_temperature_title"
settings:keywords="@string/keywords_display_night_display"
- settings:controller="com.android.settings.display.NightDisplayIntensityPreferenceController" />
+ settings:controller="com.android.settings.display.NightDisplayIntensityPreferenceController"
+ settings:unavailableSliceSubtitle="@string/night_display_not_currently_on" />
<com.android.settingslib.widget.LayoutPreference
android:key="night_display_activated"
diff --git a/res/xml/privacy_dashboard_settings.xml b/res/xml/privacy_dashboard_settings.xml
index a580f5f..44ac10a 100644
--- a/res/xml/privacy_dashboard_settings.xml
+++ b/res/xml/privacy_dashboard_settings.xml
@@ -22,10 +22,16 @@
android:title="@string/privacy_dashboard_title"
settings:initialExpandedChildrenCount="3">
+ <com.android.settingslib.widget.BarChartPreference
+ android:key="permission_bar_chart"
+ android:title="@string/privacy_dashboard_title"
+ settings:controller="com.android.settings.privacy.PermissionBarChartPreferenceController"/>
+
<!-- App permissions -->
<Preference
android:key="privacy_manage_perms"
android:title="@string/app_permissions"
+ settings:allowDividerAbove="true"
settings:keywords="@string/keywords_app_permissions"
settings:controller="com.android.settings.applications.AppPermissionsPreferenceController">
<intent android:action="android.intent.action.MANAGE_PERMISSIONS"/>
diff --git a/res/xml/security_lockscreen_settings.xml b/res/xml/security_lockscreen_settings.xml
index f829c8a..c5765d3 100644
--- a/res/xml/security_lockscreen_settings.xml
+++ b/res/xml/security_lockscreen_settings.xml
@@ -60,6 +60,12 @@
settings:controller="com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController" />
<Preference
+ android:key="ambient_display_tap"
+ android:title="@string/ambient_display_tap_screen_title"
+ android:fragment="com.android.settings.gestures.TapScreenGestureSettings"
+ settings:controller="com.android.settings.gestures.TapScreenGesturePreferenceController" />
+
+ <Preference
android:key="ambient_display_double_tap"
android:title="@string/ambient_display_title"
android:fragment="com.android.settings.gestures.DoubleTapScreenSettings"
diff --git a/res/xml/tap_screen_gesture_settings.xml b/res/xml/tap_screen_gesture_settings.xml
new file mode 100644
index 0000000..9c0610a
--- /dev/null
+++ b/res/xml/tap_screen_gesture_settings.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ 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
+ -->
+
+<PreferenceScreen
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:key="gesture_tap_screen"
+ android:title="@string/ambient_display_tap_screen_title">
+
+ <com.android.settings.widget.VideoPreference
+ android:key="gesture_tap_screen_video"
+ app:animation="@raw/gesture_ambient_tap_screen"
+ app:preview="@drawable/gesture_ambient_tap_screen" />
+
+ <SwitchPreference
+ android:key="gesture_tap"
+ android:title="@string/ambient_display_tap_screen_title"
+ android:summary="@string/ambient_display_tap_screen_summary"
+ app:keywords="@string/keywords_gesture"
+ app:controller="com.android.settings.gestures.TapScreenGesturePreferenceController"
+ app:allowDividerAbove="true" />
+
+</PreferenceScreen>
\ No newline at end of file
diff --git a/src/com/android/settings/AirplaneModeEnabler.java b/src/com/android/settings/AirplaneModeEnabler.java
index f144096..dde7ce0 100644
--- a/src/com/android/settings/AirplaneModeEnabler.java
+++ b/src/com/android/settings/AirplaneModeEnabler.java
@@ -16,6 +16,7 @@
package com.android.settings;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
@@ -26,7 +27,6 @@
import android.os.UserHandle;
import android.provider.Settings;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.PhoneStateIntentReceiver;
import com.android.internal.telephony.TelephonyProperties;
import com.android.settingslib.WirelessUtils;
@@ -129,7 +129,7 @@
SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE))) {
// In ECM mode, do not update database at this point
} else {
- mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_AIRPLANE_TOGGLE,
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_AIRPLANE_TOGGLE,
isAirplaneModeOn);
setAirplaneModeOn(isAirplaneModeOn);
}
diff --git a/src/com/android/settings/BandMode.java b/src/com/android/settings/BandMode.java
index bae8860..6987d92 100644
--- a/src/com/android/settings/BandMode.java
+++ b/src/com/android/settings/BandMode.java
@@ -9,7 +9,6 @@
import android.util.Log;
import android.view.View;
import android.view.Window;
-import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
diff --git a/src/com/android/settings/BugreportPreference.java b/src/com/android/settings/BugreportPreference.java
index 1da985c..1652ad2 100644
--- a/src/com/android/settings/BugreportPreference.java
+++ b/src/com/android/settings/BugreportPreference.java
@@ -17,6 +17,7 @@
package com.android.settings;
import android.app.ActivityManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.os.RemoteException;
@@ -28,7 +29,6 @@
import androidx.appcompat.app.AlertDialog.Builder;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.CustomDialogPreferenceCompat;
@@ -85,12 +85,12 @@
if (mFullTitle.isChecked()) {
Log.v(TAG, "Taking full bugreport right away");
FeatureFactory.getFactory(context).getMetricsFeatureProvider().action(context,
- MetricsEvent.ACTION_BUGREPORT_FROM_SETTINGS_FULL);
+ SettingsEnums.ACTION_BUGREPORT_FROM_SETTINGS_FULL);
takeBugreport(ActivityManager.BUGREPORT_OPTION_FULL);
} else {
Log.v(TAG, "Taking interactive bugreport right away");
FeatureFactory.getFactory(context).getMetricsFeatureProvider().action(context,
- MetricsEvent.ACTION_BUGREPORT_FROM_SETTINGS_INTERACTIVE);
+ SettingsEnums.ACTION_BUGREPORT_FROM_SETTINGS_INTERACTIVE);
takeBugreport(ActivityManager.BUGREPORT_OPTION_INTERACTIVE);
}
}
diff --git a/src/com/android/settings/CryptKeeperConfirm.java b/src/com/android/settings/CryptKeeperConfirm.java
index 2271200..2484948 100644
--- a/src/com/android/settings/CryptKeeperConfirm.java
+++ b/src/com/android/settings/CryptKeeperConfirm.java
@@ -19,6 +19,7 @@
import android.annotation.Nullable;
import android.app.Activity;
import android.app.StatusBarManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@@ -34,7 +35,6 @@
import android.view.ViewGroup;
import android.widget.Button;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.core.InstrumentedFragment;
@@ -46,7 +46,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CRYPT_KEEPER_CONFIRM;
+ return SettingsEnums.CRYPT_KEEPER_CONFIRM;
}
public static class Blank extends Activity {
diff --git a/src/com/android/settings/CustomListPreference.java b/src/com/android/settings/CustomListPreference.java
index 734cac2..978858b 100644
--- a/src/com/android/settings/CustomListPreference.java
+++ b/src/com/android/settings/CustomListPreference.java
@@ -17,6 +17,7 @@
package com.android.settings;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@@ -30,7 +31,6 @@
import androidx.preference.ListPreference;
import androidx.preference.ListPreferenceDialogFragmentCompat;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
public class CustomListPreference extends ListPreference {
@@ -221,7 +221,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_CUSTOM_LIST_CONFIRMATION;
+ return SettingsEnums.DIALOG_CUSTOM_LIST_CONFIRMATION;
}
}
}
diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java
index 05dd265..40b2005 100644
--- a/src/com/android/settings/DateTimeSettings.java
+++ b/src/com/android/settings/DateTimeSettings.java
@@ -18,11 +18,11 @@
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.SummaryLoader;
import com.android.settings.datetime.AutoTimeFormatPreferenceController;
@@ -54,7 +54,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DATE_TIME;
+ return SettingsEnums.DATE_TIME;
}
@Override
@@ -127,9 +127,9 @@
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case DatePreferenceController.DIALOG_DATEPICKER:
- return MetricsEvent.DIALOG_DATE_PICKER;
+ return SettingsEnums.DIALOG_DATE_PICKER;
case TimePreferenceController.DIALOG_TIMEPICKER:
- return MetricsEvent.DIALOG_TIME_PICKER;
+ return SettingsEnums.DIALOG_TIME_PICKER;
default:
return 0;
}
diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java
index fdd7f2e..b67e6e8 100644
--- a/src/com/android/settings/DisplaySettings.java
+++ b/src/com/android/settings/DisplaySettings.java
@@ -16,10 +16,10 @@
package com.android.settings;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.display.BrightnessLevelPreferenceController;
import com.android.settings.display.CameraGesturePreferenceController;
@@ -49,7 +49,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DISPLAY;
+ return SettingsEnums.DISPLAY;
}
@Override
diff --git a/src/com/android/settings/EncryptionInterstitial.java b/src/com/android/settings/EncryptionInterstitial.java
index 6060892..e80b6d3 100644
--- a/src/com/android/settings/EncryptionInterstitial.java
+++ b/src/com/android/settings/EncryptionInterstitial.java
@@ -20,6 +20,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -35,7 +36,6 @@
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.password.ChooseLockSettingsHelper;
@@ -96,7 +96,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ENCRYPTION;
+ return SettingsEnums.ENCRYPTION;
}
@Override
@@ -281,7 +281,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_ENCRYPTION_INTERSTITIAL_ACCESSIBILITY;
+ return SettingsEnums.DIALOG_ENCRYPTION_INTERSTITIAL_ACCESSIBILITY;
}
@Override
diff --git a/src/com/android/settings/IccLockSettings.java b/src/com/android/settings/IccLockSettings.java
index 1de7a10..1133d0f 100644
--- a/src/com/android/settings/IccLockSettings.java
+++ b/src/com/android/settings/IccLockSettings.java
@@ -16,6 +16,7 @@
package com.android.settings;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -50,7 +51,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.CommandException;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
@@ -279,7 +279,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ICC_LOCK;
+ return SettingsEnums.ICC_LOCK;
}
@Override
diff --git a/src/com/android/settings/LegalSettings.java b/src/com/android/settings/LegalSettings.java
index 3538cc9..e6f0c2c 100644
--- a/src/com/android/settings/LegalSettings.java
+++ b/src/com/android/settings/LegalSettings.java
@@ -16,10 +16,10 @@
package com.android.settings;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -35,7 +35,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ABOUT_LEGAL_SETTINGS;
+ return SettingsEnums.ABOUT_LEGAL_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/ManualDisplayActivity.java b/src/com/android/settings/ManualDisplayActivity.java
index 8effc7b..a669c67 100644
--- a/src/com/android/settings/ManualDisplayActivity.java
+++ b/src/com/android/settings/ManualDisplayActivity.java
@@ -22,7 +22,6 @@
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
-import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
diff --git a/src/com/android/settings/MasterClear.java b/src/com/android/settings/MasterClear.java
index c03d499..f9e4317 100644
--- a/src/com/android/settings/MasterClear.java
+++ b/src/com/android/settings/MasterClear.java
@@ -23,6 +23,7 @@
import android.accounts.AuthenticatorDescription;
import android.app.ActionBar;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -57,7 +58,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
@@ -565,6 +565,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.MASTER_CLEAR;
+ return SettingsEnums.MASTER_CLEAR;
}
}
diff --git a/src/com/android/settings/MasterClearConfirm.java b/src/com/android/settings/MasterClearConfirm.java
index cbd4924..de7cd06 100644
--- a/src/com/android/settings/MasterClearConfirm.java
+++ b/src/com/android/settings/MasterClearConfirm.java
@@ -22,6 +22,7 @@
import android.app.ActionBar;
import android.app.Activity;
import android.app.ProgressDialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
@@ -39,7 +40,6 @@
import android.widget.Button;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
import com.android.settingslib.RestrictedLockUtilsInternal;
@@ -225,6 +225,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.MASTER_CLEAR_CONFIRM;
+ return SettingsEnums.MASTER_CLEAR_CONFIRM;
}
}
diff --git a/src/com/android/settings/ProxySelector.java b/src/com/android/settings/ProxySelector.java
index 4bd4585..625369e 100644
--- a/src/com/android/settings/ProxySelector.java
+++ b/src/com/android/settings/ProxySelector.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
@@ -40,7 +41,6 @@
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
import com.android.settings.core.InstrumentedFragment;
@@ -106,7 +106,7 @@
@Override
public int getDialogMetricsCategory(int dialogId) {
- return MetricsEvent.DIALOG_PROXY_SELECTOR_ERROR;
+ return SettingsEnums.DIALOG_PROXY_SELECTOR_ERROR;
}
private void showDialog(int dialogId) {
@@ -277,6 +277,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.PROXY_SELECTOR;
+ return SettingsEnums.PROXY_SELECTOR;
}
}
diff --git a/src/com/android/settings/ResetNetwork.java b/src/com/android/settings/ResetNetwork.java
index c1eca16..bd45f9b 100644
--- a/src/com/android/settings/ResetNetwork.java
+++ b/src/com/android/settings/ResetNetwork.java
@@ -18,6 +18,7 @@
import android.annotation.Nullable;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -41,14 +42,12 @@
import android.widget.Spinner;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.PhoneConstants;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
import com.android.settings.password.ChooseLockSettingsHelper;
import com.android.settings.password.ConfirmLockPattern;
-import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
import com.android.settingslib.RestrictedLockUtilsInternal;
@@ -161,7 +160,8 @@
mEsimContainer = mContentView.findViewById(R.id.erase_esim_container);
mEsimCheckbox = mContentView.findViewById(R.id.erase_esim);
- mSubscriptions = SubscriptionManager.from(getActivity()).getActiveSubscriptionInfoList();
+ mSubscriptions = SubscriptionManager.from(getActivity())
+ .getActiveSubscriptionInfoList(true);
if (mSubscriptions != null && mSubscriptions.size() > 0) {
// Get the default subscription in the order of data, voice, sms, first up.
int defaultSubscription = SubscriptionManager.getDefaultDataSubscriptionId();
@@ -262,6 +262,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.RESET_NETWORK;
+ return SettingsEnums.RESET_NETWORK;
}
}
diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java
index 270f22b..7c21b55 100644
--- a/src/com/android/settings/ResetNetworkConfirm.java
+++ b/src/com/android/settings/ResetNetworkConfirm.java
@@ -18,6 +18,7 @@
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.content.ContentResolver;
@@ -45,12 +46,10 @@
import androidx.appcompat.app.AlertDialog;
import com.android.ims.ImsManager;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.PhoneConstants;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
import com.android.settings.network.ApnSettings;
-import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.RestrictedLockUtilsInternal;
/**
@@ -262,6 +261,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.RESET_NETWORK_CONFIRM;
+ return SettingsEnums.RESET_NETWORK_CONFIRM;
}
}
diff --git a/src/com/android/settings/RestrictedSettingsFragment.java b/src/com/android/settings/RestrictedSettingsFragment.java
index 13bc9c51..6b538b8 100644
--- a/src/com/android/settings/RestrictedSettingsFragment.java
+++ b/src/com/android/settings/RestrictedSettingsFragment.java
@@ -36,7 +36,6 @@
import com.android.settings.dashboard.RestrictedDashboardFragment;
import com.android.settings.enterprise.ActionDisabledByAdminDialogHelper;
-import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.RestrictedLockUtilsInternal;
/**
diff --git a/src/com/android/settings/SettingsLicenseActivity.java b/src/com/android/settings/SettingsLicenseActivity.java
index 6f62057..6def6fa 100644
--- a/src/com/android/settings/SettingsLicenseActivity.java
+++ b/src/com/android/settings/SettingsLicenseActivity.java
@@ -21,7 +21,6 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
-import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
diff --git a/src/com/android/settings/SetupWizardUtils.java b/src/com/android/settings/SetupWizardUtils.java
index 1b911c7..70ee2ca 100644
--- a/src/com/android/settings/SetupWizardUtils.java
+++ b/src/com/android/settings/SetupWizardUtils.java
@@ -19,8 +19,6 @@
import android.content.Intent;
import android.sysprop.SetupWizardProperties;
-import androidx.annotation.VisibleForTesting;
-
import com.google.android.setupcompat.util.WizardManagerHelper;
import com.google.android.setupdesign.util.ThemeHelper;
diff --git a/src/com/android/settings/TestingSettings.java b/src/com/android/settings/TestingSettings.java
index ff58f11..c1df705 100644
--- a/src/com/android/settings/TestingSettings.java
+++ b/src/com/android/settings/TestingSettings.java
@@ -16,13 +16,12 @@
package com.android.settings;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.os.UserManager;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-
public class TestingSettings extends SettingsPreferenceFragment {
@Override
@@ -41,6 +40,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TESTING;
+ return SettingsEnums.TESTING;
}
}
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java
index d32e387..20b6e2f 100644
--- a/src/com/android/settings/TetherSettings.java
+++ b/src/com/android/settings/TetherSettings.java
@@ -20,6 +20,7 @@
import static android.net.ConnectivityManager.TETHERING_USB;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothPan;
import android.bluetooth.BluetoothProfile;
@@ -40,7 +41,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.datausage.DataSaverBackend;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -101,7 +101,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TETHER;
+ return SettingsEnums.TETHER;
}
public TetherSettings() {
diff --git a/src/com/android/settings/TrustedCredentialsSettings.java b/src/com/android/settings/TrustedCredentialsSettings.java
index ff217f6..ae25ba9 100644
--- a/src/com/android/settings/TrustedCredentialsSettings.java
+++ b/src/com/android/settings/TrustedCredentialsSettings.java
@@ -24,6 +24,7 @@
import android.app.Activity;
import android.app.KeyguardManager;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
@@ -63,7 +64,6 @@
import com.android.internal.annotations.GuardedBy;
import com.android.internal.app.UnlaunchableAppActivity;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.core.InstrumentedFragment;
@@ -93,7 +93,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TRUSTED_CREDENTIALS;
+ return SettingsEnums.TRUSTED_CREDENTIALS;
}
private enum Tab {
diff --git a/src/com/android/settings/UserCredentialsSettings.java b/src/com/android/settings/UserCredentialsSettings.java
index b1f9fe7..c30e51d 100644
--- a/src/com/android/settings/UserCredentialsSettings.java
+++ b/src/com/android/settings/UserCredentialsSettings.java
@@ -19,6 +19,7 @@
import android.annotation.LayoutRes;
import android.annotation.Nullable;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.os.AsyncTask;
@@ -48,7 +49,6 @@
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settingslib.RestrictedLockUtils;
@@ -68,7 +68,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.USER_CREDENTIALS;
+ return SettingsEnums.USER_CREDENTIALS;
}
@Override
@@ -165,7 +165,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_USER_CREDENTIAL;
+ return SettingsEnums.DIALOG_USER_CREDENTIAL;
}
/**
diff --git a/src/com/android/settings/accessibility/AccessibilityContentTimeoutPreferenceFragment.java b/src/com/android/settings/accessibility/AccessibilityContentTimeoutPreferenceFragment.java
index 4fc6159..8a41bd4 100644
--- a/src/com/android/settings/accessibility/AccessibilityContentTimeoutPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/AccessibilityContentTimeoutPreferenceFragment.java
@@ -16,17 +16,16 @@
package com.android.settings.accessibility;
-import android.provider.SearchIndexableResource;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.res.Resources;
+import android.provider.SearchIndexableResource;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
-import com.android.settings.search.Indexable;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.search.SearchIndexable;
@@ -71,7 +70,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY;
+ return SettingsEnums.ACCESSIBILITY;
}
@Override
diff --git a/src/com/android/settings/accessibility/AccessibilityControlTimeoutPreferenceFragment.java b/src/com/android/settings/accessibility/AccessibilityControlTimeoutPreferenceFragment.java
index 56424af..a6426bf 100644
--- a/src/com/android/settings/accessibility/AccessibilityControlTimeoutPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/AccessibilityControlTimeoutPreferenceFragment.java
@@ -16,17 +16,16 @@
package com.android.settings.accessibility;
-import android.provider.SearchIndexableResource;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.res.Resources;
+import android.provider.SearchIndexableResource;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
-import com.android.settings.search.Indexable;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.search.SearchIndexable;
@@ -71,7 +70,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY;
+ return SettingsEnums.ACCESSIBILITY;
}
@Override
diff --git a/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceController.java
index b9713d7..a94bc6d 100644
--- a/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceController.java
+++ b/src/com/android/settings/accessibility/AccessibilityHearingAidPreferenceController.java
@@ -16,6 +16,7 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHearingAid;
@@ -33,7 +34,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.bluetooth.BluetoothDeviceDetailsFragment;
import com.android.settings.core.BasePreferenceController;
@@ -204,7 +204,7 @@
.setDestination(BluetoothDeviceDetailsFragment.class.getName())
.setArguments(args)
.setTitleRes(R.string.device_details_title)
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.ACCESSIBILITY)
+ .setSourceMetricsCategory(SettingsEnums.ACCESSIBILITY)
.launch();
}
diff --git a/src/com/android/settings/accessibility/AccessibilityServiceWarning.java b/src/com/android/settings/accessibility/AccessibilityServiceWarning.java
index e0f1747..dec734c 100644
--- a/src/com/android/settings/accessibility/AccessibilityServiceWarning.java
+++ b/src/com/android/settings/accessibility/AccessibilityServiceWarning.java
@@ -30,8 +30,6 @@
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
@@ -39,7 +37,6 @@
import com.android.settings.R;
-import java.util.List;
import java.util.Locale;
/**
diff --git a/src/com/android/settings/accessibility/AccessibilitySettings.java b/src/com/android/settings/accessibility/AccessibilitySettings.java
index 6f6149f..5852757 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettings.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettings.java
@@ -20,6 +20,7 @@
import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -27,6 +28,7 @@
import android.content.pm.ServiceInfo;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
+import android.hardware.display.ColorDisplayManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
@@ -50,7 +52,6 @@
import com.android.internal.accessibility.AccessibilityShortcutController;
import com.android.internal.content.PackageMonitor;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.view.RotationPolicy;
import com.android.internal.view.RotationPolicy.RotationPolicyListener;
import com.android.settings.R;
@@ -272,7 +273,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY;
+ return SettingsEnums.ACCESSIBILITY;
}
@Override
@@ -662,7 +663,7 @@
protected void updateSystemPreferences() {
// Move color inversion and color correction preferences to Display category if device
// supports HWC hardware-accelerated color transform.
- if (isColorTransformAccelerated(getContext())) {
+ if (ColorDisplayManager.isColorTransformAccelerated(getContext())) {
PreferenceCategory experimentalCategory =
mCategoryToPrefCategoryMap.get(CATEGORY_EXPERIMENTAL);
PreferenceCategory displayCategory =
diff --git a/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizard.java b/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizard.java
index 9ee155f..46a6371 100644
--- a/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizard.java
+++ b/src/com/android/settings/accessibility/AccessibilitySettingsForSetupWizard.java
@@ -17,6 +17,7 @@
package com.android.settings.accessibility;
import android.accessibilityservice.AccessibilityServiceInfo;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ServiceInfo;
@@ -26,7 +27,6 @@
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -60,7 +60,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SUW_ACCESSIBILITY;
+ return SettingsEnums.SUW_ACCESSIBILITY;
}
@Override
diff --git a/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java b/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
index 3cd260f..de65324 100644
--- a/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
@@ -17,6 +17,7 @@
import android.accessibilityservice.AccessibilityServiceInfo;
import android.annotation.Nullable;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -32,7 +33,6 @@
import androidx.preference.SwitchPreference;
import com.android.internal.accessibility.AccessibilityShortcutController;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -60,7 +60,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_TOGGLE_GLOBAL_GESTURE;
+ return SettingsEnums.ACCESSIBILITY_TOGGLE_GLOBAL_GESTURE;
}
@Override
diff --git a/src/com/android/settings/accessibility/AccessibilityTimeoutController.java b/src/com/android/settings/accessibility/AccessibilityTimeoutController.java
index d933d92..a6c5f6f 100644
--- a/src/com/android/settings/accessibility/AccessibilityTimeoutController.java
+++ b/src/com/android/settings/accessibility/AccessibilityTimeoutController.java
@@ -33,8 +33,6 @@
import com.google.common.primitives.Ints;
-import java.lang.Integer;
-
import java.util.HashMap;
import java.util.Map;
diff --git a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
index 33cb95e..ae7e3fd 100644
--- a/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
+++ b/src/com/android/settings/accessibility/CaptionPropertiesFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
@@ -36,7 +37,6 @@
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.SubtitleView;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
@@ -99,7 +99,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_CAPTION_PROPERTIES;
+ return SettingsEnums.ACCESSIBILITY_CAPTION_PROPERTIES;
}
@Override
diff --git a/src/com/android/settings/accessibility/HearingAidDialogFragment.java b/src/com/android/settings/accessibility/HearingAidDialogFragment.java
index 0380ed3..aa80564 100644
--- a/src/com/android/settings/accessibility/HearingAidDialogFragment.java
+++ b/src/com/android/settings/accessibility/HearingAidDialogFragment.java
@@ -18,10 +18,10 @@
import android.app.AlertDialog;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.bluetooth.BluetoothPairingDetail;
import com.android.settings.core.SubSettingLauncher;
@@ -53,13 +53,13 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_ACCESSIBILITY_HEARINGAID;
+ return SettingsEnums.DIALOG_ACCESSIBILITY_HEARINGAID;
}
private void launchBluetoothAddDeviceSetting() {
new SubSettingLauncher(getActivity())
.setDestination(BluetoothPairingDetail.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.ACCESSIBILITY)
+ .setSourceMetricsCategory(SettingsEnums.ACCESSIBILITY)
.launch();
}
}
diff --git a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
index 31b23fa..c3cb34f 100644
--- a/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/MagnificationPreferenceFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.accessibility;
import android.accessibilityservice.AccessibilityServiceInfo;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -30,7 +31,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -62,7 +62,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_SCREEN_MAGNIFICATION_SETTINGS;
+ return SettingsEnums.ACCESSIBILITY_SCREEN_MAGNIFICATION_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/accessibility/NotificationVibrationPreferenceFragment.java b/src/com/android/settings/accessibility/NotificationVibrationPreferenceFragment.java
index ba7d51d..3ca197f 100644
--- a/src/com/android/settings/accessibility/NotificationVibrationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/NotificationVibrationPreferenceFragment.java
@@ -15,11 +15,11 @@
*/
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.media.AudioAttributes;
import android.os.Vibrator;
import android.provider.Settings;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
/**
@@ -28,7 +28,7 @@
public class NotificationVibrationPreferenceFragment extends VibrationPreferenceFragment {
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_VIBRATION_NOTIFICATION;
+ return SettingsEnums.ACCESSIBILITY_VIBRATION_NOTIFICATION;
}
@Override
diff --git a/src/com/android/settings/accessibility/RingVibrationPreferenceFragment.java b/src/com/android/settings/accessibility/RingVibrationPreferenceFragment.java
index df05231..3403b3b 100644
--- a/src/com/android/settings/accessibility/RingVibrationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/RingVibrationPreferenceFragment.java
@@ -15,11 +15,11 @@
*/
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.media.AudioAttributes;
import android.os.Vibrator;
import android.provider.Settings;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
/**
@@ -28,7 +28,7 @@
public class RingVibrationPreferenceFragment extends VibrationPreferenceFragment {
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_VIBRATION_RING;
+ return SettingsEnums.ACCESSIBILITY_VIBRATION_RING;
}
@Override
diff --git a/src/com/android/settings/accessibility/ShortcutServicePickerFragment.java b/src/com/android/settings/accessibility/ShortcutServicePickerFragment.java
index 213bfbd..2da4f7a 100644
--- a/src/com/android/settings/accessibility/ShortcutServicePickerFragment.java
+++ b/src/com/android/settings/accessibility/ShortcutServicePickerFragment.java
@@ -17,13 +17,12 @@
import static android.content.DialogInterface.BUTTON_POSITIVE;
-import static com.android.internal.accessibility.AccessibilityShortcutController
- .COLOR_INVERSION_COMPONENT_NAME;
-import static com.android.internal.accessibility.AccessibilityShortcutController
- .DALTONIZER_COMPONENT_NAME;
+import static com.android.internal.accessibility.AccessibilityShortcutController.COLOR_INVERSION_COMPONENT_NAME;
+import static com.android.internal.accessibility.AccessibilityShortcutController.DALTONIZER_COMPONENT_NAME;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
@@ -43,9 +42,7 @@
import androidx.fragment.app.FragmentActivity;
import com.android.internal.accessibility.AccessibilityShortcutController;
-import com.android.internal.accessibility.AccessibilityShortcutController
- .ToggleableFrameworkFeatureInfo;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.accessibility.AccessibilityShortcutController.ToggleableFrameworkFeatureInfo;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.widget.RadioButtonPickerFragment;
@@ -64,7 +61,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_TOGGLE_GLOBAL_GESTURE;
+ return SettingsEnums.ACCESSIBILITY_TOGGLE_GLOBAL_GESTURE;
}
@Override
@@ -169,7 +166,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_TOGGLE_GLOBAL_GESTURE;
+ return SettingsEnums.ACCESSIBILITY_TOGGLE_GLOBAL_GESTURE;
}
@Override
diff --git a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
index c0df6a3..d935d92 100644
--- a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
@@ -20,6 +20,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent;
@@ -37,7 +38,6 @@
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.password.ConfirmDeviceCredentialActivity;
@@ -71,7 +71,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_SERVICE;
+ return SettingsEnums.ACCESSIBILITY_SERVICE;
}
@Override
@@ -163,9 +163,9 @@
@Override
public int getDialogMetricsCategory(int dialogId) {
if (dialogId == DIALOG_ID_ENABLE_WARNING) {
- return MetricsEvent.DIALOG_ACCESSIBILITY_SERVICE_ENABLE;
+ return SettingsEnums.DIALOG_ACCESSIBILITY_SERVICE_ENABLE;
} else {
- return MetricsEvent.DIALOG_ACCESSIBILITY_SERVICE_DISABLE;
+ return SettingsEnums.DIALOG_ACCESSIBILITY_SERVICE_DISABLE;
}
}
diff --git a/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
index a9c7781..8e12339 100644
--- a/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAutoclickPreferenceFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
@@ -26,7 +27,6 @@
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -109,7 +109,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_TOGGLE_AUTOCLICK;
+ return SettingsEnums.ACCESSIBILITY_TOGGLE_AUTOCLICK;
}
@Override
diff --git a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
index 184c615..8924899 100644
--- a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
@@ -16,7 +16,9 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.content.Context;
+import android.hardware.display.ColorDisplayManager;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
@@ -26,7 +28,6 @@
import androidx.preference.ListPreference;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -47,7 +48,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_TOGGLE_DALTONIZER;
+ return SettingsEnums.ACCESSIBILITY_TOGGLE_DALTONIZER;
}
@Override
@@ -61,7 +62,7 @@
mType = (ListPreference) findPreference("type");
- if (!AccessibilitySettings.isColorTransformAccelerated(getActivity())) {
+ if (!ColorDisplayManager.isColorTransformAccelerated(getActivity())) {
mFooterPreferenceMixin.createFooterPreference().setTitle(
R.string.accessibility_display_daltonizer_preference_subtitle);
}
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
index 99ed7a1..5ed5169 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
@@ -37,7 +38,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.widget.SwitchBar;
@@ -164,7 +164,7 @@
@Override
public int getMetricsCategory() {
// TODO: Distinguish between magnification modes
- return MetricsEvent.ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFICATION;
+ return SettingsEnums.ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFICATION;
}
@Override
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentForSetupWizard.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentForSetupWizard.java
index 48a0569..5fe62a7 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentForSetupWizard.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragmentForSetupWizard.java
@@ -16,16 +16,15 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-
public class ToggleScreenMagnificationPreferenceFragmentForSetupWizard
extends ToggleScreenMagnificationPreferenceFragment {
@Override
public int getMetricsCategory() {
- return MetricsEvent.SUW_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFICATION;
+ return SettingsEnums.SUW_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFICATION;
}
@Override
@@ -36,7 +35,7 @@
if (mToggleSwitch.isChecked() != args.getBoolean(AccessibilitySettings.EXTRA_CHECKED)) {
// TODO: Distinguish between magnification modes
mMetricsFeatureProvider.action(getContext(),
- MetricsEvent.SUW_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFICATION,
+ SettingsEnums.SUW_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFICATION,
mToggleSwitch.isChecked());
}
}
diff --git a/src/com/android/settings/accessibility/ToggleScreenReaderPreferenceFragmentForSetupWizard.java b/src/com/android/settings/accessibility/ToggleScreenReaderPreferenceFragmentForSetupWizard.java
index 9bd2598..fc68e03 100644
--- a/src/com/android/settings/accessibility/ToggleScreenReaderPreferenceFragmentForSetupWizard.java
+++ b/src/com/android/settings/accessibility/ToggleScreenReaderPreferenceFragmentForSetupWizard.java
@@ -16,10 +16,9 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-
public class ToggleScreenReaderPreferenceFragmentForSetupWizard
extends ToggleAccessibilityServicePreferenceFragment {
@@ -33,7 +32,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SUW_ACCESSIBILITY_TOGGLE_SCREEN_READER;
+ return SettingsEnums.SUW_ACCESSIBILITY_TOGGLE_SCREEN_READER;
}
@Override
@@ -41,7 +40,7 @@
// Log the final choice in value if it's different from the previous value.
if (mToggleSwitch.isChecked() != mToggleSwitchWasInitiallyChecked) {
mMetricsFeatureProvider.action(getContext(),
- MetricsEvent.SUW_ACCESSIBILITY_TOGGLE_SCREEN_READER, mToggleSwitch.isChecked());
+ SettingsEnums.SUW_ACCESSIBILITY_TOGGLE_SCREEN_READER, mToggleSwitch.isChecked());
}
super.onStop();
diff --git a/src/com/android/settings/accessibility/ToggleSelectToSpeakPreferenceFragmentForSetupWizard.java b/src/com/android/settings/accessibility/ToggleSelectToSpeakPreferenceFragmentForSetupWizard.java
index 2c9b58c..be9e8d4 100644
--- a/src/com/android/settings/accessibility/ToggleSelectToSpeakPreferenceFragmentForSetupWizard.java
+++ b/src/com/android/settings/accessibility/ToggleSelectToSpeakPreferenceFragmentForSetupWizard.java
@@ -16,10 +16,9 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-
public class ToggleSelectToSpeakPreferenceFragmentForSetupWizard
extends ToggleAccessibilityServicePreferenceFragment {
@@ -33,7 +32,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SUW_ACCESSIBILITY_TOGGLE_SCREEN_READER;
+ return SettingsEnums.SUW_ACCESSIBILITY_TOGGLE_SCREEN_READER;
}
@Override
@@ -41,7 +40,7 @@
// Log the final choice in value if it's different from the previous value.
if (mToggleSwitch.isChecked() != mToggleSwitchWasInitiallyChecked) {
mMetricsFeatureProvider.action(getContext(),
- MetricsEvent.SUW_ACCESSIBILITY_TOGGLE_SELECT_TO_SPEAK,
+ SettingsEnums.SUW_ACCESSIBILITY_TOGGLE_SELECT_TO_SPEAK,
mToggleSwitch.isChecked());
}
diff --git a/src/com/android/settings/accessibility/TouchVibrationPreferenceFragment.java b/src/com/android/settings/accessibility/TouchVibrationPreferenceFragment.java
index 52fd069..f6bbbf3 100644
--- a/src/com/android/settings/accessibility/TouchVibrationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/TouchVibrationPreferenceFragment.java
@@ -15,11 +15,11 @@
*/
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.media.AudioAttributes;
import android.os.Vibrator;
import android.provider.Settings;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
/**
@@ -28,7 +28,7 @@
public class TouchVibrationPreferenceFragment extends VibrationPreferenceFragment {
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_VIBRATION_TOUCH;
+ return SettingsEnums.ACCESSIBILITY_VIBRATION_TOUCH;
}
@Override
diff --git a/src/com/android/settings/accessibility/VibrationSettings.java b/src/com/android/settings/accessibility/VibrationSettings.java
index 37207e7..9d31220 100644
--- a/src/com/android/settings/accessibility/VibrationSettings.java
+++ b/src/com/android/settings/accessibility/VibrationSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.accessibility;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -38,7 +38,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_VIBRATION;
+ return SettingsEnums.ACCESSIBILITY_VIBRATION;
}
@Override
diff --git a/src/com/android/settings/accounts/AccountDashboardFragment.java b/src/com/android/settings/accounts/AccountDashboardFragment.java
index c1499ce..515008a 100644
--- a/src/com/android/settings/accounts/AccountDashboardFragment.java
+++ b/src/com/android/settings/accounts/AccountDashboardFragment.java
@@ -17,10 +17,10 @@
import static android.provider.Settings.EXTRA_AUTHORITIES;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.dashboard.DashboardFragment;
@@ -43,7 +43,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCOUNT;
+ return SettingsEnums.ACCOUNT;
}
@Override
diff --git a/src/com/android/settings/accounts/AccountDetailDashboardFragment.java b/src/com/android/settings/accounts/AccountDetailDashboardFragment.java
index e13d3eb..4b61238 100644
--- a/src/com/android/settings/accounts/AccountDetailDashboardFragment.java
+++ b/src/com/android/settings/accounts/AccountDetailDashboardFragment.java
@@ -18,6 +18,7 @@
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.os.UserHandle;
@@ -26,7 +27,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.dashboard.DashboardFragment;
@@ -113,7 +113,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCOUNT;
+ return SettingsEnums.ACCOUNT;
}
@Override
diff --git a/src/com/android/settings/accounts/AccountFeatureProvider.java b/src/com/android/settings/accounts/AccountFeatureProvider.java
index ef14fa0..9829ca6 100644
--- a/src/com/android/settings/accounts/AccountFeatureProvider.java
+++ b/src/com/android/settings/accounts/AccountFeatureProvider.java
@@ -18,7 +18,6 @@
import android.accounts.Account;
import android.content.Context;
-import android.content.Intent;
public interface AccountFeatureProvider {
String getAccountType();
diff --git a/src/com/android/settings/accounts/AccountSyncPreferenceController.java b/src/com/android/settings/accounts/AccountSyncPreferenceController.java
index 6d58bb8..cea8843 100644
--- a/src/com/android/settings/accounts/AccountSyncPreferenceController.java
+++ b/src/com/android/settings/accounts/AccountSyncPreferenceController.java
@@ -19,6 +19,7 @@
import static android.content.Intent.EXTRA_USER;
import android.accounts.Account;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.SyncAdapterType;
@@ -29,7 +30,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.core.SubSettingLauncher;
@@ -66,7 +66,7 @@
new SubSettingLauncher(mContext)
.setDestination(AccountSyncSettings.class.getName())
.setArguments(args)
- .setSourceMetricsCategory( MetricsProto.MetricsEvent.ACCOUNT)
+ .setSourceMetricsCategory( SettingsEnums.ACCOUNT)
.setTitleRes( R.string.account_sync_title)
.launch();
diff --git a/src/com/android/settings/accounts/AccountSyncSettings.java b/src/com/android/settings/accounts/AccountSyncSettings.java
index 8a33e6c..0032989 100644
--- a/src/com/android/settings/accounts/AccountSyncSettings.java
+++ b/src/com/android/settings/accounts/AccountSyncSettings.java
@@ -20,6 +20,7 @@
import android.accounts.AccountManager;
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -44,7 +45,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.widget.EntityHeaderController;
@@ -80,14 +80,14 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCOUNTS_ACCOUNT_SYNC;
+ return SettingsEnums.ACCOUNTS_ACCOUNT_SYNC;
}
@Override
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case CANT_DO_ONETIME_SYNC_DIALOG:
- return MetricsEvent.DIALOG_ACCOUNT_SYNC_CANNOT_ONETIME_SYNC;
+ return SettingsEnums.DIALOG_ACCOUNT_SYNC_CANNOT_ONETIME_SYNC;
default:
return 0;
}
diff --git a/src/com/android/settings/accounts/ChooseAccountFragment.java b/src/com/android/settings/accounts/ChooseAccountFragment.java
index 98b9ee6..0d7956a 100644
--- a/src/com/android/settings/accounts/ChooseAccountFragment.java
+++ b/src/com/android/settings/accounts/ChooseAccountFragment.java
@@ -16,12 +16,12 @@
package com.android.settings.accounts;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.dashboard.DashboardFragment;
@@ -43,7 +43,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCOUNTS_CHOOSE_ACCOUNT_ACTIVITY;
+ return SettingsEnums.ACCOUNTS_CHOOSE_ACCOUNT_ACTIVITY;
}
@Override
diff --git a/src/com/android/settings/accounts/CrossProfileCalendarPreferenceController.java b/src/com/android/settings/accounts/CrossProfileCalendarPreferenceController.java
index 38c95dc..aa314d6 100644
--- a/src/com/android/settings/accounts/CrossProfileCalendarPreferenceController.java
+++ b/src/com/android/settings/accounts/CrossProfileCalendarPreferenceController.java
@@ -19,15 +19,13 @@
import android.os.UserHandle;
import android.provider.Settings;
-import com.android.settings.core.BasePreferenceController;
+import androidx.preference.Preference;
+
import com.android.settings.core.TogglePreferenceController;
-import com.android.settings.slices.SliceData;
import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.RestrictedSwitchPreference;
-import androidx.preference.Preference;
-
public class CrossProfileCalendarPreferenceController extends TogglePreferenceController {
private UserHandle mManagedUser;
diff --git a/src/com/android/settings/accounts/ManagedProfileSettings.java b/src/com/android/settings/accounts/ManagedProfileSettings.java
index dccd7f6..a4105ef 100644
--- a/src/com/android/settings/accounts/ManagedProfileSettings.java
+++ b/src/com/android/settings/accounts/ManagedProfileSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.accounts;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -26,7 +27,6 @@
import android.provider.SearchIndexableResource;
import android.util.Log;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.dashboard.DashboardFragment;
@@ -105,7 +105,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.ACCOUNTS_WORK_PROFILE_SETTINGS;
+ return SettingsEnums.ACCOUNTS_WORK_PROFILE_SETTINGS;
}
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
diff --git a/src/com/android/settings/accounts/RemoveAccountPreferenceController.java b/src/com/android/settings/accounts/RemoveAccountPreferenceController.java
index 06eddd3..5523cce 100644
--- a/src/com/android/settings/accounts/RemoveAccountPreferenceController.java
+++ b/src/com/android/settings/accounts/RemoveAccountPreferenceController.java
@@ -23,6 +23,7 @@
import android.accounts.OperationCanceledException;
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -37,7 +38,6 @@
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -147,7 +147,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_ACCOUNT_SYNC_REMOVE;
+ return SettingsEnums.DIALOG_ACCOUNT_SYNC_REMOVE;
}
@Override
@@ -210,7 +210,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_ACCOUNT_SYNC_FAILED_REMOVAL;
+ return SettingsEnums.DIALOG_ACCOUNT_SYNC_FAILED_REMOVAL;
}
}
diff --git a/src/com/android/settings/accounts/RemoveUserFragment.java b/src/com/android/settings/accounts/RemoveUserFragment.java
index 0fcf64f..0524b63 100644
--- a/src/com/android/settings/accounts/RemoveUserFragment.java
+++ b/src/com/android/settings/accounts/RemoveUserFragment.java
@@ -17,12 +17,12 @@
package com.android.settings.accounts;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.UserManager;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.users.UserDialogs;
@@ -53,6 +53,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_REMOVE_USER;
+ return SettingsEnums.DIALOG_REMOVE_USER;
}
}
diff --git a/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java b/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
index 9ac3ecc..94c332f 100644
--- a/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
+++ b/src/com/android/settings/applications/AppAndNotificationDashboardFragment.java
@@ -18,12 +18,12 @@
import android.app.Activity;
import android.app.Application;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.notification.EmergencyBroadcastPreferenceController;
@@ -42,7 +42,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_APP_NOTIF_CATEGORY;
+ return SettingsEnums.SETTINGS_APP_NOTIF_CATEGORY;
}
@Override
diff --git a/src/com/android/settings/applications/AppInfoBase.java b/src/com/android/settings/applications/AppInfoBase.java
index 7fb5787f..7104340 100644
--- a/src/com/android/settings/applications/AppInfoBase.java
+++ b/src/com/android/settings/applications/AppInfoBase.java
@@ -21,6 +21,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -41,7 +42,6 @@
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.applications.manageapplications.ManageApplications;
@@ -241,7 +241,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_APP_INFO_ACTION;
+ return SettingsEnums.DIALOG_APP_INFO_ACTION;
}
@Override
diff --git a/src/com/android/settings/applications/AppLaunchSettings.java b/src/com/android/settings/applications/AppLaunchSettings.java
index 3ccc36f..c61f5d1 100644
--- a/src/com/android/settings/applications/AppLaunchSettings.java
+++ b/src/com/android/settings/applications/AppLaunchSettings.java
@@ -19,8 +19,8 @@
import static android.content.pm.PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS;
import static android.content.pm.PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK;
import static android.content.pm.PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER;
-import static android.content.pm.PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ApplicationInfo;
@@ -40,7 +40,6 @@
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
@@ -224,6 +223,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_APP_LAUNCH;
+ return SettingsEnums.APPLICATIONS_APP_LAUNCH;
}
}
diff --git a/src/com/android/settings/applications/AppStorageSettings.java b/src/com/android/settings/applications/AppStorageSettings.java
index 61293c5..56fa455 100644
--- a/src/com/android/settings/applications/AppStorageSettings.java
+++ b/src/com/android/settings/applications/AppStorageSettings.java
@@ -22,6 +22,7 @@
import android.app.ActivityManager;
import android.app.AppGlobals;
import android.app.GrantedUriPermission;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -49,7 +50,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.deviceinfo.StorageWizardMoveConfirm;
@@ -198,7 +198,7 @@
mClearCacheObserver = new ClearCacheObserver();
}
mMetricsFeatureProvider.action(getContext(),
- MetricsEvent.ACTION_SETTINGS_CLEAR_APP_CACHE);
+ SettingsEnums.ACTION_SETTINGS_CLEAR_APP_CACHE);
mPm.deleteApplicationCacheFiles(mPackageName, mClearCacheObserver);
}
@@ -361,7 +361,7 @@
* button for a system package
*/
private void initiateClearUserData() {
- mMetricsFeatureProvider.action(getContext(), MetricsEvent.ACTION_SETTINGS_CLEAR_APP_DATA);
+ mMetricsFeatureProvider.action(getContext(), SettingsEnums.ACTION_SETTINGS_CLEAR_APP_DATA);
mButtonsPref.setButton1Enabled(false);
// Invoke uninstall or clear user data based on sysPackage
String packageName = mAppEntry.info.packageName;
@@ -602,7 +602,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_APP_STORAGE;
+ return SettingsEnums.APPLICATIONS_APP_STORAGE;
}
class ClearCacheObserver extends IPackageDataObserver.Stub {
diff --git a/src/com/android/settings/applications/ConfirmConvertToFbe.java b/src/com/android/settings/applications/ConfirmConvertToFbe.java
index 5570f97..35ddc6b 100644
--- a/src/com/android/settings/applications/ConfirmConvertToFbe.java
+++ b/src/com/android/settings/applications/ConfirmConvertToFbe.java
@@ -15,6 +15,7 @@
*/
package com.android.settings.applications;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -22,7 +23,6 @@
import android.view.ViewGroup;
import android.widget.Button;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -50,6 +50,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CONVERT_FBE_CONFIRM;
+ return SettingsEnums.CONVERT_FBE_CONFIRM;
}
}
diff --git a/src/com/android/settings/applications/ConvertToFbe.java b/src/com/android/settings/applications/ConvertToFbe.java
index 85527d2..2a6bdaf 100644
--- a/src/com/android/settings/applications/ConvertToFbe.java
+++ b/src/com/android/settings/applications/ConvertToFbe.java
@@ -17,6 +17,7 @@
import android.annotation.Nullable;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
@@ -25,7 +26,6 @@
import android.view.ViewGroup;
import android.widget.Button;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.core.SubSettingLauncher;
@@ -90,6 +90,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CONVERT_FBE;
+ return SettingsEnums.CONVERT_FBE;
}
}
diff --git a/src/com/android/settings/applications/DefaultAppSettings.java b/src/com/android/settings/applications/DefaultAppSettings.java
index d8fd9eb..353d867 100644
--- a/src/com/android/settings/applications/DefaultAppSettings.java
+++ b/src/com/android/settings/applications/DefaultAppSettings.java
@@ -16,12 +16,12 @@
package com.android.settings.applications;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.icu.text.ListFormatter;
import android.provider.SearchIndexableResource;
import android.text.TextUtils;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.assist.DefaultAssistPreferenceController;
import com.android.settings.applications.defaultapps.DefaultBrowserPreferenceController;
@@ -69,7 +69,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_ADVANCED;
+ return SettingsEnums.APPLICATIONS_ADVANCED;
}
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context) {
diff --git a/src/com/android/settings/applications/ProcessStatsDetail.java b/src/com/android/settings/applications/ProcessStatsDetail.java
index 59de758..266c195 100644
--- a/src/com/android/settings/applications/ProcessStatsDetail.java
+++ b/src/com/android/settings/applications/ProcessStatsDetail.java
@@ -22,6 +22,7 @@
import android.app.ActivityManager;
import android.app.ActivityManager.RunningServiceInfo;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
@@ -47,7 +48,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.CancellablePreference;
import com.android.settings.CancellablePreference.OnCancelListener;
import com.android.settings.R;
@@ -146,7 +146,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_PROCESS_STATS_DETAIL;
+ return SettingsEnums.APPLICATIONS_PROCESS_STATS_DETAIL;
}
@Override
diff --git a/src/com/android/settings/applications/ProcessStatsSummary.java b/src/com/android/settings/applications/ProcessStatsSummary.java
index c32bac7..e576065 100644
--- a/src/com/android/settings/applications/ProcessStatsSummary.java
+++ b/src/com/android/settings/applications/ProcessStatsSummary.java
@@ -16,6 +16,7 @@
package com.android.settings.applications;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.text.format.Formatter;
@@ -24,7 +25,6 @@
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceClickListener;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SummaryPreference;
import com.android.settings.Utils;
@@ -102,7 +102,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.PROCESS_STATS_SUMMARY;
+ return SettingsEnums.PROCESS_STATS_SUMMARY;
}
@Override
diff --git a/src/com/android/settings/applications/ProcessStatsUi.java b/src/com/android/settings/applications/ProcessStatsUi.java
index 25f9c7e..f49d638 100644
--- a/src/com/android/settings/applications/ProcessStatsUi.java
+++ b/src/com/android/settings/applications/ProcessStatsUi.java
@@ -16,6 +16,7 @@
package com.android.settings.applications;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Bundle;
@@ -29,7 +30,6 @@
import androidx.preference.PreferenceGroup;
import com.android.internal.app.procstats.ProcessStats;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.applications.ProcStatsData.MemInfo;
@@ -93,7 +93,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_PROCESS_STATS_UI;
+ return SettingsEnums.APPLICATIONS_PROCESS_STATS_UI;
}
@Override
diff --git a/src/com/android/settings/applications/RecentAppsPreferenceController.java b/src/com/android/settings/applications/RecentAppsPreferenceController.java
index b6e8f4c..81eefb3 100644
--- a/src/com/android/settings/applications/RecentAppsPreferenceController.java
+++ b/src/com/android/settings/applications/RecentAppsPreferenceController.java
@@ -16,10 +16,8 @@
package com.android.settings.applications;
-import static com.android.internal.logging.nano.MetricsProto.MetricsEvent
- .SETTINGS_APP_NOTIF_CATEGORY;
-
import android.app.Application;
+import android.app.settings.SettingsEnums;
import android.app.usage.UsageStats;
import android.app.usage.UsageStatsManager;
import android.content.Context;
@@ -251,7 +249,7 @@
pref.setOnPreferenceClickListener(preference -> {
AppInfoBase.startAppInfoFragment(AppInfoDashboardFragment.class,
R.string.application_info_label, pkgName, appEntry.info.uid, mHost,
- 1001 /*RequestCode*/, SETTINGS_APP_NOTIF_CATEGORY);
+ 1001 /*RequestCode*/, SettingsEnums.SETTINGS_APP_NOTIF_CATEGORY);
return true;
});
if (!rebindPref) {
diff --git a/src/com/android/settings/applications/RunningServiceDetails.java b/src/com/android/settings/applications/RunningServiceDetails.java
index 272945c..6165fb4 100644
--- a/src/com/android/settings/applications/RunningServiceDetails.java
+++ b/src/com/android/settings/applications/RunningServiceDetails.java
@@ -5,6 +5,7 @@
import android.app.ApplicationErrorReport;
import android.app.Dialog;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
@@ -32,7 +33,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.core.InstrumentedFragment;
@@ -535,7 +535,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.RUNNING_SERVICE_DETAILS;
+ return SettingsEnums.RUNNING_SERVICE_DETAILS;
}
@Override
@@ -608,7 +608,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_RUNNIGN_SERVICE;
+ return SettingsEnums.DIALOG_RUNNIGN_SERVICE;
}
}
diff --git a/src/com/android/settings/applications/RunningServices.java b/src/com/android/settings/applications/RunningServices.java
index bf48492..4d13241 100644
--- a/src/com/android/settings/applications/RunningServices.java
+++ b/src/com/android/settings/applications/RunningServices.java
@@ -15,6 +15,7 @@
*/
package com.android.settings.applications;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -23,7 +24,6 @@
import android.view.View;
import android.view.ViewGroup;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.widget.LoadingViewController;
@@ -110,7 +110,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.RUNNING_SERVICES;
+ return SettingsEnums.RUNNING_SERVICES;
}
private final Runnable mRunningProcessesAvail = new Runnable() {
diff --git a/src/com/android/settings/applications/UsageAccessDetails.java b/src/com/android/settings/applications/UsageAccessDetails.java
index 0a01896..58dff7c 100644
--- a/src/com/android/settings/applications/UsageAccessDetails.java
+++ b/src/com/android/settings/applications/UsageAccessDetails.java
@@ -17,6 +17,7 @@
import android.app.AppOpsManager;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -32,7 +33,6 @@
import androidx.preference.Preference.OnPreferenceClickListener;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.AppStateUsageBridge.UsageState;
import com.android.settings.overlay.FeatureFactory;
@@ -112,8 +112,8 @@
@VisibleForTesting
void logSpecialPermissionChange(boolean newState, String packageName) {
- int logCategory = newState ? MetricsEvent.APP_SPECIAL_PERMISSION_USAGE_VIEW_ALLOW
- : MetricsEvent.APP_SPECIAL_PERMISSION_USAGE_VIEW_DENY;
+ int logCategory = newState ? SettingsEnums.APP_SPECIAL_PERMISSION_USAGE_VIEW_ALLOW
+ : SettingsEnums.APP_SPECIAL_PERMISSION_USAGE_VIEW_DENY;
final MetricsFeatureProvider metricsFeatureProvider =
FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider();
metricsFeatureProvider.action(
@@ -163,7 +163,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_USAGE_ACCESS_DETAIL;
+ return SettingsEnums.APPLICATIONS_USAGE_ACCESS_DETAIL;
}
}
diff --git a/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java b/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
index 2e528a7..c661890 100644
--- a/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.ActivityManager;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@@ -44,7 +45,6 @@
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
@@ -218,7 +218,7 @@
uninstallDaIntent.putExtra(DeviceAdminAdd.EXTRA_DEVICE_ADMIN_PACKAGE_NAME,
packageName);
mMetricsFeatureProvider.action(mActivity,
- MetricsProto.MetricsEvent.ACTION_SETTINGS_UNINSTALL_DEVICE_ADMIN);
+ SettingsEnums.ACTION_SETTINGS_UNINSTALL_DEVICE_ADMIN);
mFragment.startActivityForResult(uninstallDaIntent, mRequestRemoveDeviceAdmin);
return;
}
@@ -244,8 +244,8 @@
mMetricsFeatureProvider.action(
mActivity,
mAppEntry.info.enabled
- ? MetricsProto.MetricsEvent.ACTION_SETTINGS_DISABLE_APP
- : MetricsProto.MetricsEvent.ACTION_SETTINGS_ENABLE_APP);
+ ? SettingsEnums.ACTION_SETTINGS_DISABLE_APP
+ : SettingsEnums.ACTION_SETTINGS_ENABLE_APP);
AsyncTask.execute(new DisableChangerRunnable(mPm, mAppEntry.info.packageName,
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT));
}
@@ -288,13 +288,13 @@
switch (id) {
case ButtonActionDialogFragment.DialogType.DISABLE:
mMetricsFeatureProvider.action(mActivity,
- MetricsProto.MetricsEvent.ACTION_SETTINGS_DISABLE_APP);
+ SettingsEnums.ACTION_SETTINGS_DISABLE_APP);
AsyncTask.execute(new DisableChangerRunnable(mPm, mAppEntry.info.packageName,
PackageManager.COMPONENT_ENABLED_STATE_DISABLED_USER));
break;
case ButtonActionDialogFragment.DialogType.SPECIAL_DISABLE:
mMetricsFeatureProvider.action(mActivity,
- MetricsProto.MetricsEvent.ACTION_SETTINGS_DISABLE_APP);
+ SettingsEnums.ACTION_SETTINGS_DISABLE_APP);
uninstallPkg(mAppEntry.info.packageName, false, true);
break;
case ButtonActionDialogFragment.DialogType.FORCE_STOP:
@@ -524,7 +524,7 @@
uninstallIntent.putExtra(Intent.EXTRA_UNINSTALL_ALL_USERS, allUsers);
mMetricsFeatureProvider.action(
- mActivity, MetricsProto.MetricsEvent.ACTION_SETTINGS_UNINSTALL_APP);
+ mActivity, SettingsEnums.ACTION_SETTINGS_UNINSTALL_APP);
mFragment.startActivityForResult(uninstallIntent, mRequestUninstall);
mDisableAfterUninstall = andDisable;
}
@@ -533,7 +533,7 @@
void forceStopPackage(String pkgName) {
mMetricsFeatureProvider.action(
mMetricsFeatureProvider.getAttribution(mActivity),
- MetricsProto.MetricsEvent.ACTION_APP_FORCE_STOP,
+ SettingsEnums.ACTION_APP_FORCE_STOP,
mFragment.getMetricsCategory(),
pkgName,
0);
diff --git a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
index 80cc6ae..4987286 100755
--- a/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
+++ b/src/com/android/settings/applications/appinfo/AppInfoDashboardFragment.java
@@ -20,6 +20,7 @@
import android.app.Activity;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -41,13 +42,11 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.applications.manageapplications.ManageApplications;
-import com.android.settings.applications.specialaccess.pictureinpicture
- .PictureInPictureDetailPreferenceController;
+import com.android.settings.applications.specialaccess.pictureinpicture.PictureInPictureDetailPreferenceController;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settingslib.RestrictedLockUtilsInternal;
@@ -209,7 +208,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_INSTALLED_APP_DETAILS;
+ return SettingsEnums.APPLICATIONS_INSTALLED_APP_DETAILS;
}
@Override
@@ -459,7 +458,7 @@
final Intent uninstallIntent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageURI);
uninstallIntent.putExtra(Intent.EXTRA_UNINSTALL_ALL_USERS, allUsers);
mMetricsFeatureProvider.action(
- getContext(), MetricsEvent.ACTION_SETTINGS_UNINSTALL_APP);
+ getContext(), SettingsEnums.ACTION_SETTINGS_UNINSTALL_APP);
startActivityForResult(uninstallIntent, REQUEST_UNINSTALL);
}
diff --git a/src/com/android/settings/applications/appinfo/AppSettingPreferenceController.java b/src/com/android/settings/applications/appinfo/AppSettingPreferenceController.java
index c08ae75..cacbffb 100644
--- a/src/com/android/settings/applications/appinfo/AppSettingPreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppSettingPreferenceController.java
@@ -16,8 +16,6 @@
package com.android.settings.applications.appinfo;
-import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_OPEN_APP_SETTING;
-
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
@@ -63,7 +61,7 @@
}
FeatureFactory.getFactory(mContext).getMetricsFeatureProvider()
.action(SettingsEnums.PAGE_UNKNOWN,
- ACTION_OPEN_APP_SETTING,
+ SettingsEnums.ACTION_OPEN_APP_SETTING,
mParent.getMetricsCategory(),
null, 0);
mContext.startActivity(intent);
diff --git a/src/com/android/settings/applications/appinfo/ButtonActionDialogFragment.java b/src/com/android/settings/applications/appinfo/ButtonActionDialogFragment.java
index a0a8fb6..80ce802 100644
--- a/src/com/android/settings/applications/appinfo/ButtonActionDialogFragment.java
+++ b/src/com/android/settings/applications/appinfo/ButtonActionDialogFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.applications.appinfo;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -24,7 +25,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -74,7 +74,7 @@
public int getMetricsCategory() {
//TODO(35810915): update the metrics label because for now this fragment will be shown
// in two screens
- return MetricsProto.MetricsEvent.DIALOG_APP_INFO_ACTION;
+ return SettingsEnums.DIALOG_APP_INFO_ACTION;
}
@Override
diff --git a/src/com/android/settings/applications/appinfo/DefaultAppShortcutPreferenceControllerBase.java b/src/com/android/settings/applications/appinfo/DefaultAppShortcutPreferenceControllerBase.java
index e25075f..804fdbe 100644
--- a/src/com/android/settings/applications/appinfo/DefaultAppShortcutPreferenceControllerBase.java
+++ b/src/com/android/settings/applications/appinfo/DefaultAppShortcutPreferenceControllerBase.java
@@ -15,6 +15,7 @@
package com.android.settings.applications.appinfo;
import android.app.role.RoleManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@@ -23,7 +24,6 @@
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.util.CollectionUtils;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
@@ -90,7 +90,7 @@
.setDestination(DefaultAppSettings.class.getName())
.setArguments(bundle)
.setTitleRes(R.string.configure_apps)
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.VIEW_UNKNOWN)
+ .setSourceMetricsCategory(SettingsEnums.PAGE_UNKNOWN)
.launch();
}
return true;
diff --git a/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java b/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java
index f0d1068..9cf57bd 100644
--- a/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java
+++ b/src/com/android/settings/applications/appinfo/DrawOverlayDetails.java
@@ -18,6 +18,7 @@
import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import android.app.AppOpsManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -34,7 +35,6 @@
import androidx.preference.Preference.OnPreferenceClickListener;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.AppInfoWithHeader;
import com.android.settings.applications.AppStateAppOpsBridge.PermissionState;
@@ -128,8 +128,8 @@
@VisibleForTesting
void logSpecialPermissionChange(boolean newState, String packageName) {
- int logCategory = newState ? MetricsEvent.APP_SPECIAL_PERMISSION_APPDRAW_ALLOW
- : MetricsEvent.APP_SPECIAL_PERMISSION_APPDRAW_DENY;
+ int logCategory = newState ? SettingsEnums.APP_SPECIAL_PERMISSION_APPDRAW_ALLOW
+ : SettingsEnums.APP_SPECIAL_PERMISSION_APPDRAW_DENY;
final MetricsFeatureProvider metricsFeatureProvider =
FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider();
metricsFeatureProvider.action(
@@ -163,7 +163,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SYSTEM_ALERT_WINDOW_APPS;
+ return SettingsEnums.SYSTEM_ALERT_WINDOW_APPS;
}
public static CharSequence getSummary(Context context, AppEntry entry) {
diff --git a/src/com/android/settings/applications/appinfo/ExternalSourcesDetails.java b/src/com/android/settings/applications/appinfo/ExternalSourcesDetails.java
index 38e70d1..b723274 100644
--- a/src/com/android/settings/applications/appinfo/ExternalSourcesDetails.java
+++ b/src/com/android/settings/applications/appinfo/ExternalSourcesDetails.java
@@ -19,6 +19,7 @@
import static android.app.Activity.RESULT_OK;
import android.app.AppOpsManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.os.UserHandle;
@@ -28,7 +29,6 @@
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Settings;
import com.android.settings.applications.AppInfoWithHeader;
@@ -143,6 +143,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.MANAGE_EXTERNAL_SOURCES;
+ return SettingsEnums.MANAGE_EXTERNAL_SOURCES;
}
}
diff --git a/src/com/android/settings/applications/appinfo/InstantAppButtonDialogFragment.java b/src/com/android/settings/applications/appinfo/InstantAppButtonDialogFragment.java
index 808d018..6376d52 100644
--- a/src/com/android/settings/applications/appinfo/InstantAppButtonDialogFragment.java
+++ b/src/com/android/settings/applications/appinfo/InstantAppButtonDialogFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.applications.appinfo;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
@@ -24,7 +25,6 @@
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.overlay.FeatureFactory;
@@ -49,7 +49,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_APP_INFO_ACTION;
+ return SettingsEnums.DIALOG_APP_INFO_ACTION;
}
@Override
@@ -64,7 +64,7 @@
final Context context = getContext();
final PackageManager packageManager = context.getPackageManager();
FeatureFactory.getFactory(context).getMetricsFeatureProvider()
- .action(context, MetricsEvent.ACTION_SETTINGS_CLEAR_INSTANT_APP, mPackageName);
+ .action(context, SettingsEnums.ACTION_SETTINGS_CLEAR_INSTANT_APP, mPackageName);
packageManager.deletePackageAsUser(mPackageName, null, 0, UserHandle.myUserId());
}
diff --git a/src/com/android/settings/applications/appinfo/WriteSettingsDetails.java b/src/com/android/settings/applications/appinfo/WriteSettingsDetails.java
index e126b5e..f8c7ac5 100644
--- a/src/com/android/settings/applications/appinfo/WriteSettingsDetails.java
+++ b/src/com/android/settings/applications/appinfo/WriteSettingsDetails.java
@@ -16,6 +16,7 @@
package com.android.settings.applications.appinfo;
import android.app.AppOpsManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -29,7 +30,6 @@
import androidx.preference.Preference.OnPreferenceClickListener;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.AppInfoWithHeader;
import com.android.settings.applications.AppStateAppOpsBridge.PermissionState;
@@ -101,8 +101,8 @@
}
void logSpecialPermissionChange(boolean newState, String packageName) {
- int logCategory = newState ? MetricsEvent.APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_ALLOW
- : MetricsEvent.APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_DENY;
+ int logCategory = newState ? SettingsEnums.APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_ALLOW
+ : SettingsEnums.APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_DENY;
FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider().action(getContext(),
logCategory, packageName);
}
@@ -139,7 +139,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SYSTEM_ALERT_WINDOW_APPS;
+ return SettingsEnums.SYSTEM_ALERT_WINDOW_APPS;
}
public static CharSequence getSummary(Context context, AppEntry entry) {
diff --git a/src/com/android/settings/applications/appops/BackgroundCheckSummary.java b/src/com/android/settings/applications/appops/BackgroundCheckSummary.java
index 601a566..58f962a 100644
--- a/src/com/android/settings/applications/appops/BackgroundCheckSummary.java
+++ b/src/com/android/settings/applications/appops/BackgroundCheckSummary.java
@@ -17,6 +17,7 @@
package com.android.settings.applications.appops;
import android.annotation.Nullable;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.preference.PreferenceFrameLayout;
import android.view.LayoutInflater;
@@ -25,7 +26,6 @@
import androidx.fragment.app.FragmentTransaction;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.InstrumentedPreferenceFragment;
@@ -35,7 +35,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.BACKGROUND_CHECK_SUMMARY;
+ return SettingsEnums.BACKGROUND_CHECK_SUMMARY;
}
@Override
diff --git a/src/com/android/settings/applications/assist/DefaultAssistPicker.java b/src/com/android/settings/applications/assist/DefaultAssistPicker.java
index d867070..6391aa8 100644
--- a/src/com/android/settings/applications/assist/DefaultAssistPicker.java
+++ b/src/com/android/settings/applications/assist/DefaultAssistPicker.java
@@ -17,6 +17,7 @@
package com.android.settings.applications.assist;
import android.app.ActivityManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -32,7 +33,6 @@
import androidx.annotation.VisibleForTesting;
import com.android.internal.app.AssistUtils;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
import com.android.settingslib.applications.DefaultAppInfo;
@@ -57,7 +57,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_ASSIST_PICKER;
+ return SettingsEnums.DEFAULT_ASSIST_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/assist/DefaultVoiceInputPicker.java b/src/com/android/settings/applications/assist/DefaultVoiceInputPicker.java
index 57672b9..e5953db 100644
--- a/src/com/android/settings/applications/assist/DefaultVoiceInputPicker.java
+++ b/src/com/android/settings/applications/assist/DefaultVoiceInputPicker.java
@@ -16,6 +16,7 @@
package com.android.settings.applications.assist;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -24,7 +25,6 @@
import android.text.TextUtils;
import com.android.internal.app.AssistUtils;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
import com.android.settingslib.applications.DefaultAppInfo;
@@ -40,7 +40,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_VOICE_INPUT_PICKER;
+ return SettingsEnums.DEFAULT_VOICE_INPUT_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/assist/ManageAssist.java b/src/com/android/settings/applications/assist/ManageAssist.java
index 8eb6a7f..952a3ad 100644
--- a/src/com/android/settings/applications/assist/ManageAssist.java
+++ b/src/com/android/settings/applications/assist/ManageAssist.java
@@ -16,10 +16,10 @@
package com.android.settings.applications.assist;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.gestures.AssistGestureSettingsPreferenceController;
@@ -59,7 +59,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APPLICATIONS_MANAGE_ASSIST;
+ return SettingsEnums.APPLICATIONS_MANAGE_ASSIST;
}
@Override
diff --git a/src/com/android/settings/applications/defaultapps/AutofillPicker.java b/src/com/android/settings/applications/defaultapps/AutofillPicker.java
index 6691d2f..fb9d631 100644
--- a/src/com/android/settings/applications/defaultapps/AutofillPicker.java
+++ b/src/com/android/settings/applications/defaultapps/AutofillPicker.java
@@ -16,10 +16,10 @@
package com.android.settings.applications.defaultapps;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -36,7 +36,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_AUTOFILL_PICKER;
+ return SettingsEnums.DEFAULT_AUTOFILL_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java b/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
index 14bf1ef..5d41ba7 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultAppPickerFragment.java
@@ -29,7 +29,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.fuelgauge.BatteryUtils;
@@ -71,7 +70,7 @@
protected void onRadioButtonConfirmed(String selectedKey) {
mMetricsFeatureProvider.action(
mMetricsFeatureProvider.getAttribution(getActivity()),
- MetricsEvent.ACTION_SETTINGS_UPDATE_DEFAULT_APP,
+ SettingsEnums.ACTION_SETTINGS_UPDATE_DEFAULT_APP,
getMetricsCategory(),
selectedKey,
0 /* value */);
@@ -113,7 +112,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DEFAULT_APP_PICKER_CONFIRMATION_DIALOG;
+ return SettingsEnums.DEFAULT_APP_PICKER_CONFIRMATION_DIALOG;
}
/**
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java b/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
index 459a5b7..49659ad 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
@@ -18,6 +18,7 @@
import android.Manifest;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
@@ -38,7 +39,6 @@
import androidx.preference.Preference;
import com.android.internal.content.PackageMonitor;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.applications.DefaultAppInfo;
import com.android.settingslib.utils.ThreadUtils;
@@ -114,7 +114,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_AUTOFILL_PICKER;
+ return SettingsEnums.DEFAULT_AUTOFILL_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java b/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java
index cfaac3a..40ea25e 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultBrowserPicker.java
@@ -16,11 +16,11 @@
package com.android.settings.applications.defaultapps;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.applications.DefaultAppInfo;
@@ -39,7 +39,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_BROWSER_PICKER;
+ return SettingsEnums.DEFAULT_BROWSER_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java b/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java
index 76e93cc..5a1effd 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultEmergencyPicker.java
@@ -16,6 +16,7 @@
package com.android.settings.applications.defaultapps;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@@ -25,7 +26,6 @@
import android.provider.Settings;
import android.text.TextUtils;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settingslib.applications.DefaultAppInfo;
@@ -38,7 +38,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_EMERGENCY_APP_PICKER;
+ return SettingsEnums.DEFAULT_EMERGENCY_APP_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java b/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java
index 73cc915..304b307 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultHomePicker.java
@@ -16,6 +16,7 @@
package com.android.settings.applications.defaultapps;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -28,7 +29,6 @@
import android.os.Build;
import android.text.TextUtils;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.applications.DefaultAppInfo;
@@ -52,7 +52,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_HOME_PICKER;
+ return SettingsEnums.DEFAULT_HOME_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java b/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java
index 72f1cc5..8b16be1 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultPhonePicker.java
@@ -16,13 +16,13 @@
package com.android.settings.applications.defaultapps;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.PackageManager;
import android.telecom.DefaultDialerManager;
import android.telecom.TelecomManager;
import android.text.TextUtils;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.applications.DefaultAppInfo;
@@ -35,7 +35,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_PHONE_PICKER;
+ return SettingsEnums.DEFAULT_PHONE_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java b/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java
index 6d1e21d..4c6b6e8 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultSmsPicker.java
@@ -16,12 +16,12 @@
package com.android.settings.applications.defaultapps;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.text.TextUtils;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.telephony.SmsApplication;
import com.android.settings.R;
import com.android.settings.Utils;
@@ -38,7 +38,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEFAULT_SMS_PICKER;
+ return SettingsEnums.DEFAULT_SMS_PICKER;
}
@Override
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index 5669b4c..126cf6d 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -18,32 +18,22 @@
import static androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_IDLE;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_ALL;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_BLOCKED;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_DISABLED;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_ENABLED;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_FREQUENT;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_INSTANT;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_PERSONAL;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_POWER_WHITELIST;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_POWER_WHITELIST_ALL;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_RECENT;
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
- .FILTER_APPS_WORK;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_ALL;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_BLOCKED;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_DISABLED;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_ENABLED;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_FREQUENT;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_INSTANT;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_PERSONAL;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_POWER_WHITELIST;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_POWER_WHITELIST_ALL;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_RECENT;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_WORK;
import android.annotation.Nullable;
import android.annotation.StringRes;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.app.usage.IUsageStatsManager;
import android.content.Context;
import android.content.Intent;
@@ -78,7 +68,6 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Settings;
import com.android.settings.Settings.GamesStorageActivity;
@@ -453,34 +442,34 @@
public int getMetricsCategory() {
switch (mListType) {
case LIST_TYPE_MAIN:
- return MetricsEvent.MANAGE_APPLICATIONS;
+ return SettingsEnums.MANAGE_APPLICATIONS;
case LIST_TYPE_NOTIFICATION:
- return MetricsEvent.MANAGE_APPLICATIONS_NOTIFICATIONS;
+ return SettingsEnums.MANAGE_APPLICATIONS_NOTIFICATIONS;
case LIST_TYPE_STORAGE:
if (mStorageType == STORAGE_TYPE_MUSIC) {
- return MetricsEvent.APPLICATIONS_STORAGE_MUSIC;
+ return SettingsEnums.APPLICATIONS_STORAGE_MUSIC;
}
- return MetricsEvent.APPLICATIONS_STORAGE_APPS;
+ return SettingsEnums.APPLICATIONS_STORAGE_APPS;
case LIST_TYPE_GAMES:
- return MetricsEvent.APPLICATIONS_STORAGE_GAMES;
+ return SettingsEnums.APPLICATIONS_STORAGE_GAMES;
case LIST_TYPE_MOVIES:
- return MetricsEvent.APPLICATIONS_STORAGE_MOVIES;
+ return SettingsEnums.APPLICATIONS_STORAGE_MOVIES;
case LIST_TYPE_PHOTOGRAPHY:
- return MetricsEvent.APPLICATIONS_STORAGE_PHOTOS;
+ return SettingsEnums.APPLICATIONS_STORAGE_PHOTOS;
case LIST_TYPE_USAGE_ACCESS:
- return MetricsEvent.USAGE_ACCESS;
+ return SettingsEnums.USAGE_ACCESS;
case LIST_TYPE_HIGH_POWER:
- return MetricsEvent.APPLICATIONS_HIGH_POWER_APPS;
+ return SettingsEnums.APPLICATIONS_HIGH_POWER_APPS;
case LIST_TYPE_OVERLAY:
- return MetricsEvent.SYSTEM_ALERT_WINDOW_APPS;
+ return SettingsEnums.SYSTEM_ALERT_WINDOW_APPS;
case LIST_TYPE_WRITE_SETTINGS:
- return MetricsEvent.SYSTEM_ALERT_WINDOW_APPS;
+ return SettingsEnums.SYSTEM_ALERT_WINDOW_APPS;
case LIST_TYPE_MANAGE_SOURCES:
- return MetricsEvent.MANAGE_EXTERNAL_SOURCES;
+ return SettingsEnums.MANAGE_EXTERNAL_SOURCES;
case LIST_TYPE_WIFI_ACCESS:
- return MetricsEvent.CONFIGURE_WIFI;
+ return SettingsEnums.CONFIGURE_WIFI;
default:
- return MetricsEvent.VIEW_UNKNOWN;
+ return SettingsEnums.PAGE_UNKNOWN;
}
}
diff --git a/src/com/android/settings/applications/managedomainurls/ManageDomainUrls.java b/src/com/android/settings/applications/managedomainurls/ManageDomainUrls.java
index 16f954a..010bc94 100644
--- a/src/com/android/settings/applications/managedomainurls/ManageDomainUrls.java
+++ b/src/com/android/settings/applications/managedomainurls/ManageDomainUrls.java
@@ -18,10 +18,10 @@
import static com.android.settingslib.search.SearchIndexable.MOBILE;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -58,7 +58,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.MANAGE_DOMAIN_URLS;
+ return SettingsEnums.MANAGE_DOMAIN_URLS;
}
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
diff --git a/src/com/android/settings/applications/specialaccess/SpecialAccessSettings.java b/src/com/android/settings/applications/specialaccess/SpecialAccessSettings.java
index 80cadcc..4d9a427 100644
--- a/src/com/android/settings/applications/specialaccess/SpecialAccessSettings.java
+++ b/src/com/android/settings/applications/specialaccess/SpecialAccessSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.applications.specialaccess;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -46,7 +46,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SPECIAL_ACCESS;
+ return SettingsEnums.SPECIAL_ACCESS;
}
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
diff --git a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
index a260f67..7e0ca24 100644
--- a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
+++ b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminAdd.java
@@ -60,7 +60,6 @@
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.EventLogTags;
import com.android.settings.R;
import com.android.settings.fuelgauge.BatteryUtils;
@@ -488,8 +487,8 @@
}
void logSpecialPermissionChange(boolean allow, String packageName) {
- int logCategory = allow ? MetricsProto.MetricsEvent.APP_SPECIAL_PERMISSION_ADMIN_ALLOW :
- MetricsProto.MetricsEvent.APP_SPECIAL_PERMISSION_ADMIN_DENY;
+ int logCategory = allow ? SettingsEnums.APP_SPECIAL_PERMISSION_ADMIN_ALLOW :
+ SettingsEnums.APP_SPECIAL_PERMISSION_ADMIN_DENY;
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(
SettingsEnums.PAGE_UNKNOWN,
logCategory,
diff --git a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminSettings.java b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminSettings.java
index 4cd4c04..7cbd8c7 100644
--- a/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminSettings.java
+++ b/src/com/android/settings/applications/specialaccess/deviceadmin/DeviceAdminSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.applications.specialaccess.deviceadmin;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -34,7 +34,7 @@
static final String TAG = "DeviceAdminSettings";
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEVICE_ADMIN_SETTINGS;
+ return SettingsEnums.DEVICE_ADMIN_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/applications/specialaccess/financialapps/FinancialAppsController.java b/src/com/android/settings/applications/specialaccess/financialapps/FinancialAppsController.java
index 492e4fd..c0517df 100644
--- a/src/com/android/settings/applications/specialaccess/financialapps/FinancialAppsController.java
+++ b/src/com/android/settings/applications/specialaccess/financialapps/FinancialAppsController.java
@@ -15,8 +15,8 @@
*/
package com.android.settings.applications.specialaccess.financialapps;
-import static android.Manifest.permission.SMS_FINANCIAL_TRANSACTIONS;
import static android.Manifest.permission.READ_SMS;
+import static android.Manifest.permission.SMS_FINANCIAL_TRANSACTIONS;
import android.app.AppOpsManager;
import android.content.Context;
@@ -24,20 +24,18 @@
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
-import android.os.Bundle;
import android.util.Log;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreference;
+
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.applications.ApplicationsState;
import com.android.settingslib.applications.ApplicationsState.AppEntry;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceScreen;
-import androidx.preference.Preference.OnPreferenceChangeListener;
-import androidx.preference.SwitchPreference;
-
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/applications/specialaccess/pictureinpicture/PictureInPictureDetails.java b/src/com/android/settings/applications/specialaccess/pictureinpicture/PictureInPictureDetails.java
index c36c97a..3dd428b 100644
--- a/src/com/android/settings/applications/specialaccess/pictureinpicture/PictureInPictureDetails.java
+++ b/src/com/android/settings/applications/specialaccess/pictureinpicture/PictureInPictureDetails.java
@@ -20,6 +20,7 @@
import static android.app.AppOpsManager.OP_PICTURE_IN_PICTURE;
import android.app.AppOpsManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
@@ -29,7 +30,6 @@
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.AppInfoWithHeader;
import com.android.settings.overlay.FeatureFactory;
@@ -84,7 +84,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SETTINGS_MANAGE_PICTURE_IN_PICTURE;
+ return SettingsEnums.SETTINGS_MANAGE_PICTURE_IN_PICTURE;
}
/**
@@ -121,8 +121,8 @@
@VisibleForTesting
void logSpecialPermissionChange(boolean newState, String packageName) {
int logCategory = newState
- ? MetricsEvent.APP_PICTURE_IN_PICTURE_ALLOW
- : MetricsEvent.APP_PICTURE_IN_PICTURE_DENY;
+ ? SettingsEnums.APP_PICTURE_IN_PICTURE_ALLOW
+ : SettingsEnums.APP_PICTURE_IN_PICTURE_DENY;
final MetricsFeatureProvider metricsFeatureProvider =
FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider();
metricsFeatureProvider.action(
diff --git a/src/com/android/settings/applications/specialaccess/pictureinpicture/PictureInPictureSettings.java b/src/com/android/settings/applications/specialaccess/pictureinpicture/PictureInPictureSettings.java
index d2cb2a7..fdbe1d8 100644
--- a/src/com/android/settings/applications/specialaccess/pictureinpicture/PictureInPictureSettings.java
+++ b/src/com/android/settings/applications/specialaccess/pictureinpicture/PictureInPictureSettings.java
@@ -18,6 +18,7 @@
import static android.content.pm.PackageManager.GET_ACTIVITIES;
import android.annotation.Nullable;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
@@ -37,7 +38,6 @@
import androidx.preference.Preference.OnPreferenceClickListener;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.AppInfoBase;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -192,7 +192,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SETTINGS_MANAGE_PICTURE_IN_PICTURE;
+ return SettingsEnums.SETTINGS_MANAGE_PICTURE_IN_PICTURE;
}
/**
diff --git a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
index 2ccf64f..a40ddc9 100644
--- a/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
+++ b/src/com/android/settings/applications/specialaccess/premiumsms/PremiumSmsAccess.java
@@ -18,6 +18,7 @@
import android.annotation.Nullable;
import android.app.Application;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
@@ -30,7 +31,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.telephony.SmsUsageMonitor;
import com.android.settings.R;
import com.android.settings.applications.AppStateBaseBridge.Callback;
@@ -99,7 +99,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.PREMIUM_SMS_ACCESS;
+ return SettingsEnums.PREMIUM_SMS_ACCESS;
}
@Override
@@ -116,13 +116,13 @@
int category = SmsUsageMonitor.PREMIUM_SMS_PERMISSION_UNKNOWN;
switch (smsState) {
case SmsUsageMonitor.PREMIUM_SMS_PERMISSION_ASK_USER:
- category = MetricsProto.MetricsEvent.APP_SPECIAL_PERMISSION_PREMIUM_SMS_ASK;
+ category = SettingsEnums.APP_SPECIAL_PERMISSION_PREMIUM_SMS_ASK;
break;
case SmsUsageMonitor.PREMIUM_SMS_PERMISSION_NEVER_ALLOW:
- category = MetricsProto.MetricsEvent.APP_SPECIAL_PERMISSION_PREMIUM_SMS_DENY;
+ category = SettingsEnums.APP_SPECIAL_PERMISSION_PREMIUM_SMS_DENY;
break;
case SmsUsageMonitor.PREMIUM_SMS_PERMISSION_ALWAYS_ALLOW:
- category = MetricsProto.MetricsEvent.
+ category = SettingsEnums.
APP_SPECIAL_PERMISSION_PREMIUM_SMS_ALWAYS_ALLOW;
break;
}
diff --git a/src/com/android/settings/applications/specialaccess/vrlistener/VrListenerSettings.java b/src/com/android/settings/applications/specialaccess/vrlistener/VrListenerSettings.java
index b0c745d..fec57c2 100644
--- a/src/com/android/settings/applications/specialaccess/vrlistener/VrListenerSettings.java
+++ b/src/com/android/settings/applications/specialaccess/vrlistener/VrListenerSettings.java
@@ -15,6 +15,7 @@
*/
package com.android.settings.applications.specialaccess.vrlistener;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.provider.SearchIndexableResource;
@@ -23,7 +24,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -56,7 +56,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.VR_MANAGE_LISTENERS;
+ return SettingsEnums.VR_MANAGE_LISTENERS;
}
@Override
@@ -72,8 +72,8 @@
@VisibleForTesting
void logSpecialPermissionChange(boolean enable, String packageName) {
- int logCategory = enable ? MetricsEvent.APP_SPECIAL_PERMISSION_VRHELPER_ALLOW
- : MetricsEvent.APP_SPECIAL_PERMISSION_VRHELPER_DENY;
+ int logCategory = enable ? SettingsEnums.APP_SPECIAL_PERMISSION_VRHELPER_ALLOW
+ : SettingsEnums.APP_SPECIAL_PERMISSION_VRHELPER_DENY;
final MetricsFeatureProvider metricsFeatureProvider =
FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider();
metricsFeatureProvider.action(
diff --git a/src/com/android/settings/backup/BackupSettingsFragment.java b/src/com/android/settings/backup/BackupSettingsFragment.java
index 4124fce..57c8d00 100644
--- a/src/com/android/settings/backup/BackupSettingsFragment.java
+++ b/src/com/android/settings/backup/BackupSettingsFragment.java
@@ -16,10 +16,10 @@
package com.android.settings.backup;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -76,6 +76,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.BACKUP_SETTINGS;
+ return SettingsEnums.BACKUP_SETTINGS;
}
}
diff --git a/src/com/android/settings/backup/PrivacySettings.java b/src/com/android/settings/backup/PrivacySettings.java
index 684956e..e6d2bd4 100644
--- a/src/com/android/settings/backup/PrivacySettings.java
+++ b/src/com/android/settings/backup/PrivacySettings.java
@@ -16,10 +16,10 @@
package com.android.settings.backup;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -34,7 +34,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.PRIVACY;
+ return SettingsEnums.PRIVACY;
}
@Override
diff --git a/src/com/android/settings/backup/ToggleBackupSettingFragment.java b/src/com/android/settings/backup/ToggleBackupSettingFragment.java
index 70ab68a..8b3a54a 100644
--- a/src/com/android/settings/backup/ToggleBackupSettingFragment.java
+++ b/src/com/android/settings/backup/ToggleBackupSettingFragment.java
@@ -2,6 +2,7 @@
import android.app.Dialog;
import android.app.backup.IBackupManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -17,7 +18,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
@@ -194,7 +194,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.PRIVACY;
+ return SettingsEnums.PRIVACY;
}
/**
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollEnrolling.java b/src/com/android/settings/biometrics/face/FaceEnrollEnrolling.java
index 2323afc..8ec64e5 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollEnrolling.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollEnrolling.java
@@ -16,6 +16,7 @@
package com.android.settings.biometrics.face;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.hardware.face.FaceManager;
import android.os.Bundle;
@@ -26,18 +27,17 @@
import android.view.animation.Interpolator;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.biometrics.BiometricEnrollBase;
import com.android.settings.biometrics.BiometricEnrollSidecar;
import com.android.settings.biometrics.BiometricErrorDialog;
import com.android.settings.biometrics.BiometricsEnrollEnrolling;
-import java.util.ArrayList;
-
import com.google.android.setupcompat.item.FooterButton;
import com.google.android.setupcompat.template.ButtonFooterMixin;
+import java.util.ArrayList;
+
public class FaceEnrollEnrolling extends BiometricsEnrollEnrolling {
private static final String TAG = "FaceEnrollEnrolling";
@@ -68,7 +68,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_FACE_ERROR;
+ return SettingsEnums.DIALOG_FACE_ERROR;
}
@Override
@@ -146,7 +146,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FACE_ENROLL_ENROLLING;
+ return SettingsEnums.FACE_ENROLL_ENROLLING;
}
@Override
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollFinish.java b/src/com/android/settings/biometrics/face/FaceEnrollFinish.java
index c347d0f..4db9a4e 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollFinish.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollFinish.java
@@ -16,10 +16,10 @@
package com.android.settings.biometrics.face;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.view.View;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.biometrics.BiometricEnrollBase;
@@ -50,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FACE_ENROLL_FINISHED;
+ return SettingsEnums.FACE_ENROLL_FINISHED;
}
@Override
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
index ba5a85e..fc4f6ce 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollIntroduction.java
@@ -17,6 +17,7 @@
package com.android.settings.biometrics.face;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Intent;
import android.hardware.face.FaceManager;
@@ -27,7 +28,6 @@
import android.widget.LinearLayout;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.biometrics.BiometricEnrollIntroduction;
@@ -179,7 +179,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FACE_ENROLL_INTRO;
+ return SettingsEnums.FACE_ENROLL_INTRO;
}
@Override
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollPreviewFragment.java b/src/com/android/settings/biometrics/face/FaceEnrollPreviewFragment.java
index a543584..8806712 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollPreviewFragment.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollPreviewFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.biometrics.face;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.hardware.camera2.CameraAccessException;
@@ -36,7 +37,6 @@
import android.view.View;
import android.widget.ImageView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.biometrics.BiometricEnrollSidecar;
import com.android.settings.core.InstrumentedPreferenceFragment;
@@ -180,7 +180,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FACE_ENROLL_PREVIEW;
+ return SettingsEnums.FACE_ENROLL_PREVIEW;
}
@Override
diff --git a/src/com/android/settings/biometrics/face/FaceEnrollSidecar.java b/src/com/android/settings/biometrics/face/FaceEnrollSidecar.java
index 7519530..c75f300 100644
--- a/src/com/android/settings/biometrics/face/FaceEnrollSidecar.java
+++ b/src/com/android/settings/biometrics/face/FaceEnrollSidecar.java
@@ -17,14 +17,13 @@
package com.android.settings.biometrics.face;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.hardware.face.FaceManager;
import android.os.UserHandle;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.Utils;
import com.android.settings.biometrics.BiometricEnrollSidecar;
-import java.util.ArrayList;
import java.util.Arrays;
/**
@@ -78,6 +77,6 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FACE_ENROLL_SIDECAR;
+ return SettingsEnums.FACE_ENROLL_SIDECAR;
}
}
diff --git a/src/com/android/settings/biometrics/face/FaceSettings.java b/src/com/android/settings/biometrics/face/FaceSettings.java
index ada39de..4e2c711 100644
--- a/src/com/android/settings/biometrics/face/FaceSettings.java
+++ b/src/com/android/settings/biometrics/face/FaceSettings.java
@@ -21,6 +21,7 @@
import static com.android.settings.biometrics.BiometricEnrollBase.CONFIRM_REQUEST;
import static com.android.settings.biometrics.BiometricEnrollBase.RESULT_FINISHED;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.hardware.face.FaceManager;
@@ -29,7 +30,6 @@
import android.provider.SearchIndexableResource;
import android.util.Log;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.dashboard.DashboardFragment;
@@ -68,7 +68,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FACE;
+ return SettingsEnums.FACE;
}
@Override
diff --git a/src/com/android/settings/biometrics/face/FaceSettingsAttentionPreferenceController.java b/src/com/android/settings/biometrics/face/FaceSettingsAttentionPreferenceController.java
index 2e32bf3..b910fe5 100644
--- a/src/com/android/settings/biometrics/face/FaceSettingsAttentionPreferenceController.java
+++ b/src/com/android/settings/biometrics/face/FaceSettingsAttentionPreferenceController.java
@@ -19,12 +19,12 @@
import android.content.Context;
import android.hardware.face.FaceManager;
-import com.android.settings.Utils;
-import com.android.settings.core.TogglePreferenceController;
-
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
+import com.android.settings.Utils;
+import com.android.settings.core.TogglePreferenceController;
+
/**
* Preference controller that manages the ability to use face authentication with/without
* user attention. See {@link FaceManager#setRequireAttention(boolean, byte[])}.
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintAuthenticateSidecar.java b/src/com/android/settings/biometrics/fingerprint/FingerprintAuthenticateSidecar.java
index 0b92326..f5aae12 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintAuthenticateSidecar.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintAuthenticateSidecar.java
@@ -16,11 +16,11 @@
package com.android.settings.biometrics.fingerprint;
+import android.app.settings.SettingsEnums;
import android.hardware.fingerprint.FingerprintManager;
import android.hardware.fingerprint.FingerprintManager.AuthenticationResult;
import android.os.CancellationSignal;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.InstrumentedFragment;
/**
@@ -55,7 +55,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_AUTHENTICATE_SIDECAR;
+ return SettingsEnums.FINGERPRINT_AUTHENTICATE_SIDECAR;
}
private FingerprintManager.AuthenticationCallback mAuthenticationCallback =
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
index 4c1ca62..3292b8d 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java
@@ -19,6 +19,7 @@
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Animatable2;
@@ -40,7 +41,6 @@
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.biometrics.BiometricEnrollSidecar;
import com.android.settings.biometrics.BiometricErrorDialog;
@@ -112,7 +112,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_FINGERPINT_ERROR;
+ return SettingsEnums.DIALOG_FINGERPINT_ERROR;
}
@Override
@@ -419,7 +419,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_ENROLLING;
+ return SettingsEnums.FINGERPRINT_ENROLLING;
}
public static class IconTouchDialog extends InstrumentedDialogFragment {
@@ -441,7 +441,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_FINGERPRINT_ICON_TOUCH;
+ return SettingsEnums.DIALOG_FINGERPRINT_ICON_TOUCH;
}
}
}
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java
index 72e115b..7ed8d7d 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java
@@ -16,6 +16,7 @@
package com.android.settings.biometrics.fingerprint;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Bundle;
@@ -23,12 +24,12 @@
import androidx.annotation.Nullable;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.biometrics.BiometricEnrollBase;
import com.android.settings.biometrics.BiometricEnrollSidecar.Listener;
import com.android.settings.password.ChooseLockSettingsHelper;
+
import com.google.android.setupcompat.item.FooterButton;
import com.google.android.setupcompat.template.ButtonFooterMixin;
@@ -190,6 +191,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_FIND_SENSOR;
+ return SettingsEnums.FINGERPRINT_FIND_SENSOR;
}
}
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFinish.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFinish.java
index 4cf3a46..61128a3 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFinish.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFinish.java
@@ -16,12 +16,12 @@
package com.android.settings.biometrics.fingerprint;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Bundle;
import android.view.View;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.biometrics.BiometricEnrollBase;
@@ -105,6 +105,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_ENROLL_FINISH;
+ return SettingsEnums.FINGERPRINT_ENROLL_FINISH;
}
}
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollIntroduction.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollIntroduction.java
index f603e24..2ad4ada 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollIntroduction.java
@@ -17,6 +17,7 @@
package com.android.settings.biometrics.fingerprint;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.hardware.fingerprint.FingerprintManager;
@@ -24,7 +25,6 @@
import android.util.Log;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.biometrics.BiometricEnrollIntroduction;
@@ -156,7 +156,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FINGERPRINT_ENROLL_INTRO;
+ return SettingsEnums.FINGERPRINT_ENROLL_INTRO;
}
@Override
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollSidecar.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollSidecar.java
index 27d71cd..b72a802 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollSidecar.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollSidecar.java
@@ -17,10 +17,10 @@
package com.android.settings.biometrics.fingerprint;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.hardware.fingerprint.FingerprintManager;
import android.os.UserHandle;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.Utils;
import com.android.settings.biometrics.BiometricEnrollSidecar;
@@ -68,6 +68,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_ENROLL_SIDECAR;
+ return SettingsEnums.FINGERPRINT_ENROLL_SIDECAR;
}
}
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintRemoveSidecar.java b/src/com/android/settings/biometrics/fingerprint/FingerprintRemoveSidecar.java
index 25cd2f5..19d0518 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintRemoveSidecar.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintRemoveSidecar.java
@@ -17,13 +17,13 @@
package com.android.settings.biometrics.fingerprint;
import android.annotation.Nullable;
+import android.app.settings.SettingsEnums;
import android.hardware.fingerprint.Fingerprint;
import android.hardware.fingerprint.FingerprintManager;
import android.os.Bundle;
import android.os.UserHandle;
import android.util.Log;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.InstrumentedFragment;
import java.util.LinkedList;
@@ -130,7 +130,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_REMOVE_SIDECAR;
+ return SettingsEnums.FINGERPRINT_REMOVE_SIDECAR;
}
}
diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
index 2e67ec3..4c7276d 100644
--- a/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
+++ b/src/com/android/settings/biometrics/fingerprint/FingerprintSettings.java
@@ -20,6 +20,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -33,8 +34,6 @@
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
-import android.view.WindowManager;
-import android.widget.EditText;
import android.widget.Toast;
import androidx.annotation.VisibleForTesting;
@@ -45,7 +44,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.SubSettings;
@@ -266,7 +264,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT;
+ return SettingsEnums.FINGERPRINT;
}
@Override
@@ -672,7 +670,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_FINGERPINT_EDIT;
+ return SettingsEnums.DIALOG_FINGERPINT_EDIT;
}
@Override
@@ -697,7 +695,7 @@
final int fingerprintId = mFp.getBiometricId();
Log.v(TAG, "Removing fpId=" + fingerprintId);
mMetricsFeatureProvider.action(getContext(),
- MetricsEvent.ACTION_FINGERPRINT_DELETE,
+ SettingsEnums.ACTION_FINGERPRINT_DELETE,
fingerprintId);
FingerprintSettingsFragment parent
= (FingerprintSettingsFragment) getTargetFragment();
@@ -744,7 +742,7 @@
if (!TextUtils.equals(newName, name)) {
Log.d(TAG, "rename " + name + " to " + newName);
mMetricsFeatureProvider.action(getContext(),
- MetricsEvent.ACTION_FINGERPRINT_RENAME,
+ SettingsEnums.ACTION_FINGERPRINT_RENAME,
mFp.getBiometricId());
FingerprintSettingsFragment parent
= (FingerprintSettingsFragment)
@@ -796,7 +794,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_FINGERPINT_EDIT;
+ return SettingsEnums.DIALOG_FINGERPINT_EDIT;
}
}
@@ -806,7 +804,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_FINGERPINT_DELETE_LAST;
+ return SettingsEnums.DIALOG_FINGERPINT_DELETE_LAST;
}
@Override
diff --git a/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollEnrolling.java b/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollEnrolling.java
index c2c4930..a86711d 100644
--- a/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollEnrolling.java
+++ b/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollEnrolling.java
@@ -16,9 +16,9 @@
package com.android.settings.biometrics.fingerprint;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.SetupWizardUtils;
public class SetupFingerprintEnrollEnrolling extends FingerprintEnrollEnrolling {
@@ -32,6 +32,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_ENROLLING_SETUP;
+ return SettingsEnums.FINGERPRINT_ENROLLING_SETUP;
}
}
diff --git a/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFindSensor.java b/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFindSensor.java
index 5f1a240..8097adc 100644
--- a/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFindSensor.java
+++ b/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFindSensor.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
@@ -28,8 +29,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -60,7 +59,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_FIND_SENSOR_SETUP;
+ return SettingsEnums.FINGERPRINT_FIND_SENSOR_SETUP;
}
public static class SkipFingerprintDialog extends InstrumentedDialogFragment
@@ -69,7 +68,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_FINGERPRINT_SKIP_SETUP;
+ return SettingsEnums.DIALOG_FINGERPRINT_SKIP_SETUP;
}
@Override
diff --git a/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFinish.java b/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFinish.java
index 6afbb84..24a0069 100644
--- a/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFinish.java
+++ b/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollFinish.java
@@ -16,11 +16,10 @@
package com.android.settings.biometrics.fingerprint;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.UserHandle;
-import android.widget.Button;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.android.settings.password.ChooseLockSettingsHelper;
@@ -49,6 +48,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_ENROLL_FINISH_SETUP;
+ return SettingsEnums.FINGERPRINT_ENROLL_FINISH_SETUP;
}
}
diff --git a/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollIntroduction.java b/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollIntroduction.java
index a74bbba..6a92eba 100644
--- a/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/fingerprint/SetupFingerprintEnrollIntroduction.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.KeyguardManager;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.Bundle;
import android.os.UserHandle;
@@ -26,7 +27,6 @@
import android.view.View;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
@@ -148,6 +148,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FINGERPRINT_ENROLL_INTRO_SETUP;
+ return SettingsEnums.FINGERPRINT_ENROLL_INTRO_SETUP;
}
}
diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsHeaderController.java b/src/com/android/settings/bluetooth/BluetoothDetailsHeaderController.java
index 18aeaa0..a41b791 100644
--- a/src/com/android/settings/bluetooth/BluetoothDetailsHeaderController.java
+++ b/src/com/android/settings/bluetooth/BluetoothDetailsHeaderController.java
@@ -20,7 +20,6 @@
import android.graphics.drawable.Drawable;
import android.util.Pair;
-import androidx.annotation.VisibleForTesting;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceScreen;
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
index b2f917b..c3d49e9 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceDetailsFragment.java
@@ -18,17 +18,17 @@
import static android.os.UserManager.DISALLOW_CONFIG_BLUETOOTH;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.os.Bundle;
import android.util.FeatureFlagUtils;
-
-import androidx.annotation.VisibleForTesting;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
-import com.android.internal.logging.nano.MetricsProto;
+import androidx.annotation.VisibleForTesting;
+
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
import com.android.settings.dashboard.RestrictedDashboardFragment;
@@ -119,7 +119,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.BLUETOOTH_DEVICE_DETAILS;
+ return SettingsEnums.BLUETOOTH_DEVICE_DETAILS;
}
@Override
diff --git a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
index 5f71948..d4c0ed0 100644
--- a/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
+++ b/src/com/android/settings/bluetooth/BluetoothDevicePreference.java
@@ -18,6 +18,7 @@
import static android.os.UserManager.DISALLOW_CONFIG_BLUETOOTH;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.DialogInterface;
@@ -34,7 +35,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.widget.GearPreference;
@@ -203,18 +203,18 @@
if (mCachedDevice.isConnected()) {
metricsFeatureProvider.action(context,
- MetricsEvent.ACTION_SETTINGS_BLUETOOTH_DISCONNECT);
+ SettingsEnums.ACTION_SETTINGS_BLUETOOTH_DISCONNECT);
askDisconnect();
} else if (bondState == BluetoothDevice.BOND_BONDED) {
metricsFeatureProvider.action(context,
- MetricsEvent.ACTION_SETTINGS_BLUETOOTH_CONNECT);
+ SettingsEnums.ACTION_SETTINGS_BLUETOOTH_CONNECT);
mCachedDevice.connect(true);
} else if (bondState == BluetoothDevice.BOND_NONE) {
metricsFeatureProvider.action(context,
- MetricsEvent.ACTION_SETTINGS_BLUETOOTH_PAIR);
+ SettingsEnums.ACTION_SETTINGS_BLUETOOTH_PAIR);
if (!mCachedDevice.hasHumanReadableName()) {
metricsFeatureProvider.action(context,
- MetricsEvent.ACTION_SETTINGS_BLUETOOTH_PAIR_DEVICES_WITHOUT_NAMES);
+ SettingsEnums.ACTION_SETTINGS_BLUETOOTH_PAIR_DEVICES_WITHOUT_NAMES);
}
pair();
}
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceController.java b/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceController.java
index 1d782b1..1c75669 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceController.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceRenamePreferenceController.java
@@ -16,6 +16,7 @@
package com.android.settings.bluetooth;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.text.TextUtils;
@@ -23,7 +24,6 @@
import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -65,7 +65,7 @@
public boolean handlePreferenceTreeClick(Preference preference) {
if (TextUtils.equals(getPreferenceKey(), preference.getKey()) && mFragment != null) {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_BLUETOOTH_RENAME);
+ SettingsEnums.ACTION_BLUETOOTH_RENAME);
LocalDeviceNameDialogFragment.newInstance()
.show(mFragment.getFragmentManager(), LocalDeviceNameDialogFragment.TAG);
return true;
diff --git a/src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java b/src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java
index 2ea3371..2128b2f 100644
--- a/src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java
+++ b/src/com/android/settings/bluetooth/BluetoothDeviceUpdater.java
@@ -19,7 +19,6 @@
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.os.Bundle;
-import android.os.SystemProperties;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
diff --git a/src/com/android/settings/bluetooth/BluetoothFilesPreferenceController.java b/src/com/android/settings/bluetooth/BluetoothFilesPreferenceController.java
index 3f566f0..e96fba3 100644
--- a/src/com/android/settings/bluetooth/BluetoothFilesPreferenceController.java
+++ b/src/com/android/settings/bluetooth/BluetoothFilesPreferenceController.java
@@ -16,6 +16,7 @@
package com.android.settings.bluetooth;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -23,7 +24,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.overlay.FeatureFactory;
@@ -69,7 +69,7 @@
public boolean handlePreferenceTreeClick(Preference preference) {
if (KEY_RECEIVED_FILES.equals(preference.getKey())) {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_BLUETOOTH_FILES);
+ SettingsEnums.ACTION_BLUETOOTH_FILES);
Intent intent = new Intent(ACTION_OPEN_FILES);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.putExtra(EXTRA_DIRECTION, 1 /* DIRECTION_INBOUND */);
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDetail.java b/src/com/android/settings/bluetooth/BluetoothPairingDetail.java
index 688ac00..b1a3174 100644
--- a/src/com/android/settings/bluetooth/BluetoothPairingDetail.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDetail.java
@@ -18,6 +18,7 @@
import static android.os.UserManager.DISALLOW_CONFIG_BLUETOOTH;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
@@ -27,7 +28,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.Indexable;
import com.android.settingslib.bluetooth.BluetoothDeviceFilter;
@@ -114,7 +114,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.BLUETOOTH_PAIRING;
+ return SettingsEnums.BLUETOOTH_PAIRING;
}
@Override
diff --git a/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java b/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java
index f8a2bbe..d38302d 100644
--- a/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java
+++ b/src/com/android/settings/bluetooth/BluetoothPairingDialogFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.bluetooth;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@@ -37,7 +38,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -113,7 +113,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.BLUETOOTH_DIALOG_FRAGMENT;
+ return SettingsEnums.BLUETOOTH_DIALOG_FRAGMENT;
}
/**
diff --git a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java
index 19339cd..4dd9a40 100644
--- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java
+++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java
@@ -33,9 +33,6 @@
import com.android.internal.app.AlertActivity;
import com.android.internal.app.AlertController;
import com.android.settings.R;
-import com.android.settingslib.bluetooth.CachedBluetoothDevice;
-import com.android.settingslib.bluetooth.CachedBluetoothDeviceManager;
-import com.android.settingslib.bluetooth.LocalBluetoothManager;
/**
* BluetoothPermissionActivity shows a dialog for accepting incoming
diff --git a/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java b/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java
index 67e8b19..59b8007 100644
--- a/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java
+++ b/src/com/android/settings/bluetooth/BluetoothSliceBuilder.java
@@ -19,6 +19,7 @@
import android.annotation.ColorInt;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;
@@ -32,7 +33,6 @@
import androidx.slice.builders.ListBuilder.RowBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.connecteddevice.BluetoothDashboardFragment;
@@ -98,7 +98,7 @@
SettingsSlicesContract.KEY_BLUETOOTH).build();
return SliceBuilderUtils.buildSearchResultPageIntent(context,
BluetoothDashboardFragment.class.getName(), null /* key */, screenTitle,
- MetricsProto.MetricsEvent.SETTINGS_CONNECTED_DEVICE_CATEGORY)
+ SettingsEnums.SETTINGS_CONNECTED_DEVICE_CATEGORY)
.setClassName(context.getPackageName(), SubSettings.class.getName())
.setData(contentUri);
}
diff --git a/src/com/android/settings/bluetooth/BluetoothSwitchPreferenceController.java b/src/com/android/settings/bluetooth/BluetoothSwitchPreferenceController.java
index e0aa9e9..48376a7 100644
--- a/src/com/android/settings/bluetooth/BluetoothSwitchPreferenceController.java
+++ b/src/com/android/settings/bluetooth/BluetoothSwitchPreferenceController.java
@@ -15,13 +15,12 @@
*/
package com.android.settings.bluetooth;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.view.View;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.location.ScanningSettings;
@@ -67,7 +66,7 @@
mBluetoothEnabler = new BluetoothEnabler(context,
switchController,
FeatureFactory.getFactory(context).getMetricsFeatureProvider(),
- MetricsEvent.ACTION_SETTINGS_MASTER_SWITCH_BLUETOOTH_TOGGLE,
+ SettingsEnums.ACTION_SETTINGS_MASTER_SWITCH_BLUETOOTH_TOGGLE,
mRestrictionUtils);
mBluetoothEnabler.setToggleCallback(this);
}
@@ -96,7 +95,7 @@
// send users to scanning settings if they click on the link in the summary text
new SubSettingLauncher(mContext)
.setDestination(ScanningSettings.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.BLUETOOTH_FRAGMENT)
+ .setSourceMetricsCategory(SettingsEnums.BLUETOOTH_FRAGMENT)
.launch();
}
diff --git a/src/com/android/settings/bluetooth/DevicePickerFragment.java b/src/com/android/settings/bluetooth/DevicePickerFragment.java
index 38936f5..207b375 100644
--- a/src/com/android/settings/bluetooth/DevicePickerFragment.java
+++ b/src/com/android/settings/bluetooth/DevicePickerFragment.java
@@ -18,6 +18,7 @@
import static android.os.UserManager.DISALLOW_CONFIG_BLUETOOTH;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothDevicePicker;
@@ -30,7 +31,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -75,7 +75,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.BLUETOOTH_DEVICE_PICKER;
+ return SettingsEnums.BLUETOOTH_DEVICE_PICKER;
}
@Override
diff --git a/src/com/android/settings/bluetooth/ForgetDeviceDialogFragment.java b/src/com/android/settings/bluetooth/ForgetDeviceDialogFragment.java
index 33e2ab3..db6b832 100644
--- a/src/com/android/settings/bluetooth/ForgetDeviceDialogFragment.java
+++ b/src/com/android/settings/bluetooth/ForgetDeviceDialogFragment.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.DialogInterface;
@@ -26,7 +27,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
@@ -58,7 +58,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_BLUETOOTH_PAIRED_DEVICE_FORGET;
+ return SettingsEnums.DIALOG_BLUETOOTH_PAIRED_DEVICE_FORGET;
}
@Override
diff --git a/src/com/android/settings/bluetooth/LocalDeviceNameDialogFragment.java b/src/com/android/settings/bluetooth/LocalDeviceNameDialogFragment.java
index 4cbcce8..5cf2ccc 100644
--- a/src/com/android/settings/bluetooth/LocalDeviceNameDialogFragment.java
+++ b/src/com/android/settings/bluetooth/LocalDeviceNameDialogFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.bluetooth;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -23,7 +24,6 @@
import android.content.IntentFilter;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
/** Provides a dialog for changing the advertised name of the local bluetooth adapter. */
@@ -71,7 +71,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_BLUETOOTH_RENAME;
+ return SettingsEnums.DIALOG_BLUETOOTH_RENAME;
}
@Override
diff --git a/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragment.java b/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragment.java
index 7894ed6..2ba94a1 100644
--- a/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragment.java
+++ b/src/com/android/settings/bluetooth/RemoteDeviceNameDialogFragment.java
@@ -16,13 +16,13 @@
package com.android.settings.bluetooth;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.os.Bundle;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.LocalBluetoothManager;
@@ -58,7 +58,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_BLUETOOTH_PAIRED_DEVICE_RENAME;
+ return SettingsEnums.DIALOG_BLUETOOTH_PAIRED_DEVICE_RENAME;
}
@Override
diff --git a/src/com/android/settings/bluetooth/Utils.java b/src/com/android/settings/bluetooth/Utils.java
index fd6bbc3..d6e395e 100755
--- a/src/com/android/settings/bluetooth/Utils.java
+++ b/src/com/android/settings/bluetooth/Utils.java
@@ -16,6 +16,7 @@
package com.android.settings.bluetooth;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
@@ -27,7 +28,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.bluetooth.BluetoothUtils;
@@ -90,15 +90,10 @@
return dialog;
}
- // TODO: wire this up to show connection errors...
- static void showConnectingError(Context context, String name) {
- showConnectingError(context, name, getLocalBtManager(context));
- }
-
@VisibleForTesting
static void showConnectingError(Context context, String name, LocalBluetoothManager manager) {
FeatureFactory.getFactory(context).getMetricsFeatureProvider().visible(context,
- MetricsEvent.VIEW_UNKNOWN, MetricsEvent.ACTION_SETTINGS_BLUETOOTH_CONNECT_ERROR);
+ SettingsEnums.PAGE_UNKNOWN, SettingsEnums.ACTION_SETTINGS_BLUETOOTH_CONNECT_ERROR);
showError(context, name, R.string.bluetooth_connecting_error_message, manager);
}
diff --git a/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java b/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
index 54842f7..0d130d9 100644
--- a/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/AdvancedConnectedDeviceDashboardFragment.java
@@ -15,11 +15,11 @@
*/
package com.android.settings.connecteddevice;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.PackageManager;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.bluetooth.BluetoothFilesPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
@@ -46,7 +46,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.CONNECTION_DEVICE_ADVANCED;
+ return SettingsEnums.CONNECTION_DEVICE_ADVANCED;
}
@Override
diff --git a/src/com/android/settings/connecteddevice/BluetoothDashboardFragment.java b/src/com/android/settings/connecteddevice/BluetoothDashboardFragment.java
index b5a9ffb..ecbda15 100644
--- a/src/com/android/settings/connecteddevice/BluetoothDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/BluetoothDashboardFragment.java
@@ -15,12 +15,12 @@
*/
package com.android.settings.connecteddevice;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.bluetooth.BluetoothDeviceRenamePreferenceController;
@@ -54,7 +54,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.BLUETOOTH_FRAGMENT;
+ return SettingsEnums.BLUETOOTH_FRAGMENT;
}
@Override
diff --git a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
index 223b78f..b84cc26 100644
--- a/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/ConnectedDeviceDashboardFragment.java
@@ -15,12 +15,12 @@
*/
package com.android.settings.connecteddevice;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -44,7 +44,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_CONNECTED_DEVICE_CATEGORY;
+ return SettingsEnums.SETTINGS_CONNECTED_DEVICE_CATEGORY;
}
@Override
diff --git a/src/com/android/settings/connecteddevice/PreviouslyConnectedDeviceDashboardFragment.java b/src/com/android/settings/connecteddevice/PreviouslyConnectedDeviceDashboardFragment.java
index c543b7a..709e1dc 100644
--- a/src/com/android/settings/connecteddevice/PreviouslyConnectedDeviceDashboardFragment.java
+++ b/src/com/android/settings/connecteddevice/PreviouslyConnectedDeviceDashboardFragment.java
@@ -15,10 +15,10 @@
*/
package com.android.settings.connecteddevice;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.res.Resources;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -54,7 +54,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.PREVIOUSLY_CONNECTED_DEVICES;
+ return SettingsEnums.PREVIOUSLY_CONNECTED_DEVICES;
}
@Override
diff --git a/src/com/android/settings/connecteddevice/TopLevelConnectedDevicesPreferenceController.java b/src/com/android/settings/connecteddevice/TopLevelConnectedDevicesPreferenceController.java
index 4b2bdc0..2102283 100644
--- a/src/com/android/settings/connecteddevice/TopLevelConnectedDevicesPreferenceController.java
+++ b/src/com/android/settings/connecteddevice/TopLevelConnectedDevicesPreferenceController.java
@@ -18,8 +18,8 @@
import android.content.Context;
-import com.android.settings.core.BasePreferenceController;
import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
public class TopLevelConnectedDevicesPreferenceController extends BasePreferenceController {
diff --git a/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java b/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java
index beb2375..695a714 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java
@@ -20,7 +20,6 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.usb.UsbManager;
-import android.hardware.usb.UsbPort;
import android.hardware.usb.UsbPortStatus;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java b/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
index 5057abe..4c00c3e 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDefaultFragment.java
@@ -18,16 +18,15 @@
import static android.net.ConnectivityManager.TETHERING_USB;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.hardware.usb.UsbManager;
import android.net.ConnectivityManager;
import android.os.Bundle;
-import android.util.Log;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.widget.RadioButtonPickerFragment;
@@ -70,7 +69,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.USB_DEFAULT;
+ return SettingsEnums.USB_DEFAULT;
}
@Override
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDetailsDataRoleController.java b/src/com/android/settings/connecteddevice/usb/UsbDetailsDataRoleController.java
index a584c11..01977d8 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDetailsDataRoleController.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDetailsDataRoleController.java
@@ -21,7 +21,6 @@
import static android.hardware.usb.UsbPortStatus.DATA_ROLE_NONE;
import android.content.Context;
-import android.hardware.usb.UsbPort;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java b/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
index 936a4c0..6d8de6d 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDetailsFragment.java
@@ -16,12 +16,12 @@
package com.android.settings.connecteddevice.usb;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -56,7 +56,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.USB_DEVICE_DETAILS;
+ return SettingsEnums.USB_DEVICE_DETAILS;
}
@Override
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java b/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
index 283e56b..77ae13f 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDetailsFunctionsController.java
@@ -21,7 +21,6 @@
import android.content.Context;
import android.hardware.usb.UsbManager;
-import android.hardware.usb.UsbPort;
import android.net.ConnectivityManager;
import androidx.annotation.VisibleForTesting;
diff --git a/src/com/android/settings/connecteddevice/usb/UsbDetailsPowerRoleController.java b/src/com/android/settings/connecteddevice/usb/UsbDetailsPowerRoleController.java
index b59890a..42c5bae 100644
--- a/src/com/android/settings/connecteddevice/usb/UsbDetailsPowerRoleController.java
+++ b/src/com/android/settings/connecteddevice/usb/UsbDetailsPowerRoleController.java
@@ -21,8 +21,6 @@
import static android.hardware.usb.UsbPortStatus.POWER_ROLE_SOURCE;
import android.content.Context;
-import android.hardware.usb.UsbPort;
-import android.hardware.usb.UsbPortStatus;
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceClickListener;
diff --git a/src/com/android/settings/core/instrumentation/StatsLogWriter.java b/src/com/android/settings/core/instrumentation/StatsLogWriter.java
index b6644c6..bcdecf3 100644
--- a/src/com/android/settings/core/instrumentation/StatsLogWriter.java
+++ b/src/com/android/settings/core/instrumentation/StatsLogWriter.java
@@ -18,8 +18,8 @@
import android.app.settings.SettingsEnums;
import android.content.Context;
-import android.util.StatsLog;
import android.util.Pair;
+import android.util.StatsLog;
import com.android.settingslib.core.instrumentation.LogWriter;
diff --git a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
index 2a6bb38..f79cf5b 100644
--- a/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
+++ b/src/com/android/settings/dashboard/DashboardFeatureProviderImpl.java
@@ -20,6 +20,7 @@
import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_SUMMARY;
import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_SUMMARY_URI;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.IContentProvider;
@@ -38,7 +39,6 @@
import androidx.fragment.app.FragmentActivity;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.dashboard.profileselector.ProfileSelectDialog;
@@ -160,9 +160,9 @@
}
final Intent intent = new Intent(tile.getIntent())
.putExtra(MetricsFeatureProvider.EXTRA_SOURCE_METRICS_CATEGORY,
- MetricsEvent.DASHBOARD_SUMMARY)
+ SettingsEnums.DASHBOARD_SUMMARY)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
- launchIntentOrSelectProfile(activity, tile, intent, MetricsEvent.DASHBOARD_SUMMARY);
+ launchIntentOrSelectProfile(activity, tile, intent, SettingsEnums.DASHBOARD_SUMMARY);
}
private void bindSummary(Preference preference, Tile tile) {
diff --git a/src/com/android/settings/dashboard/DashboardFragment.java b/src/com/android/settings/dashboard/DashboardFragment.java
index e2c013d..dde98ce 100644
--- a/src/com/android/settings/dashboard/DashboardFragment.java
+++ b/src/com/android/settings/dashboard/DashboardFragment.java
@@ -32,7 +32,6 @@
import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.PreferenceControllerListHelper;
@@ -235,7 +234,7 @@
@Override
public void onExpandButtonClick() {
mMetricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsEvent.ACTION_SETTINGS_ADVANCED_BUTTON_EXPAND,
+ SettingsEnums.ACTION_SETTINGS_ADVANCED_BUTTON_EXPAND,
getMetricsCategory(), null, 0);
}
diff --git a/src/com/android/settings/datausage/AppDataUsage.java b/src/com/android/settings/datausage/AppDataUsage.java
index b6c95dd..329bf68 100644
--- a/src/com/android/settings/datausage/AppDataUsage.java
+++ b/src/com/android/settings/datausage/AppDataUsage.java
@@ -17,6 +17,7 @@
import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -38,7 +39,6 @@
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.AppInfoBase;
import com.android.settings.widget.EntityHeaderController;
@@ -348,7 +348,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APP_DATA_USAGE;
+ return SettingsEnums.APP_DATA_USAGE;
}
private AdapterView.OnItemSelectedListener mCycleListener =
diff --git a/src/com/android/settings/datausage/BillingCyclePreference.java b/src/com/android/settings/datausage/BillingCyclePreference.java
index b30f32e..23c577c 100644
--- a/src/com/android/settings/datausage/BillingCyclePreference.java
+++ b/src/com/android/settings/datausage/BillingCyclePreference.java
@@ -14,6 +14,7 @@
package com.android.settings.datausage;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.NetworkTemplate;
@@ -23,7 +24,6 @@
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.datausage.CellDataPreference.DataStateListener;
@@ -79,7 +79,7 @@
.setDestination(BillingCycleSettings.class.getName())
.setArguments(args)
.setTitleRes(R.string.billing_cycle)
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.VIEW_UNKNOWN)
+ .setSourceMetricsCategory(SettingsEnums.PAGE_UNKNOWN)
.toIntent();
}
diff --git a/src/com/android/settings/datausage/BillingCycleSettings.java b/src/com/android/settings/datausage/BillingCycleSettings.java
index 45997f8..87b8198 100644
--- a/src/com/android/settings/datausage/BillingCycleSettings.java
+++ b/src/com/android/settings/datausage/BillingCycleSettings.java
@@ -18,6 +18,7 @@
import static android.net.NetworkPolicy.WARNING_DISABLED;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Resources;
@@ -39,7 +40,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -193,7 +193,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.BILLING_CYCLE;
+ return SettingsEnums.BILLING_CYCLE;
}
@Override
@@ -340,7 +340,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_BILLING_BYTE_LIMIT;
+ return SettingsEnums.DIALOG_BILLING_BYTE_LIMIT;
}
}
@@ -366,7 +366,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_BILLING_CYCLE;
+ return SettingsEnums.DIALOG_BILLING_CYCLE;
}
@Override
@@ -446,7 +446,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_BILLING_CONFIRM_LIMIT;
+ return SettingsEnums.DIALOG_BILLING_CONFIRM_LIMIT;
}
@Override
diff --git a/src/com/android/settings/datausage/CellDataPreference.java b/src/com/android/settings/datausage/CellDataPreference.java
index 48e4089..af7e16e 100644
--- a/src/com/android/settings/datausage/CellDataPreference.java
+++ b/src/com/android/settings/datausage/CellDataPreference.java
@@ -14,6 +14,7 @@
package com.android.settings.datausage;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.database.ContentObserver;
@@ -37,7 +38,6 @@
import androidx.core.content.res.TypedArrayUtils;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.overlay.FeatureFactory;
@@ -136,7 +136,7 @@
protected void performClick(View view) {
final Context context = getContext();
FeatureFactory.getFactory(context).getMetricsFeatureProvider()
- .action(context, MetricsEvent.ACTION_CELL_DATA_TOGGLE, !mChecked);
+ .action(context, SettingsEnums.ACTION_CELL_DATA_TOGGLE, !mChecked);
final SubscriptionInfo currentSir = mSubscriptionManager.getActiveSubscriptionInfo(
mSubId);
final SubscriptionInfo nextSir = mSubscriptionManager.getDefaultDataSubscriptionInfo();
@@ -232,7 +232,8 @@
}
private void disableDataForOtherSubscriptions(int subId) {
- List<SubscriptionInfo> subInfoList = mSubscriptionManager.getActiveSubscriptionInfoList();
+ List<SubscriptionInfo> subInfoList = mSubscriptionManager
+ .getActiveSubscriptionInfoList(true);
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
if (subInfo.getSubscriptionId() != subId) {
diff --git a/src/com/android/settings/datausage/DataSaverBackend.java b/src/com/android/settings/datausage/DataSaverBackend.java
index ed2e6c9..de28b07 100644
--- a/src/com/android/settings/datausage/DataSaverBackend.java
+++ b/src/com/android/settings/datausage/DataSaverBackend.java
@@ -18,13 +18,13 @@
import static android.net.NetworkPolicyManager.POLICY_NONE;
import static android.net.NetworkPolicyManager.POLICY_REJECT_METERED_BACKGROUND;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.net.INetworkPolicyListener;
import android.net.NetworkPolicyManager;
import android.os.RemoteException;
import android.util.SparseIntArray;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.utils.ThreadUtils;
@@ -73,7 +73,7 @@
public void setDataSaverEnabled(boolean enabled) {
mPolicyManager.setRestrictBackground(enabled);
mMetricsFeatureProvider.action(
- mContext, MetricsEvent.ACTION_DATA_SAVER_MODE, enabled ? 1 : 0);
+ mContext, SettingsEnums.ACTION_DATA_SAVER_MODE, enabled ? 1 : 0);
}
public void refreshWhitelist() {
@@ -86,7 +86,7 @@
mUidPolicies.put(uid, policy);
if (whitelisted) {
mMetricsFeatureProvider.action(
- mContext, MetricsEvent.ACTION_DATA_SAVER_WHITELIST, packageName);
+ mContext, SettingsEnums.ACTION_DATA_SAVER_WHITELIST, packageName);
}
}
@@ -116,7 +116,7 @@
mUidPolicies.put(uid, policy);
if (blacklisted) {
mMetricsFeatureProvider.action(
- mContext, MetricsEvent.ACTION_DATA_SAVER_BLACKLIST, packageName);
+ mContext, SettingsEnums.ACTION_DATA_SAVER_BLACKLIST, packageName);
}
}
diff --git a/src/com/android/settings/datausage/DataSaverSummary.java b/src/com/android/settings/datausage/DataSaverSummary.java
index f401342..1ab8c79 100644
--- a/src/com/android/settings/datausage/DataSaverSummary.java
+++ b/src/com/android/settings/datausage/DataSaverSummary.java
@@ -15,6 +15,7 @@
package com.android.settings.datausage;
import android.app.Application;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
@@ -23,7 +24,6 @@
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
@@ -113,7 +113,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DATA_SAVER_SUMMARY;
+ return SettingsEnums.DATA_SAVER_SUMMARY;
}
@Override
diff --git a/src/com/android/settings/datausage/DataUsageList.java b/src/com/android/settings/datausage/DataUsageList.java
index 3369e5e..aa66197 100644
--- a/src/com/android/settings/datausage/DataUsageList.java
+++ b/src/com/android/settings/datausage/DataUsageList.java
@@ -22,6 +22,7 @@
import android.app.Activity;
import android.app.ActivityManager;
+import android.app.settings.SettingsEnums;
import android.app.usage.NetworkStats;
import android.app.usage.NetworkStats.Bucket;
import android.content.Context;
@@ -31,16 +32,13 @@
import android.net.ConnectivityManager;
import android.net.NetworkPolicy;
import android.net.NetworkTemplate;
-import android.os.AsyncTask;
import android.os.Bundle;
-import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
-import android.text.format.DateUtils;
import android.util.Log;
import android.util.SparseArray;
import android.view.View;
@@ -55,14 +53,13 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceGroup;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.datausage.CycleAdapter.SpinnerInterface;
import com.android.settings.widget.LoadingViewController;
import com.android.settingslib.AppItem;
-import com.android.settingslib.net.NetworkCycleChartDataLoader;
import com.android.settingslib.net.NetworkCycleChartData;
+import com.android.settingslib.net.NetworkCycleChartDataLoader;
import com.android.settingslib.net.NetworkStatsSummaryLoader;
import com.android.settingslib.net.UidDetailProvider;
@@ -122,7 +119,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DATA_USAGE_LIST;
+ return SettingsEnums.DATA_USAGE_LIST;
}
@Override
diff --git a/src/com/android/settings/datausage/DataUsagePreference.java b/src/com/android/settings/datausage/DataUsagePreference.java
index 21c0503..644ea9b 100644
--- a/src/com/android/settings/datausage/DataUsagePreference.java
+++ b/src/com/android/settings/datausage/DataUsagePreference.java
@@ -14,6 +14,7 @@
package com.android.settings.datausage;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
@@ -26,7 +27,6 @@
import androidx.core.content.res.TypedArrayUtils;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settingslib.net.DataUsageController;
@@ -83,7 +83,7 @@
launcher = new SubSettingLauncher(getContext())
.setArguments(args)
.setDestination(DataUsageList.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.VIEW_UNKNOWN);
+ .setSourceMetricsCategory(SettingsEnums.PAGE_UNKNOWN);
if (mTemplate.isMatchRuleMobile()) {
launcher.setTitleRes(R.string.app_cellular_data_usage);
} else {
diff --git a/src/com/android/settings/datausage/DataUsageSummary.java b/src/com/android/settings/datausage/DataUsageSummary.java
index 97715db..3661410 100644
--- a/src/com/android/settings/datausage/DataUsageSummary.java
+++ b/src/com/android/settings/datausage/DataUsageSummary.java
@@ -15,6 +15,7 @@
package com.android.settings.datausage;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.net.NetworkTemplate;
import android.os.Bundle;
@@ -33,7 +34,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.dashboard.SummaryLoader;
@@ -141,7 +141,8 @@
final Activity activity = getActivity();
final ArrayList<AbstractPreferenceController> controllers = new ArrayList<>();
mSummaryController =
- new DataUsageSummaryPreferenceController(activity, getSettingsLifecycle(), this);
+ new DataUsageSummaryPreferenceController(activity, getSettingsLifecycle(), this,
+ DataUsageUtils.getDefaultSubscriptionId(activity));
controllers.add(mSummaryController);
getSettingsLifecycle().addObserver(mSummaryController);
return controllers;
@@ -242,7 +243,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DATA_USAGE_SUMMARY;
+ return SettingsEnums.DATA_USAGE_SUMMARY;
}
@Override
diff --git a/src/com/android/settings/datausage/DataUsageSummaryPreference.java b/src/com/android/settings/datausage/DataUsageSummaryPreference.java
index 92d3e29..3cbe1ea 100644
--- a/src/com/android/settings/datausage/DataUsageSummaryPreference.java
+++ b/src/com/android/settings/datausage/DataUsageSummaryPreference.java
@@ -17,6 +17,7 @@
package com.android.settings.datausage;
import android.annotation.AttrRes;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
@@ -37,7 +38,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settingslib.Utils;
@@ -213,7 +213,7 @@
final SubSettingLauncher launcher = new SubSettingLauncher(context)
.setArguments(args)
.setDestination(DataUsageList.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.VIEW_UNKNOWN);
+ .setSourceMetricsCategory(SettingsEnums.PAGE_UNKNOWN);
launcher.setTitleRes(R.string.wifi_data_usage);
launcher.launch();
}
diff --git a/src/com/android/settings/datausage/DataUsageSummaryPreferenceController.java b/src/com/android/settings/datausage/DataUsageSummaryPreferenceController.java
index d5707c4..353c5ee 100644
--- a/src/com/android/settings/datausage/DataUsageSummaryPreferenceController.java
+++ b/src/com/android/settings/datausage/DataUsageSummaryPreferenceController.java
@@ -31,6 +31,7 @@
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
+import androidx.preference.PreferenceFragmentCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.android.internal.util.CollectionUtils;
@@ -47,9 +48,9 @@
import java.util.List;
/**
- * This is the controller for the top of the data usage screen that retrieves carrier data from the
- * new subscriptions framework API if available. The controller reads subscription information from
- * the framework and falls back to legacy usage data if none are available.
+ * This is the controller for a data usage header that retrieves carrier data from the new
+ * subscriptions framework API if available. The controller reads subscription information from the
+ * framework and falls back to legacy usage data if none are available.
*/
public class DataUsageSummaryPreferenceController extends BasePreferenceController
implements PreferenceControllerMixin, LifecycleObserver, OnStart {
@@ -63,7 +64,7 @@
private final Activity mActivity;
private final EntityHeaderController mEntityHeaderController;
private final Lifecycle mLifecycle;
- private final DataUsageSummary mDataUsageSummary;
+ private final PreferenceFragmentCompat mFragment;
private final DataUsageController mDataUsageController;
private final DataUsageInfoController mDataInfoController;
private final NetworkTemplate mDefaultTemplate;
@@ -94,28 +95,31 @@
private long mCycleStart;
/** The ending time of the billing cycle in ms since the epoch */
private long mCycleEnd;
+ /** The subscription that we should show usage for. */
+ private int mSubscriptionId;
private Intent mManageSubscriptionIntent;
public DataUsageSummaryPreferenceController(Activity activity,
- Lifecycle lifecycle, DataUsageSummary dataUsageSummary) {
+ Lifecycle lifecycle, PreferenceFragmentCompat fragment, int subscriptionId) {
super(activity, KEY);
mActivity = activity;
mEntityHeaderController = EntityHeaderController.newInstance(activity,
- dataUsageSummary, null);
+ fragment, null);
mLifecycle = lifecycle;
- mDataUsageSummary = dataUsageSummary;
+ mFragment = fragment;
+ mSubscriptionId = subscriptionId;
- final int defaultSubId = DataUsageUtils.getDefaultSubscriptionId(activity);
- mDefaultTemplate = DataUsageUtils.getDefaultTemplate(activity, defaultSubId);
- NetworkPolicyManager policyManager = NetworkPolicyManager.from(activity);
+ mDefaultTemplate = DataUsageUtils.getDefaultTemplate(activity, mSubscriptionId);
+ NetworkPolicyManager policyManager = activity.getSystemService(NetworkPolicyManager.class);
mPolicyEditor = new NetworkPolicyEditor(policyManager);
mHasMobileData = DataUsageUtils.hasMobileData(activity)
- && defaultSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID;
+ && mSubscriptionId != SubscriptionManager.INVALID_SUBSCRIPTION_ID;
mDataUsageController = new DataUsageController(activity);
+ mDataUsageController.setSubscriptionId(mSubscriptionId);
mDataInfoController = new DataUsageInfoController();
if (mHasMobileData) {
@@ -142,7 +146,8 @@
Activity activity,
Lifecycle lifecycle,
EntityHeaderController entityHeaderController,
- DataUsageSummary dataUsageSummary) {
+ PreferenceFragmentCompat fragment,
+ int subscriptionId) {
super(activity, KEY);
mDataUsageController = dataUsageController;
mDataInfoController = dataInfoController;
@@ -154,12 +159,13 @@
mActivity = activity;
mLifecycle = lifecycle;
mEntityHeaderController = entityHeaderController;
- mDataUsageSummary = dataUsageSummary;
+ mFragment = fragment;
+ mSubscriptionId = subscriptionId;
}
@Override
public void onStart() {
- RecyclerView view = mDataUsageSummary.getListView();
+ RecyclerView view = mFragment.getListView();
mEntityHeaderController.setRecyclerView(view, mLifecycle);
mEntityHeaderController.styleActionBar(mActivity);
}
@@ -260,12 +266,18 @@
mCycleEnd = info.cycleEnd;
mSnapshotTime = -1L;
- final int defaultSubId = SubscriptionManager.getDefaultSubscriptionId();
- final SubscriptionInfo subInfo = mSubscriptionManager.getDefaultDataSubscriptionInfo();
+ SubscriptionInfo subInfo = mSubscriptionManager.getActiveSubscriptionInfo(mSubscriptionId);
+ if (subInfo == null) {
+ subInfo = mSubscriptionManager.getAllSubscriptionInfoList().stream().filter(
+ i -> i.getSubscriptionId() == mSubscriptionId).findFirst().orElse(null);
+ }
if (subInfo != null && mHasMobileData) {
mCarrierName = subInfo.getCarrierName();
- List<SubscriptionPlan> plans = mSubscriptionManager.getSubscriptionPlans(defaultSubId);
- final SubscriptionPlan primaryPlan = getPrimaryPlan(mSubscriptionManager, defaultSubId);
+ List<SubscriptionPlan> plans = mSubscriptionManager.getSubscriptionPlans(
+ mSubscriptionId);
+ final SubscriptionPlan primaryPlan = getPrimaryPlan(mSubscriptionManager,
+ mSubscriptionId);
+
if (primaryPlan != null) {
mDataplanCount = plans.size();
mDataplanSize = primaryPlan.getDataLimitBytes();
@@ -284,8 +296,8 @@
}
}
mManageSubscriptionIntent =
- mSubscriptionManager.createManageSubscriptionIntent(defaultSubId);
- Log.i(TAG, "Have " + mDataplanCount + " plans, dflt sub-id " + defaultSubId
+ mSubscriptionManager.createManageSubscriptionIntent(mSubscriptionId);
+ Log.i(TAG, "Have " + mDataplanCount + " plans, dflt sub-id " + mSubscriptionId
+ ", intent " + mManageSubscriptionIntent);
}
diff --git a/src/com/android/settings/datausage/DataUsageUtils.java b/src/com/android/settings/datausage/DataUsageUtils.java
index b3d0e61..283c84f 100644
--- a/src/com/android/settings/datausage/DataUsageUtils.java
+++ b/src/com/android/settings/datausage/DataUsageUtils.java
@@ -106,7 +106,7 @@
return SystemProperties.get(DataUsageUtils.TEST_RADIOS_PROP).contains("mobile");
}
final List<SubscriptionInfo> subInfoList =
- SubscriptionManager.from(context).getActiveSubscriptionInfoList();
+ SubscriptionManager.from(context).getActiveSubscriptionInfoList(true);
// No activated Subscriptions
if (subInfoList == null) {
if (LOGD) {
diff --git a/src/com/android/settings/datausage/UnrestrictedDataAccess.java b/src/com/android/settings/datausage/UnrestrictedDataAccess.java
index ff516ee..d40537f 100644
--- a/src/com/android/settings/datausage/UnrestrictedDataAccess.java
+++ b/src/com/android/settings/datausage/UnrestrictedDataAccess.java
@@ -14,6 +14,7 @@
package com.android.settings.datausage;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
@@ -22,7 +23,6 @@
import android.view.MenuItem;
import android.view.View;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -109,7 +109,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DATA_USAGE_UNRESTRICTED_ACCESS;
+ return SettingsEnums.DATA_USAGE_UNRESTRICTED_ACCESS;
}
@Override
diff --git a/src/com/android/settings/datausage/UnrestrictedDataAccessPreferenceController.java b/src/com/android/settings/datausage/UnrestrictedDataAccessPreferenceController.java
index efc20f0..d8656ca 100644
--- a/src/com/android/settings/datausage/UnrestrictedDataAccessPreferenceController.java
+++ b/src/com/android/settings/datausage/UnrestrictedDataAccessPreferenceController.java
@@ -16,6 +16,7 @@
import static com.android.settingslib.RestrictedLockUtilsInternal.checkIfMeteredDataRestricted;
import android.app.Application;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.UserHandle;
@@ -23,7 +24,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.AppStateBaseBridge;
import com.android.settings.core.BasePreferenceController;
@@ -225,8 +225,8 @@
@VisibleForTesting
void logSpecialPermissionChange(boolean whitelisted, String packageName) {
- final int logCategory = whitelisted ? MetricsEvent.APP_SPECIAL_PERMISSION_UNL_DATA_ALLOW
- : MetricsEvent.APP_SPECIAL_PERMISSION_UNL_DATA_DENY;
+ final int logCategory = whitelisted ? SettingsEnums.APP_SPECIAL_PERMISSION_UNL_DATA_ALLOW
+ : SettingsEnums.APP_SPECIAL_PERMISSION_UNL_DATA_DENY;
FeatureFactory.getFactory(mContext).getMetricsFeatureProvider().action(mContext,
logCategory, packageName);
}
diff --git a/src/com/android/settings/datetime/timezone/FixedOffsetPicker.java b/src/com/android/settings/datetime/timezone/FixedOffsetPicker.java
index f134051..a0431cc 100644
--- a/src/com/android/settings/datetime/timezone/FixedOffsetPicker.java
+++ b/src/com/android/settings/datetime/timezone/FixedOffsetPicker.java
@@ -16,9 +16,9 @@
package com.android.settings.datetime.timezone;
+import android.app.settings.SettingsEnums;
import android.icu.util.TimeZone;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.datetime.timezone.model.TimeZoneData;
@@ -45,7 +45,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_ZONE_PICKER_FIXED_OFFSET;
+ return SettingsEnums.SETTINGS_ZONE_PICKER_FIXED_OFFSET;
}
@Override
diff --git a/src/com/android/settings/datetime/timezone/RegionSearchPicker.java b/src/com/android/settings/datetime/timezone/RegionSearchPicker.java
index 0abf4e4..07986e2 100644
--- a/src/com/android/settings/datetime/timezone/RegionSearchPicker.java
+++ b/src/com/android/settings/datetime/timezone/RegionSearchPicker.java
@@ -17,6 +17,7 @@
package com.android.settings.datetime.timezone;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.icu.text.Collator;
import android.icu.text.LocaleDisplayNames;
@@ -25,7 +26,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.datetime.timezone.BaseTimeZoneAdapter.AdapterItem;
@@ -54,7 +54,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_ZONE_PICKER_REGION;
+ return SettingsEnums.SETTINGS_ZONE_PICKER_REGION;
}
@Override
diff --git a/src/com/android/settings/datetime/timezone/RegionZonePicker.java b/src/com/android/settings/datetime/timezone/RegionZonePicker.java
index 83d71f1..8e4aa05 100644
--- a/src/com/android/settings/datetime/timezone/RegionZonePicker.java
+++ b/src/com/android/settings/datetime/timezone/RegionZonePicker.java
@@ -16,6 +16,7 @@
package com.android.settings.datetime.timezone;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.icu.text.Collator;
import android.icu.text.LocaleDisplayNames;
@@ -26,7 +27,6 @@
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.datetime.timezone.model.FilteredCountryTimeZones;
import com.android.settings.datetime.timezone.model.TimeZoneData;
@@ -55,7 +55,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_ZONE_PICKER_TIME_ZONE;
+ return SettingsEnums.SETTINGS_ZONE_PICKER_TIME_ZONE;
}
@Override
diff --git a/src/com/android/settings/datetime/timezone/TimeZoneSettings.java b/src/com/android/settings/datetime/timezone/TimeZoneSettings.java
index a20cdb5..6f776c9 100644
--- a/src/com/android/settings/datetime/timezone/TimeZoneSettings.java
+++ b/src/com/android/settings/datetime/timezone/TimeZoneSettings.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.AlarmManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -31,7 +32,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.dashboard.DashboardFragment;
@@ -75,7 +75,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.ZONE_PICKER;
+ return SettingsEnums.ZONE_PICKER;
}
@Override
diff --git a/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java b/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java
index 221afb0..0bc9dc9 100644
--- a/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java
+++ b/src/com/android/settings/deletionhelper/AutomaticStorageManagerSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.deletionhelper;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.os.Bundle;
@@ -28,7 +29,6 @@
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
@@ -138,7 +138,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.STORAGE_MANAGER_SETTINGS;
+ return SettingsEnums.STORAGE_MANAGER_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/deletionhelper/AutomaticStorageManagerSwitchBarController.java b/src/com/android/settings/deletionhelper/AutomaticStorageManagerSwitchBarController.java
index eab19be..c54d789 100644
--- a/src/com/android/settings/deletionhelper/AutomaticStorageManagerSwitchBarController.java
+++ b/src/com/android/settings/deletionhelper/AutomaticStorageManagerSwitchBarController.java
@@ -16,6 +16,7 @@
package com.android.settings.deletionhelper;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.SystemProperties;
import android.provider.Settings;
@@ -24,7 +25,6 @@
import androidx.fragment.app.FragmentManager;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.util.Preconditions;
import com.android.settings.widget.SwitchBar;
import com.android.settingslib.Utils;
@@ -64,7 +64,7 @@
@Override
public void onSwitchChanged(Switch switchView, boolean isChecked) {
- mMetrics.action(mContext, MetricsEvent.ACTION_TOGGLE_STORAGE_MANAGER, isChecked);
+ mMetrics.action(mContext, SettingsEnums.ACTION_TOGGLE_STORAGE_MANAGER, isChecked);
mDaysToRetainPreference.setEnabled(isChecked);
Settings.Secure.putInt(
mContext.getContentResolver(),
diff --git a/src/com/android/settings/development/AllowBackgroundActivityStartsPreferenceController.java b/src/com/android/settings/development/AllowBackgroundActivityStartsPreferenceController.java
index ea47f35..d26517a 100644
--- a/src/com/android/settings/development/AllowBackgroundActivityStartsPreferenceController.java
+++ b/src/com/android/settings/development/AllowBackgroundActivityStartsPreferenceController.java
@@ -19,12 +19,12 @@
import android.content.Context;
import android.provider.Settings;
-import com.android.settings.core.PreferenceControllerMixin;
-import com.android.settingslib.development.DeveloperOptionsPreferenceController;
-
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
+import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settingslib.development.DeveloperOptionsPreferenceController;
+
public class AllowBackgroundActivityStartsPreferenceController
extends DeveloperOptionsPreferenceController
implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
@@ -62,7 +62,7 @@
@Override
protected void onDeveloperOptionsSwitchDisabled() {
super.onDeveloperOptionsSwitchDisabled();
- writeSetting(false);
- ((SwitchPreference) mPreference).setChecked(false);
+ writeSetting(true);
+ ((SwitchPreference) mPreference).setChecked(true);
}
}
diff --git a/src/com/android/settings/development/BluetoothA2dpHwOffloadRebootDialog.java b/src/com/android/settings/development/BluetoothA2dpHwOffloadRebootDialog.java
index cbd77f5..95ef019 100644
--- a/src/com/android/settings/development/BluetoothA2dpHwOffloadRebootDialog.java
+++ b/src/com/android/settings/development/BluetoothA2dpHwOffloadRebootDialog.java
@@ -17,6 +17,7 @@
package com.android.settings.development;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.PowerManager;
@@ -24,7 +25,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -46,7 +46,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_BLUETOOTH_DISABLE_A2DP_HW_OFFLOAD;
+ return SettingsEnums.DIALOG_BLUETOOTH_DISABLE_A2DP_HW_OFFLOAD;
}
@Override
diff --git a/src/com/android/settings/development/ClearAdbKeysPreferenceController.java b/src/com/android/settings/development/ClearAdbKeysPreferenceController.java
index 6613cfd..b39d874 100644
--- a/src/com/android/settings/development/ClearAdbKeysPreferenceController.java
+++ b/src/com/android/settings/development/ClearAdbKeysPreferenceController.java
@@ -20,7 +20,6 @@
import android.debug.IAdbManager;
import android.os.RemoteException;
import android.os.ServiceManager;
-import android.os.SystemProperties;
import android.os.UserManager;
import android.sysprop.AdbProperties;
import android.text.TextUtils;
diff --git a/src/com/android/settings/development/ClearAdbKeysWarningDialog.java b/src/com/android/settings/development/ClearAdbKeysWarningDialog.java
index ce7e149..cdf8a95 100644
--- a/src/com/android/settings/development/ClearAdbKeysWarningDialog.java
+++ b/src/com/android/settings/development/ClearAdbKeysWarningDialog.java
@@ -17,6 +17,7 @@
package com.android.settings.development;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -24,7 +25,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -45,7 +45,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_CLEAR_ADB_KEYS;
+ return SettingsEnums.DIALOG_CLEAR_ADB_KEYS;
}
@Override
diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
index b1e118a..ed6a19f 100644
--- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
+++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.development;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothA2dp;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothCodecStatus;
@@ -37,7 +38,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
@@ -207,7 +207,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEVELOPMENT;
+ return SettingsEnums.DEVELOPMENT;
}
@Override
diff --git a/src/com/android/settings/development/DisableDevSettingsDialogFragment.java b/src/com/android/settings/development/DisableDevSettingsDialogFragment.java
index 9b3ba58..803030e 100644
--- a/src/com/android/settings/development/DisableDevSettingsDialogFragment.java
+++ b/src/com/android/settings/development/DisableDevSettingsDialogFragment.java
@@ -17,17 +17,17 @@
package com.android.settings.development;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.PowerManager;
import android.util.Log;
-import androidx.annotation.VisibleForTesting;
-import androidx.fragment.app.Fragment;
+import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
+import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -51,7 +51,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_DISABLE_DEVELOPMENT_OPTIONS;
+ return SettingsEnums.DIALOG_DISABLE_DEVELOPMENT_OPTIONS;
}
@Override
diff --git a/src/com/android/settings/development/DisableLogPersistWarningDialog.java b/src/com/android/settings/development/DisableLogPersistWarningDialog.java
index a2192c1..76035cc 100644
--- a/src/com/android/settings/development/DisableLogPersistWarningDialog.java
+++ b/src/com/android/settings/development/DisableLogPersistWarningDialog.java
@@ -17,6 +17,7 @@
package com.android.settings.development;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -24,7 +25,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -49,7 +49,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_LOG_PERSIST;
+ return SettingsEnums.DIALOG_LOG_PERSIST;
}
@Override
diff --git a/src/com/android/settings/development/EnableAdbWarningDialog.java b/src/com/android/settings/development/EnableAdbWarningDialog.java
index 3eff3f8..1fcd350 100644
--- a/src/com/android/settings/development/EnableAdbWarningDialog.java
+++ b/src/com/android/settings/development/EnableAdbWarningDialog.java
@@ -17,6 +17,7 @@
package com.android.settings.development;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -24,7 +25,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -44,7 +44,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_ENABLE_ADB;
+ return SettingsEnums.DIALOG_ENABLE_ADB;
}
@Override
diff --git a/src/com/android/settings/development/EnableDevelopmentSettingWarningDialog.java b/src/com/android/settings/development/EnableDevelopmentSettingWarningDialog.java
index 5d102eb..983f55e 100644
--- a/src/com/android/settings/development/EnableDevelopmentSettingWarningDialog.java
+++ b/src/com/android/settings/development/EnableDevelopmentSettingWarningDialog.java
@@ -17,13 +17,13 @@
package com.android.settings.development;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -45,7 +45,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_ENABLE_DEVELOPMENT_OPTIONS;
+ return SettingsEnums.DIALOG_ENABLE_DEVELOPMENT_OPTIONS;
}
@Override
diff --git a/src/com/android/settings/development/EnableOemUnlockSettingWarningDialog.java b/src/com/android/settings/development/EnableOemUnlockSettingWarningDialog.java
index 6324ada..9bfe9d2 100644
--- a/src/com/android/settings/development/EnableOemUnlockSettingWarningDialog.java
+++ b/src/com/android/settings/development/EnableOemUnlockSettingWarningDialog.java
@@ -17,6 +17,7 @@
package com.android.settings.development;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -24,7 +25,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -45,7 +45,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_ENABLE_OEM_UNLOCKING;
+ return SettingsEnums.DIALOG_ENABLE_OEM_UNLOCKING;
}
@Override
diff --git a/src/com/android/settings/development/ForceMSAAPreferenceController.java b/src/com/android/settings/development/ForceMSAAPreferenceController.java
index ce539c7..a1a4d66 100644
--- a/src/com/android/settings/development/ForceMSAAPreferenceController.java
+++ b/src/com/android/settings/development/ForceMSAAPreferenceController.java
@@ -19,7 +19,6 @@
import android.content.Context;
import android.sysprop.DisplayProperties;
-import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
diff --git a/src/com/android/settings/development/MockLocationAppPreferenceController.java b/src/com/android/settings/development/MockLocationAppPreferenceController.java
index 0d8c07a..45d6be8 100644
--- a/src/com/android/settings/development/MockLocationAppPreferenceController.java
+++ b/src/com/android/settings/development/MockLocationAppPreferenceController.java
@@ -16,8 +16,7 @@
package com.android.settings.development;
-import static com.android.settings.development.DevelopmentOptionsActivityRequestCodes
- .REQUEST_MOCK_LOCATION_APP;
+import static com.android.settings.development.DevelopmentOptionsActivityRequestCodes.REQUEST_MOCK_LOCATION_APP;
import android.Manifest;
import android.app.Activity;
diff --git a/src/com/android/settings/development/OemLockInfoDialog.java b/src/com/android/settings/development/OemLockInfoDialog.java
index 3136ec1..c540daa 100644
--- a/src/com/android/settings/development/OemLockInfoDialog.java
+++ b/src/com/android/settings/development/OemLockInfoDialog.java
@@ -17,13 +17,13 @@
package com.android.settings.development;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -41,7 +41,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_OEM_LOCK_INFO;
+ return SettingsEnums.DIALOG_OEM_LOCK_INFO;
}
@Override
diff --git a/src/com/android/settings/development/OemUnlockPreferenceController.java b/src/com/android/settings/development/OemUnlockPreferenceController.java
index cadb0bc..b6b4d17 100644
--- a/src/com/android/settings/development/OemUnlockPreferenceController.java
+++ b/src/com/android/settings/development/OemUnlockPreferenceController.java
@@ -16,8 +16,7 @@
package com.android.settings.development;
-import static com.android.settings.development.DevelopmentOptionsActivityRequestCodes
- .REQUEST_CODE_ENABLE_OEM_UNLOCK;
+import static com.android.settings.development.DevelopmentOptionsActivityRequestCodes.REQUEST_CODE_ENABLE_OEM_UNLOCK;
import android.app.Activity;
import android.content.Context;
diff --git a/src/com/android/settings/development/OverlayCategoryPreferenceController.java b/src/com/android/settings/development/OverlayCategoryPreferenceController.java
index 276049f..9db8a2f 100644
--- a/src/com/android/settings/development/OverlayCategoryPreferenceController.java
+++ b/src/com/android/settings/development/OverlayCategoryPreferenceController.java
@@ -26,6 +26,11 @@
import android.os.ServiceManager;
import android.text.TextUtils;
+import androidx.annotation.VisibleForTesting;
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.development.DeveloperOptionsPreferenceController;
@@ -34,11 +39,6 @@
import java.util.Comparator;
import java.util.List;
-import androidx.annotation.VisibleForTesting;
-import androidx.preference.ListPreference;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceScreen;
-
/**
* Preference controller to allow users to choose an overlay from a list for a given category.
* The chosen overlay is enabled exclusively within its category. A default option is also
diff --git a/src/com/android/settings/development/SelectDebugAppPreferenceController.java b/src/com/android/settings/development/SelectDebugAppPreferenceController.java
index ce6c7c4..b882c70 100644
--- a/src/com/android/settings/development/SelectDebugAppPreferenceController.java
+++ b/src/com/android/settings/development/SelectDebugAppPreferenceController.java
@@ -16,8 +16,7 @@
package com.android.settings.development;
-import static com.android.settings.development.DevelopmentOptionsActivityRequestCodes
- .REQUEST_CODE_DEBUG_APP;
+import static com.android.settings.development.DevelopmentOptionsActivityRequestCodes.REQUEST_CODE_DEBUG_APP;
import android.app.Activity;
import android.content.Context;
diff --git a/src/com/android/settings/development/ShowLayoutBoundsPreferenceController.java b/src/com/android/settings/development/ShowLayoutBoundsPreferenceController.java
index 18551bf..f78a297 100644
--- a/src/com/android/settings/development/ShowLayoutBoundsPreferenceController.java
+++ b/src/com/android/settings/development/ShowLayoutBoundsPreferenceController.java
@@ -18,7 +18,6 @@
import android.content.Context;
import android.sysprop.DisplayProperties;
-import android.view.View;
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
diff --git a/src/com/android/settings/development/SmsAccessRestrictionPreferenceController.java b/src/com/android/settings/development/SmsAccessRestrictionPreferenceController.java
index b3f7b23..6091614 100644
--- a/src/com/android/settings/development/SmsAccessRestrictionPreferenceController.java
+++ b/src/com/android/settings/development/SmsAccessRestrictionPreferenceController.java
@@ -19,12 +19,12 @@
import android.content.Context;
import android.provider.Settings;
-import com.android.settings.core.PreferenceControllerMixin;
-import com.android.settingslib.development.DeveloperOptionsPreferenceController;
-
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
+import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settingslib.development.DeveloperOptionsPreferenceController;
+
// STOPSHIP b/118694572: remove the kill switch once the feature is tested and stable
public class SmsAccessRestrictionPreferenceController extends DeveloperOptionsPreferenceController
implements Preference.OnPreferenceChangeListener, PreferenceControllerMixin {
diff --git a/src/com/android/settings/development/WaitForDebuggerPreferenceController.java b/src/com/android/settings/development/WaitForDebuggerPreferenceController.java
index d11fe37..80cb225 100644
--- a/src/com/android/settings/development/WaitForDebuggerPreferenceController.java
+++ b/src/com/android/settings/development/WaitForDebuggerPreferenceController.java
@@ -16,8 +16,7 @@
package com.android.settings.development;
-import static com.android.settings.development.DevelopmentOptionsActivityRequestCodes
- .REQUEST_CODE_DEBUG_APP;
+import static com.android.settings.development.DevelopmentOptionsActivityRequestCodes.REQUEST_CODE_DEBUG_APP;
import android.app.Activity;
import android.app.ActivityManager;
diff --git a/src/com/android/settings/development/featureflags/FeatureFlagPersistent.java b/src/com/android/settings/development/featureflags/FeatureFlagPersistent.java
index 33de9c3..941c94c 100644
--- a/src/com/android/settings/development/featureflags/FeatureFlagPersistent.java
+++ b/src/com/android/settings/development/featureflags/FeatureFlagPersistent.java
@@ -23,8 +23,6 @@
import androidx.annotation.VisibleForTesting;
-import androidx.annotation.VisibleForTesting;
-
import com.android.settings.core.FeatureFlags;
import java.util.HashSet;
diff --git a/src/com/android/settings/development/featureflags/FeatureFlagsDashboard.java b/src/com/android/settings/development/featureflags/FeatureFlagsDashboard.java
index 0307727..613fb17 100644
--- a/src/com/android/settings/development/featureflags/FeatureFlagsDashboard.java
+++ b/src/com/android/settings/development/featureflags/FeatureFlagsDashboard.java
@@ -16,10 +16,10 @@
package com.android.settings.development.featureflags;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -39,7 +39,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_FEATURE_FLAGS_DASHBOARD;
+ return SettingsEnums.SETTINGS_FEATURE_FLAGS_DASHBOARD;
}
@Override
diff --git a/src/com/android/settings/development/gup/GupDashboard.java b/src/com/android/settings/development/gup/GupDashboard.java
index 31f01dd..0ab57e6 100644
--- a/src/com/android/settings/development/gup/GupDashboard.java
+++ b/src/com/android/settings/development/gup/GupDashboard.java
@@ -16,16 +16,14 @@
package com.android.settings.development.gup;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
-import com.android.settingslib.core.AbstractPreferenceController;
-import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.development.DevelopmentSettingsEnabler;
import com.android.settingslib.search.SearchIndexable;
@@ -38,7 +36,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GUP_DASHBOARD;
+ return SettingsEnums.SETTINGS_GUP_DASHBOARD;
}
@Override
diff --git a/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceController.java b/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceController.java
new file mode 100644
index 0000000..43a28b6
--- /dev/null
+++ b/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceController.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright 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.settings.development.gup;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreference;
+
+import com.android.settings.core.BasePreferenceController;
+import com.android.settingslib.development.DevelopmentSettingsEnabler;
+
+public class GupEnableForAllAppsPreferenceController
+ extends BasePreferenceController implements Preference.OnPreferenceChangeListener {
+ public static final int GUP_DEFAULT = 0;
+ public static final int GUP_ALL_APPS = 1;
+
+ private final ContentResolver mContentResolver;
+
+ public GupEnableForAllAppsPreferenceController(Context context, String key) {
+ super(context, key);
+ mContentResolver = context.getContentResolver();
+ }
+
+ @Override
+ public int getAvailabilityStatus() {
+ return DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(mContext)
+ ? AVAILABLE
+ : DISABLED_DEPENDENT_SETTING;
+ }
+
+ @Override
+ public void displayPreference(PreferenceScreen screen) {
+ super.displayPreference(screen);
+ final SwitchPreference switchPreference = screen.findPreference(getPreferenceKey());
+ if (switchPreference == null) {
+ return;
+ }
+
+ switchPreference.setChecked(Settings.Global.getInt(mContentResolver,
+ Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT)
+ == GUP_ALL_APPS);
+ switchPreference.setOnPreferenceChangeListener(this);
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ // When developer option is present, always overwrite GUP_DEV_ALL_APPS.
+ Settings.Global.putInt(mContentResolver, Settings.Global.GUP_DEV_ALL_APPS,
+ (boolean) newValue ? GUP_ALL_APPS : GUP_DEFAULT);
+
+ return true;
+ }
+}
diff --git a/src/com/android/settings/development/qstile/DevelopmentTileConfigFragment.java b/src/com/android/settings/development/qstile/DevelopmentTileConfigFragment.java
index 795d26c..c6f0ecd 100644
--- a/src/com/android/settings/development/qstile/DevelopmentTileConfigFragment.java
+++ b/src/com/android/settings/development/qstile/DevelopmentTileConfigFragment.java
@@ -16,10 +16,10 @@
package com.android.settings.development.qstile;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -46,7 +46,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DEVELOPMENT_QS_TILE_CONFIG;
+ return SettingsEnums.DEVELOPMENT_QS_TILE_CONFIG;
}
public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
diff --git a/src/com/android/settings/development/qstile/DevelopmentTiles.java b/src/com/android/settings/development/qstile/DevelopmentTiles.java
index 849ed2f..5edbc70 100644
--- a/src/com/android/settings/development/qstile/DevelopmentTiles.java
+++ b/src/com/android/settings/development/qstile/DevelopmentTiles.java
@@ -31,7 +31,6 @@
import android.util.Log;
import android.view.IWindowManager;
import android.view.ThreadedRenderer;
-import android.view.View;
import android.view.WindowManagerGlobal;
import android.widget.Toast;
diff --git a/src/com/android/settings/deviceinfo/BrandedAccountPreferenceController.java b/src/com/android/settings/deviceinfo/BrandedAccountPreferenceController.java
index 5d07f2c..b54b398 100644
--- a/src/com/android/settings/deviceinfo/BrandedAccountPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/BrandedAccountPreferenceController.java
@@ -17,13 +17,13 @@
package com.android.settings.deviceinfo;
import android.accounts.Account;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.accounts.AccountDetailDashboardFragment;
import com.android.settings.accounts.AccountFeatureProvider;
@@ -75,7 +75,7 @@
.setDestination(AccountDetailDashboardFragment.class.getName())
.setTitleRes(R.string.account_sync_title)
.setArguments(args)
- .setSourceMetricsCategory(MetricsEvent.DEVICEINFO)
+ .setSourceMetricsCategory(SettingsEnums.DEVICEINFO)
.launch();
return true;
});
diff --git a/src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java b/src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java
index 5883e21..ec0ab36 100644
--- a/src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/BuildNumberPreferenceController.java
@@ -19,6 +19,7 @@
import static android.content.Context.CLIPBOARD_SERVICE;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ComponentName;
@@ -130,14 +131,14 @@
// Don't enable developer options for secondary non-demo users.
if (!(mUm.isAdminUser() || mUm.isDemoUser())) {
mMetricsFeatureProvider.action(
- mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF);
+ mContext, SettingsEnums.ACTION_SETTINGS_BUILD_NUMBER_PREF);
return false;
}
// Don't enable developer options until device has been provisioned
if (!Utils.isDeviceProvisioned(mContext)) {
mMetricsFeatureProvider.action(
- mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF);
+ mContext, SettingsEnums.ACTION_SETTINGS_BUILD_NUMBER_PREF);
return false;
}
@@ -163,7 +164,7 @@
mDebuggingFeaturesDisallowedAdmin);
}
mMetricsFeatureProvider.action(
- mContext, MetricsEvent.ACTION_SETTINGS_BUILD_NUMBER_PREF);
+ mContext, SettingsEnums.ACTION_SETTINGS_BUILD_NUMBER_PREF);
return false;
}
diff --git a/src/com/android/settings/deviceinfo/DeviceModelPreferenceController.java b/src/com/android/settings/deviceinfo/DeviceModelPreferenceController.java
index a9d0e3f..2797153 100644
--- a/src/com/android/settings/deviceinfo/DeviceModelPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/DeviceModelPreferenceController.java
@@ -28,7 +28,6 @@
import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.DeviceInfoUtils;
-import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
diff --git a/src/com/android/settings/deviceinfo/HardwareInfoDialogFragment.java b/src/com/android/settings/deviceinfo/HardwareInfoDialogFragment.java
index fef0342..34a7143 100644
--- a/src/com/android/settings/deviceinfo/HardwareInfoDialogFragment.java
+++ b/src/com/android/settings/deviceinfo/HardwareInfoDialogFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemProperties;
@@ -28,7 +29,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -38,7 +38,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_SETTINGS_HARDWARE_INFO;
+ return SettingsEnums.DIALOG_SETTINGS_HARDWARE_INFO;
}
public static HardwareInfoDialogFragment newInstance() {
diff --git a/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java b/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
index 462f6d9..598dfb1 100644
--- a/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
@@ -111,7 +111,7 @@
private CharSequence getFirstPhoneNumber() {
final List<SubscriptionInfo> subscriptionInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subscriptionInfoList == null) {
return mContext.getText(R.string.device_info_default);
}
@@ -138,7 +138,7 @@
@VisibleForTesting
SubscriptionInfo getSubscriptionInfo(int simSlot) {
final List<SubscriptionInfo> subscriptionInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subscriptionInfoList != null) {
for (SubscriptionInfo info : subscriptionInfoList) {
if (info.getSimSlotIndex() == simSlot) {
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeForget.java b/src/com/android/settings/deviceinfo/PrivateVolumeForget.java
index 41f8650..bd0772c 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeForget.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeForget.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -34,7 +35,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -48,7 +48,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DEVICEINFO_STORAGE;
+ return SettingsEnums.DEVICEINFO_STORAGE;
}
@Override
@@ -97,7 +97,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_VOLUME_FORGET;
+ return SettingsEnums.DIALOG_VOLUME_FORGET;
}
public static void show(Fragment parent, String fsUuid) {
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeFormat.java b/src/com/android/settings/deviceinfo/PrivateVolumeFormat.java
index 83b55f8..dadff3c 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeFormat.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeFormat.java
@@ -21,6 +21,7 @@
import static com.android.settings.deviceinfo.StorageWizardBase.EXTRA_FORMAT_FORGET_UUID;
import static com.android.settings.deviceinfo.StorageWizardBase.EXTRA_FORMAT_PRIVATE;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.Bundle;
import android.os.storage.DiskInfo;
@@ -34,7 +35,6 @@
import android.widget.Button;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.InstrumentedFragment;
@@ -44,7 +44,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DEVICEINFO_STORAGE;
+ return SettingsEnums.DEVICEINFO_STORAGE;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
index f516926..e68f851 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeSettings.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -52,7 +53,6 @@
import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Settings.StorageUseActivity;
import com.android.settings.SettingsPreferenceFragment;
@@ -140,7 +140,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DEVICEINFO_STORAGE;
+ return SettingsEnums.DEVICEINFO_STORAGE;
}
@Override
@@ -707,7 +707,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_VOLUME_RENAME;
+ return SettingsEnums.DIALOG_VOLUME_RENAME;
}
@Override
@@ -755,7 +755,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_STORAGE_SYSTEM_INFO;
+ return SettingsEnums.DIALOG_STORAGE_SYSTEM_INFO;
}
@Override
@@ -786,7 +786,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_STORAGE_OTHER_INFO;
+ return SettingsEnums.DIALOG_STORAGE_OTHER_INFO;
}
@Override
@@ -828,7 +828,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_STORAGE_USER_INFO;
+ return SettingsEnums.DIALOG_STORAGE_USER_INFO;
}
@Override
@@ -862,7 +862,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_STORAGE_CLEAR_CACHE;
+ return SettingsEnums.DIALOG_STORAGE_CLEAR_CACHE;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/PrivateVolumeUnmount.java b/src/com/android/settings/deviceinfo/PrivateVolumeUnmount.java
index e74abc9..3289df9 100644
--- a/src/com/android/settings/deviceinfo/PrivateVolumeUnmount.java
+++ b/src/com/android/settings/deviceinfo/PrivateVolumeUnmount.java
@@ -16,6 +16,7 @@
package com.android.settings.deviceinfo;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.os.storage.DiskInfo;
import android.os.storage.StorageManager;
@@ -28,7 +29,6 @@
import android.widget.Button;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.deviceinfo.StorageSettings.UnmountTask;
@@ -40,7 +40,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DEVICEINFO_STORAGE;
+ return SettingsEnums.DEVICEINFO_STORAGE;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
index 8476974..fc74ab8 100644
--- a/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
+++ b/src/com/android/settings/deviceinfo/PublicVolumeSettings.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo;
import android.app.ActivityManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.res.Resources;
import android.net.Uri;
@@ -38,7 +39,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.util.Preconditions;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -77,7 +77,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DEVICEINFO_STORAGE;
+ return SettingsEnums.DEVICEINFO_STORAGE;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
index 8fb3ef1..c9cec57 100644
--- a/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
+++ b/src/com/android/settings/deviceinfo/StorageDashboardFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.app.usage.StorageStatsManager;
import android.content.Context;
import android.graphics.drawable.Drawable;
@@ -33,7 +34,6 @@
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.dashboard.DashboardFragment;
@@ -169,7 +169,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_STORAGE_CATEGORY;
+ return SettingsEnums.SETTINGS_STORAGE_CATEGORY;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/StorageProfileFragment.java b/src/com/android/settings/deviceinfo/StorageProfileFragment.java
index 2a865bf..360265c 100644
--- a/src/com/android/settings/deviceinfo/StorageProfileFragment.java
+++ b/src/com/android/settings/deviceinfo/StorageProfileFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.deviceinfo;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.os.UserHandle;
@@ -28,7 +29,6 @@
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.dashboard.DashboardFragment;
@@ -83,7 +83,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_STORAGE_PROFILE;
+ return SettingsEnums.SETTINGS_STORAGE_PROFILE;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/StorageSettings.java b/src/com/android/settings/deviceinfo/StorageSettings.java
index b32da9d..2e52e6b 100644
--- a/src/com/android/settings/deviceinfo/StorageSettings.java
+++ b/src/com/android/settings/deviceinfo/StorageSettings.java
@@ -19,6 +19,7 @@
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -46,7 +47,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.core.SubSettingLauncher;
@@ -74,7 +74,7 @@
private static final String TAG_VOLUME_UNMOUNTED = "volume_unmounted";
private static final String TAG_DISK_INIT = "disk_init";
- private static final int METRICS_CATEGORY = MetricsEvent.DEVICEINFO_STORAGE;
+ private static final int METRICS_CATEGORY = SettingsEnums.DEVICEINFO_STORAGE;
static final int COLOR_PUBLIC = Color.parseColor("#ff9e9e9e");
@@ -447,7 +447,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_VOLUME_UNMOUNT;
+ return SettingsEnums.DIALOG_VOLUME_UNMOUNT;
}
@Override
@@ -513,7 +513,7 @@
public static class DiskInitFragment extends InstrumentedDialogFragment {
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_VOLUME_INIT;
+ return SettingsEnums.DIALOG_VOLUME_INIT;
}
public static void show(Fragment parent, int resId, String diskId) {
diff --git a/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java b/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
index 5e3c86e..9c18a0d 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardFormatConfirm.java
@@ -22,6 +22,7 @@
import static com.android.settings.deviceinfo.StorageWizardBase.EXTRA_FORMAT_PRIVATE;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@@ -32,7 +33,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentActivity;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -65,7 +65,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_VOLUME_FORMAT;
+ return SettingsEnums.DIALOG_VOLUME_FORMAT;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/StorageWizardFormatSlow.java b/src/com/android/settings/deviceinfo/StorageWizardFormatSlow.java
index f1ac1c2..79f97de 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardFormatSlow.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardFormatSlow.java
@@ -16,6 +16,7 @@
package com.android.settings.deviceinfo;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.Bundle;
import android.os.storage.DiskInfo;
@@ -23,7 +24,6 @@
import android.text.TextUtils;
import android.view.View;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
@@ -58,7 +58,7 @@
@Override
public void onNavigateBack(View view) {
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- MetricsEvent.ACTION_STORAGE_BENCHMARK_SLOW_ABORT);
+ SettingsEnums.ACTION_STORAGE_BENCHMARK_SLOW_ABORT);
final Intent intent = new Intent(this, StorageWizardInit.class);
startActivity(intent);
@@ -70,11 +70,11 @@
if (view != null) {
// User made an explicit choice to continue when slow
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- MetricsEvent.ACTION_STORAGE_BENCHMARK_SLOW_CONTINUE);
+ SettingsEnums.ACTION_STORAGE_BENCHMARK_SLOW_CONTINUE);
} else {
// User made an implicit choice to continue when fast
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- MetricsEvent.ACTION_STORAGE_BENCHMARK_FAST_CONTINUE);
+ SettingsEnums.ACTION_STORAGE_BENCHMARK_FAST_CONTINUE);
}
final String forgetUuid = getIntent().getStringExtra(EXTRA_FORMAT_FORGET_UUID);
diff --git a/src/com/android/settings/deviceinfo/StorageWizardInit.java b/src/com/android/settings/deviceinfo/StorageWizardInit.java
index 907f58c..4f9c5e7 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardInit.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardInit.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo;
import android.app.ActivityManager;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.Bundle;
import android.os.UserManager;
@@ -25,7 +26,6 @@
import android.view.View;
import android.widget.Button;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
@@ -72,7 +72,7 @@
if (view != null) {
// User made an explicit choice for external
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- MetricsEvent.ACTION_STORAGE_INIT_EXTERNAL);
+ SettingsEnums.ACTION_STORAGE_INIT_EXTERNAL);
}
if (mVolume != null && mVolume.getType() == VolumeInfo.TYPE_PUBLIC
@@ -95,7 +95,7 @@
if (view != null) {
// User made an explicit choice for internal
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- MetricsEvent.ACTION_STORAGE_INIT_INTERNAL);
+ SettingsEnums.ACTION_STORAGE_INIT_INTERNAL);
}
StorageWizardFormatConfirm.showPrivate(this, mDisk.getId());
diff --git a/src/com/android/settings/deviceinfo/StorageWizardMigrateConfirm.java b/src/com/android/settings/deviceinfo/StorageWizardMigrateConfirm.java
index 48ec0e3..1cae22e 100644
--- a/src/com/android/settings/deviceinfo/StorageWizardMigrateConfirm.java
+++ b/src/com/android/settings/deviceinfo/StorageWizardMigrateConfirm.java
@@ -18,6 +18,7 @@
import static com.android.settings.deviceinfo.StorageSettings.TAG;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
@@ -31,7 +32,6 @@
import android.view.View;
import android.widget.Toast;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.password.ChooseLockSettingsHelper;
@@ -83,7 +83,7 @@
@Override
public void onNavigateBack(View view) {
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- MetricsEvent.ACTION_STORAGE_MIGRATE_LATER);
+ SettingsEnums.ACTION_STORAGE_MIGRATE_LATER);
if (mDisk != null) {
final Intent intent = new Intent(this, StorageWizardReady.class);
@@ -137,7 +137,7 @@
}
FeatureFactory.getFactory(this).getMetricsFeatureProvider().action(this,
- MetricsEvent.ACTION_STORAGE_MIGRATE_NOW);
+ SettingsEnums.ACTION_STORAGE_MIGRATE_NOW);
final Intent intent = new Intent(this, StorageWizardMigrateProgress.class);
intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mVolume.getId());
diff --git a/src/com/android/settings/deviceinfo/aboutphone/DeviceNameWarningDialog.java b/src/com/android/settings/deviceinfo/aboutphone/DeviceNameWarningDialog.java
index a6b1dec..b38f13f 100644
--- a/src/com/android/settings/deviceinfo/aboutphone/DeviceNameWarningDialog.java
+++ b/src/com/android/settings/deviceinfo/aboutphone/DeviceNameWarningDialog.java
@@ -17,13 +17,13 @@
package com.android.settings.deviceinfo.aboutphone;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -48,7 +48,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_ENABLE_DEVELOPMENT_OPTIONS;
+ return SettingsEnums.DIALOG_ENABLE_DEVELOPMENT_OPTIONS;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
index e836d1f..b61cb3c 100644
--- a/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
+++ b/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo.aboutphone;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.UserInfo;
@@ -25,7 +26,6 @@
import android.provider.SearchIndexableResource;
import android.view.View;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.accounts.EmergencyInfoPreferenceController;
@@ -68,7 +68,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DEVICEINFO;
+ return SettingsEnums.DEVICEINFO;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogFragment.java b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogFragment.java
index 5dbc5ac..f615968 100644
--- a/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogFragment.java
+++ b/src/com/android/settings/deviceinfo/firmwareversion/FirmwareVersionDialogFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo.firmwareversion;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@@ -26,7 +27,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -46,7 +46,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_FIRMWARE_VERSION;
+ return SettingsEnums.DIALOG_FIRMWARE_VERSION;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogController.java b/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogController.java
index 3584849..33d7a8a 100644
--- a/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogController.java
+++ b/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogController.java
@@ -127,7 +127,7 @@
private SubscriptionInfo getSubscriptionInfo(Context context, int slotId) {
final List<SubscriptionInfo> subscriptionInfoList = SubscriptionManager.from(context)
- .getActiveSubscriptionInfoList();
+ .getActiveSubscriptionInfoList(true);
if (subscriptionInfoList == null || subscriptionInfoList.isEmpty()) {
return null;
}
diff --git a/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogFragment.java b/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogFragment.java
index 5347fa7..b2f083f 100644
--- a/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogFragment.java
+++ b/src/com/android/settings/deviceinfo/imei/ImeiInfoDialogFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo.imei;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
@@ -29,7 +30,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -57,7 +57,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_IMEI_INFO;
+ return SettingsEnums.DIALOG_IMEI_INFO;
}
@Override
diff --git a/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java b/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java
index 25d1866..af0bf5a 100644
--- a/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java
+++ b/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogController.java
@@ -25,7 +25,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.PersistableBundle;
@@ -42,18 +41,17 @@
import android.text.BidiFormatter;
import android.text.TextDirectionHeuristics;
import android.text.TextUtils;
-import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import com.android.settings.R;
import com.android.settingslib.DeviceInfoUtils;
+import com.android.settingslib.Utils;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
import com.android.settingslib.core.lifecycle.events.OnPause;
import com.android.settingslib.core.lifecycle.events.OnResume;
-import com.android.settingslib.Utils;
import java.util.List;
@@ -404,7 +402,7 @@
private SubscriptionInfo getPhoneSubscriptionInfo(int slotId) {
final List<SubscriptionInfo> subscriptionInfoList = SubscriptionManager.from(
- mContext).getActiveSubscriptionInfoList();
+ mContext).getActiveSubscriptionInfoList(true);
if (subscriptionInfoList != null && subscriptionInfoList.size() > slotId) {
return subscriptionInfoList.get(slotId);
} else {
diff --git a/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogFragment.java b/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogFragment.java
index ca1c6ef..d2d563f 100644
--- a/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogFragment.java
+++ b/src/com/android/settings/deviceinfo/simstatus/SimStatusDialogFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo.simstatus;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
@@ -27,7 +28,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -43,7 +43,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_SIM_STATUS;
+ return SettingsEnums.DIALOG_SIM_STATUS;
}
public static void show(Fragment host, int slotId, String dialogTitle) {
diff --git a/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceController.java b/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceController.java
index 02c1916..ed01e22 100644
--- a/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/simstatus/SimStatusPreferenceController.java
@@ -107,7 +107,7 @@
private CharSequence getCarrierName(int simSlot) {
final List<SubscriptionInfo> subscriptionInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subscriptionInfoList != null) {
for (SubscriptionInfo info : subscriptionInfoList) {
if (info.getSimSlotIndex() == simSlot) {
diff --git a/src/com/android/settings/deviceinfo/storage/AutomaticStorageManagementSwitchPreferenceController.java b/src/com/android/settings/deviceinfo/storage/AutomaticStorageManagementSwitchPreferenceController.java
index a9c98d5..95c02fd 100644
--- a/src/com/android/settings/deviceinfo/storage/AutomaticStorageManagementSwitchPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/storage/AutomaticStorageManagementSwitchPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.deviceinfo.storage;
import android.app.ActivityManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.SystemProperties;
import android.provider.Settings;
@@ -25,7 +26,6 @@
import androidx.fragment.app.FragmentManager;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.deletionhelper.ActivationWarningFragment;
import com.android.settings.overlay.FeatureFactory;
@@ -86,7 +86,7 @@
@Override
public boolean onSwitchToggled(boolean isChecked) {
mMetricsFeatureProvider.action(mContext,
- MetricsEvent.ACTION_TOGGLE_STORAGE_MANAGER, isChecked);
+ SettingsEnums.ACTION_TOGGLE_STORAGE_MANAGER, isChecked);
Settings.Secure.putInt(mContext.getContentResolver(),
Settings.Secure.AUTOMATIC_STORAGE_MANAGER_ENABLED,
isChecked ? 1 : 0);
diff --git a/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java b/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
index c63fe10..4bc7cde 100644
--- a/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/storage/StorageItemPreferenceController.java
@@ -16,6 +16,7 @@
package com.android.settings.deviceinfo.storage;
+import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
@@ -33,7 +34,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.Settings;
import com.android.settings.applications.manageapplications.ManageApplications;
@@ -155,7 +155,7 @@
case FILES_KEY:
intent = getFilesIntent();
FeatureFactory.getFactory(mContext).getMetricsFeatureProvider().action(
- mContext, MetricsEvent.STORAGE_FILES);
+ mContext, SettingsEnums.STORAGE_FILES);
break;
case SYSTEM_KEY:
final SystemInfoFragment dialog = new SystemInfoFragment();
diff --git a/src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreference.java b/src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreference.java
index a025d8c..cf50596 100644
--- a/src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreference.java
+++ b/src/com/android/settings/deviceinfo/storage/StorageSummaryDonutPreference.java
@@ -16,6 +16,7 @@
package com.android.settings.deviceinfo.storage;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
@@ -29,7 +30,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.widget.DonutView;
@@ -81,7 +81,7 @@
if (v != null && R.id.deletion_helper_button == v.getId()) {
Context context = getContext();
FeatureFactory.getFactory(context).getMetricsFeatureProvider().action(
- context, MetricsEvent.STORAGE_FREE_UP_SPACE_NOW);
+ context, SettingsEnums.STORAGE_FREE_UP_SPACE_NOW);
Intent intent = new Intent(StorageManager.ACTION_MANAGE_STORAGE);
getContext().startActivity(intent);
}
diff --git a/src/com/android/settings/deviceinfo/storage/UserProfileController.java b/src/com/android/settings/deviceinfo/storage/UserProfileController.java
index 887b1a7..a2e19db 100644
--- a/src/com/android/settings/deviceinfo/storage/UserProfileController.java
+++ b/src/com/android/settings/deviceinfo/storage/UserProfileController.java
@@ -16,6 +16,7 @@
package com.android.settings.deviceinfo.storage;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.UserInfo;
import android.graphics.drawable.Drawable;
@@ -26,7 +27,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.util.Preconditions;
import com.android.settings.Utils;
import com.android.settings.core.PreferenceControllerMixin;
@@ -84,7 +84,7 @@
.setDestination(StorageProfileFragment.class.getName())
.setArguments(args)
.setTitleText(mUser.name)
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.DEVICEINFO_STORAGE)
+ .setSourceMetricsCategory(SettingsEnums.DEVICEINFO_STORAGE)
.launch();
return true;
}
diff --git a/src/com/android/settings/display/AmbientDisplayNotificationsPreferenceController.java b/src/com/android/settings/display/AmbientDisplayNotificationsPreferenceController.java
index f845331..5c19ca7 100644
--- a/src/com/android/settings/display/AmbientDisplayNotificationsPreferenceController.java
+++ b/src/com/android/settings/display/AmbientDisplayNotificationsPreferenceController.java
@@ -15,8 +15,7 @@
import static android.provider.Settings.Secure.DOZE_ENABLED;
-import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_AMBIENT_DISPLAY;
-
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.UserHandle;
import android.provider.Settings;
@@ -62,7 +61,7 @@
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (KEY_AMBIENT_DISPLAY_NOTIFICATIONS.equals(preference.getKey())) {
- mMetricsFeatureProvider.action(mContext, ACTION_AMBIENT_DISPLAY);
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_AMBIENT_DISPLAY);
}
return false;
}
diff --git a/src/com/android/settings/display/AutoBrightnessSettings.java b/src/com/android/settings/display/AutoBrightnessSettings.java
index 39877ec..b0ab6b0 100644
--- a/src/com/android/settings/display/AutoBrightnessSettings.java
+++ b/src/com/android/settings/display/AutoBrightnessSettings.java
@@ -16,11 +16,11 @@
package com.android.settings.display;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -53,7 +53,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_AUTO_BRIGHTNESS;
+ return SettingsEnums.SETTINGS_AUTO_BRIGHTNESS;
}
@Override
diff --git a/src/com/android/settings/display/AutoRotatePreferenceController.java b/src/com/android/settings/display/AutoRotatePreferenceController.java
index c852c01..f444d8a 100644
--- a/src/com/android/settings/display/AutoRotatePreferenceController.java
+++ b/src/com/android/settings/display/AutoRotatePreferenceController.java
@@ -13,12 +13,12 @@
*/
package com.android.settings.display;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.text.TextUtils;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.view.RotationPolicy;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.core.TogglePreferenceController;
@@ -89,7 +89,7 @@
@Override
public boolean setChecked(boolean isChecked) {
final boolean isLocked = !isChecked;
- mMetricsFeatureProvider.action(mContext, MetricsProto.MetricsEvent.ACTION_ROTATION_LOCK,
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ROTATION_LOCK,
isLocked);
RotationPolicy.setRotationLock(mContext, isLocked);
return true;
diff --git a/src/com/android/settings/display/ColorModePreferenceFragment.java b/src/com/android/settings/display/ColorModePreferenceFragment.java
index 2a21379..e8fc1c5 100644
--- a/src/com/android/settings/display/ColorModePreferenceFragment.java
+++ b/src/com/android/settings/display/ColorModePreferenceFragment.java
@@ -13,6 +13,7 @@
*/
package com.android.settings.display;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.provider.SearchIndexableResource;
@@ -21,7 +22,6 @@
import androidx.preference.PreferenceScreen;
import com.android.internal.app.ColorDisplayController;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -149,7 +149,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.COLOR_MODE_SETTINGS;
+ return SettingsEnums.COLOR_MODE_SETTINGS;
}
@VisibleForTesting
diff --git a/src/com/android/settings/display/DisplayWhiteBalancePreferenceController.java b/src/com/android/settings/display/DisplayWhiteBalancePreferenceController.java
index dc8636a..bf2b347 100644
--- a/src/com/android/settings/display/DisplayWhiteBalancePreferenceController.java
+++ b/src/com/android/settings/display/DisplayWhiteBalancePreferenceController.java
@@ -17,6 +17,7 @@
import android.hardware.display.ColorDisplayManager;
import android.os.UserHandle;
import android.provider.Settings.Secure;
+
import com.android.internal.app.ColorDisplayController;
import com.android.settings.core.TogglePreferenceController;
diff --git a/src/com/android/settings/display/FontSizePreferenceFragmentForSetupWizard.java b/src/com/android/settings/display/FontSizePreferenceFragmentForSetupWizard.java
index 703ec9c..04b6dc3 100644
--- a/src/com/android/settings/display/FontSizePreferenceFragmentForSetupWizard.java
+++ b/src/com/android/settings/display/FontSizePreferenceFragmentForSetupWizard.java
@@ -16,21 +16,21 @@
package com.android.settings.display;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import android.app.settings.SettingsEnums;
public class FontSizePreferenceFragmentForSetupWizard
extends ToggleFontSizePreferenceFragment {
@Override
public int getMetricsCategory() {
- return MetricsEvent.SUW_ACCESSIBILITY_FONT_SIZE;
+ return SettingsEnums.SUW_ACCESSIBILITY_FONT_SIZE;
}
@Override
public void onStop() {
// Log the final choice in value if it's different from the previous value.
if (mCurrentIndex != mInitialIndex) {
- mMetricsFeatureProvider.action(getContext(), MetricsEvent.SUW_ACCESSIBILITY_FONT_SIZE,
+ mMetricsFeatureProvider.action(getContext(), SettingsEnums.SUW_ACCESSIBILITY_FONT_SIZE,
mCurrentIndex);
}
diff --git a/src/com/android/settings/display/NightDisplayCustomEndTimePreferenceController.java b/src/com/android/settings/display/NightDisplayCustomEndTimePreferenceController.java
index f7a5425..2fa0ef5 100644
--- a/src/com/android/settings/display/NightDisplayCustomEndTimePreferenceController.java
+++ b/src/com/android/settings/display/NightDisplayCustomEndTimePreferenceController.java
@@ -17,11 +17,10 @@
package com.android.settings.display;
import android.content.Context;
+import android.hardware.display.ColorDisplayManager;
import androidx.preference.Preference;
-import android.hardware.display.ColorDisplayManager;
-
import com.android.internal.app.ColorDisplayController;
import com.android.settings.core.BasePreferenceController;
diff --git a/src/com/android/settings/display/NightDisplayCustomStartTimePreferenceController.java b/src/com/android/settings/display/NightDisplayCustomStartTimePreferenceController.java
index 346ddd6..cf740fd 100644
--- a/src/com/android/settings/display/NightDisplayCustomStartTimePreferenceController.java
+++ b/src/com/android/settings/display/NightDisplayCustomStartTimePreferenceController.java
@@ -17,11 +17,10 @@
package com.android.settings.display;
import android.content.Context;
+import android.hardware.display.ColorDisplayManager;
import androidx.preference.Preference;
-import android.hardware.display.ColorDisplayManager;
-
import com.android.internal.app.ColorDisplayController;
import com.android.settings.core.BasePreferenceController;
diff --git a/src/com/android/settings/display/NightDisplayFooterPreferenceController.java b/src/com/android/settings/display/NightDisplayFooterPreferenceController.java
index e0c12c3..194f006 100644
--- a/src/com/android/settings/display/NightDisplayFooterPreferenceController.java
+++ b/src/com/android/settings/display/NightDisplayFooterPreferenceController.java
@@ -17,11 +17,10 @@
package com.android.settings.display;
import android.content.Context;
+import android.hardware.display.ColorDisplayManager;
import androidx.preference.Preference;
-import android.hardware.display.ColorDisplayManager;
-
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.widget.FooterPreference;
diff --git a/src/com/android/settings/display/NightDisplayPreferenceController.java b/src/com/android/settings/display/NightDisplayPreferenceController.java
index 678e4d3..162a648 100644
--- a/src/com/android/settings/display/NightDisplayPreferenceController.java
+++ b/src/com/android/settings/display/NightDisplayPreferenceController.java
@@ -14,8 +14,8 @@
package com.android.settings.display;
import android.content.Context;
-
import android.hardware.display.ColorDisplayManager;
+
import com.android.internal.app.ColorDisplayController;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
diff --git a/src/com/android/settings/display/NightDisplaySettings.java b/src/com/android/settings/display/NightDisplaySettings.java
index 7e77415..fb81a8c 100644
--- a/src/com/android/settings/display/NightDisplaySettings.java
+++ b/src/com/android/settings/display/NightDisplaySettings.java
@@ -18,6 +18,7 @@
import android.app.Dialog;
import android.app.TimePickerDialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.hardware.display.ColorDisplayManager;
import android.os.Bundle;
@@ -26,7 +27,6 @@
import androidx.preference.Preference;
import com.android.internal.app.ColorDisplayController;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -116,9 +116,9 @@
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case DIALOG_START_TIME:
- return MetricsEvent.DIALOG_NIGHT_DISPLAY_SET_START_TIME;
+ return SettingsEnums.DIALOG_NIGHT_DISPLAY_SET_START_TIME;
case DIALOG_END_TIME:
- return MetricsEvent.DIALOG_NIGHT_DISPLAY_SET_END_TIME;
+ return SettingsEnums.DIALOG_NIGHT_DISPLAY_SET_END_TIME;
default:
return 0;
}
@@ -161,7 +161,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NIGHT_DISPLAY_SETTINGS;
+ return SettingsEnums.NIGHT_DISPLAY_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/display/PreviewPagerAdapter.java b/src/com/android/settings/display/PreviewPagerAdapter.java
index 4d5b47a..5c43683 100644
--- a/src/com/android/settings/display/PreviewPagerAdapter.java
+++ b/src/com/android/settings/display/PreviewPagerAdapter.java
@@ -19,11 +19,9 @@
import android.animation.Animator.AnimatorListener;
import android.content.Context;
import android.content.res.Configuration;
-import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
-import android.view.ViewStub.OnInflateListener;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Interpolator;
@@ -32,8 +30,6 @@
import androidx.viewpager.widget.PagerAdapter;
-import com.android.settings.support.actionbar.HelpResourceProvider;
-
/**
* A PagerAdapter used by PreviewSeekBarPreferenceFragment that for showing multiple preview screen
* regarding a single setting and allowing the user to swipe across them.
diff --git a/src/com/android/settings/display/ScreenZoomPreferenceFragmentForSetupWizard.java b/src/com/android/settings/display/ScreenZoomPreferenceFragmentForSetupWizard.java
index e02579f..cfa7b5d 100644
--- a/src/com/android/settings/display/ScreenZoomPreferenceFragmentForSetupWizard.java
+++ b/src/com/android/settings/display/ScreenZoomPreferenceFragmentForSetupWizard.java
@@ -16,13 +16,13 @@
package com.android.settings.display;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import android.app.settings.SettingsEnums;
public class ScreenZoomPreferenceFragmentForSetupWizard extends ScreenZoomSettings {
@Override
public int getMetricsCategory() {
- return MetricsEvent.SUW_ACCESSIBILITY_DISPLAY_SIZE;
+ return SettingsEnums.SUW_ACCESSIBILITY_DISPLAY_SIZE;
}
@Override
@@ -30,7 +30,7 @@
// Log the final choice in value if it's different from the previous value.
if (mCurrentIndex != mInitialIndex) {
mMetricsFeatureProvider.action(
- getContext(), MetricsEvent.SUW_ACCESSIBILITY_DISPLAY_SIZE, mCurrentIndex);
+ getContext(), SettingsEnums.SUW_ACCESSIBILITY_DISPLAY_SIZE, mCurrentIndex);
}
super.onStop();
diff --git a/src/com/android/settings/display/ScreenZoomSettings.java b/src/com/android/settings/display/ScreenZoomSettings.java
index 37ac046..ad6c685 100644
--- a/src/com/android/settings/display/ScreenZoomSettings.java
+++ b/src/com/android/settings/display/ScreenZoomSettings.java
@@ -17,13 +17,13 @@
package com.android.settings.display;
import android.annotation.Nullable;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Display;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -113,7 +113,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DISPLAY_SCREEN_ZOOM;
+ return SettingsEnums.DISPLAY_SCREEN_ZOOM;
}
/** Index provider used to expose this fragment in search. */
diff --git a/src/com/android/settings/display/ThemePreferenceController.java b/src/com/android/settings/display/ThemePreferenceController.java
index 6fc4b08..1dbf87f 100644
--- a/src/com/android/settings/display/ThemePreferenceController.java
+++ b/src/com/android/settings/display/ThemePreferenceController.java
@@ -13,8 +13,8 @@
*/
package com.android.settings.display;
-import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_THEME;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.om.IOverlayManager;
import android.content.om.OverlayInfo;
@@ -70,7 +70,7 @@
@Override
public boolean handlePreferenceTreeClick(Preference preference) {
if (KEY_THEME.equals(preference.getKey())) {
- mMetricsFeatureProvider.action(mContext, ACTION_THEME);
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_THEME);
}
return false;
}
diff --git a/src/com/android/settings/display/TimeoutListPreference.java b/src/com/android/settings/display/TimeoutListPreference.java
index 5ed427f..f9a731d 100644
--- a/src/com/android/settings/display/TimeoutListPreference.java
+++ b/src/com/android/settings/display/TimeoutListPreference.java
@@ -26,7 +26,6 @@
import android.util.Log;
import android.view.View;
-import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog.Builder;
import com.android.settings.R;
@@ -34,18 +33,18 @@
import com.android.settingslib.RestrictedLockUtils;
import java.util.ArrayList;
-import java.util.List;
public class TimeoutListPreference extends RestrictedListPreference {
private static final String TAG = "TimeoutListPreference";
private EnforcedAdmin mAdmin;
- private CharSequence[] mInitialEntries;
- private CharSequence[] mInitialValues;
+ private final CharSequence[] mInitialEntries;
+ private final CharSequence[] mInitialValues;
public TimeoutListPreference(Context context, AttributeSet attrs) {
super(context, attrs);
- updateInitialValues();
+ mInitialEntries = getEntries();
+ mInitialValues = getEntryValues();
}
@Override
@@ -66,8 +65,13 @@
if (mAdmin != null) {
View footerView = dialog.findViewById(R.id.admin_disabled_other_options);
footerView.findViewById(R.id.admin_more_details_link).setOnClickListener(
- view -> RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
- getContext(), mAdmin));
+ new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ RestrictedLockUtils.sendShowAdminSupportDetailsIntent(
+ getContext(), mAdmin);
+ }
+ });
}
}
@@ -85,8 +89,8 @@
maxTimeout = Long.MAX_VALUE;
}
- final ArrayList<CharSequence> revisedEntries = new ArrayList<>();
- final ArrayList<CharSequence> revisedValues = new ArrayList<>();
+ ArrayList<CharSequence> revisedEntries = new ArrayList<CharSequence>();
+ ArrayList<CharSequence> revisedValues = new ArrayList<CharSequence>();
for (int i = 0; i < mInitialValues.length; ++i) {
long timeout = Long.parseLong(mInitialValues[i].toString());
if (timeout <= maxTimeout) {
@@ -97,7 +101,7 @@
// If there are no possible options for the user, then set this preference as disabled
// by admin, otherwise remove the padlock in case it was set earlier.
- if (revisedValues.isEmpty()) {
+ if (revisedValues.size() == 0) {
setDisabledByAdmin(admin);
return;
} else {
@@ -113,7 +117,7 @@
setValue(String.valueOf(userPreference));
} else if (revisedValues.size() > 0
&& Long.parseLong(revisedValues.get(revisedValues.size() - 1).toString())
- == maxTimeout) {
+ == maxTimeout) {
// If the last one happens to be the same as the max timeout, select that
setValue(String.valueOf(maxTimeout));
} else {
@@ -124,36 +128,4 @@
}
}
}
-
- @VisibleForTesting
- void updateInitialValues() {
- // Read default list of candidate values.
- final CharSequence[] entries = getEntries();
- final CharSequence[] values = getEntryValues();
- // Filter out values based on config
- final List<CharSequence> revisedEntries = new ArrayList<>();
- final List<CharSequence> revisedValues = new ArrayList<>();
- final long maxTimeout = getContext().getResources().getInteger(
- R.integer.max_lock_after_timeout_ms);
- if (entries == null || values == null) {
- return;
- }
- Log.d(TAG, "max timeout: " + maxTimeout);
- for (int i = 0; i < values.length; ++i) {
- long timeout = Long.parseLong(values[i].toString());
- if (timeout <= maxTimeout) {
- Log.d(TAG, "keeping timeout: " + values[i]);
- revisedEntries.add(entries[i]);
- revisedValues.add(values[i]);
- } else {
- Log.d(TAG, "Dropping timeout: " + values[i]);
- }
- }
-
- // Store final candidates in initial value lists.
- mInitialEntries = revisedEntries.toArray(new CharSequence[0]);
- setEntries(mInitialEntries);
- mInitialValues = revisedValues.toArray(new CharSequence[0]);
- setEntryValues(mInitialValues);
- }
}
diff --git a/src/com/android/settings/display/TimeoutPreferenceController.java b/src/com/android/settings/display/TimeoutPreferenceController.java
index c1c5069..60b7e24 100644
--- a/src/com/android/settings/display/TimeoutPreferenceController.java
+++ b/src/com/android/settings/display/TimeoutPreferenceController.java
@@ -13,6 +13,8 @@
*/
package com.android.settings.display;
+import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT;
+
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.os.UserHandle;
@@ -58,7 +60,7 @@
public void updateState(Preference preference) {
final TimeoutListPreference timeoutListPreference = (TimeoutListPreference) preference;
final long currentTimeout = Settings.System.getLong(mContext.getContentResolver(),
- Settings.System.SCREEN_OFF_TIMEOUT, FALLBACK_SCREEN_TIMEOUT_VALUE);
+ SCREEN_OFF_TIMEOUT, FALLBACK_SCREEN_TIMEOUT_VALUE);
timeoutListPreference.setValue(String.valueOf(currentTimeout));
final DevicePolicyManager dpm =
(DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
@@ -84,8 +86,7 @@
public boolean onPreferenceChange(Preference preference, Object newValue) {
try {
int value = Integer.parseInt((String) newValue);
- Settings.System.putInt(mContext.getContentResolver(),
- Settings.System.SCREEN_OFF_TIMEOUT, value);
+ Settings.System.putInt(mContext.getContentResolver(), SCREEN_OFF_TIMEOUT, value);
updateTimeoutPreferenceDescription((TimeoutListPreference) preference, value);
} catch (NumberFormatException e) {
Log.e(TAG, "could not persist screen timeout setting", e);
@@ -93,7 +94,7 @@
return true;
}
- private static CharSequence getTimeoutDescription(
+ public static CharSequence getTimeoutDescription(
long currentTimeout, CharSequence[] entries, CharSequence[] values) {
if (currentTimeout < 0 || entries == null || values == null
|| values.length != entries.length) {
diff --git a/src/com/android/settings/display/ToggleFontSizePreferenceFragment.java b/src/com/android/settings/display/ToggleFontSizePreferenceFragment.java
index 4f118d5..49177a0 100644
--- a/src/com/android/settings/display/ToggleFontSizePreferenceFragment.java
+++ b/src/com/android/settings/display/ToggleFontSizePreferenceFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.display;
import android.annotation.Nullable;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Configuration;
@@ -24,7 +25,6 @@
import android.os.Bundle;
import android.provider.Settings;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -96,7 +96,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ACCESSIBILITY_FONT_SIZE;
+ return SettingsEnums.ACCESSIBILITY_FONT_SIZE;
}
/**
diff --git a/src/com/android/settings/display/VrDisplayPreferencePicker.java b/src/com/android/settings/display/VrDisplayPreferencePicker.java
index 5f99be9..4612779 100644
--- a/src/com/android/settings/display/VrDisplayPreferencePicker.java
+++ b/src/com/android/settings/display/VrDisplayPreferencePicker.java
@@ -16,12 +16,12 @@
package com.android.settings.display;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.provider.Settings;
import android.text.TextUtils;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settingslib.widget.CandidateInfo;
@@ -40,7 +40,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.VR_DISPLAY_PREFERENCE;
+ return SettingsEnums.VR_DISPLAY_PREFERENCE;
}
@Override
diff --git a/src/com/android/settings/dream/CurrentDreamPicker.java b/src/com/android/settings/dream/CurrentDreamPicker.java
index d33a1d9..3134e79 100644
--- a/src/com/android/settings/dream/CurrentDreamPicker.java
+++ b/src/com/android/settings/dream/CurrentDreamPicker.java
@@ -16,11 +16,11 @@
package com.android.settings.dream;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.graphics.drawable.Drawable;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settingslib.dream.DreamBackend;
@@ -50,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DREAM;
+ return SettingsEnums.DREAM;
}
@Override
diff --git a/src/com/android/settings/dream/DreamSettings.java b/src/com/android/settings/dream/DreamSettings.java
index 32869f8..c36970e 100644
--- a/src/com/android/settings/dream/DreamSettings.java
+++ b/src/com/android/settings/dream/DreamSettings.java
@@ -21,12 +21,12 @@
import static com.android.settingslib.dream.DreamBackend.WHILE_CHARGING;
import static com.android.settingslib.dream.DreamBackend.WHILE_DOCKED;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -93,7 +93,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DREAM;
+ return SettingsEnums.DREAM;
}
@Override
diff --git a/src/com/android/settings/dream/WhenToDreamPicker.java b/src/com/android/settings/dream/WhenToDreamPicker.java
index 4c69b36..1c5e25e 100644
--- a/src/com/android/settings/dream/WhenToDreamPicker.java
+++ b/src/com/android/settings/dream/WhenToDreamPicker.java
@@ -16,10 +16,10 @@
package com.android.settings.dream;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.graphics.drawable.Drawable;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settingslib.dream.DreamBackend;
@@ -47,7 +47,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DREAM;
+ return SettingsEnums.DREAM;
}
@Override
diff --git a/src/com/android/settings/enterprise/ApplicationListFragment.java b/src/com/android/settings/enterprise/ApplicationListFragment.java
index 1b41f03..17de9f8 100644
--- a/src/com/android/settings/enterprise/ApplicationListFragment.java
+++ b/src/com/android/settings/enterprise/ApplicationListFragment.java
@@ -17,9 +17,9 @@
package com.android.settings.enterprise;
import android.Manifest;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.ApplicationFeatureProvider;
import com.android.settings.dashboard.DashboardFragment;
@@ -73,7 +73,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ENTERPRISE_PRIVACY_PERMISSIONS;
+ return SettingsEnums.ENTERPRISE_PRIVACY_PERMISSIONS;
}
}
@@ -102,7 +102,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ENTERPRISE_PRIVACY_INSTALLED_APPS;
+ return SettingsEnums.ENTERPRISE_PRIVACY_INSTALLED_APPS;
}
@Override
diff --git a/src/com/android/settings/enterprise/EnterprisePrivacySettings.java b/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
index dab1395..c5beb86 100644
--- a/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
+++ b/src/com/android/settings/enterprise/EnterprisePrivacySettings.java
@@ -16,10 +16,10 @@
package com.android.settings.enterprise;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.overlay.FeatureFactory;
@@ -39,7 +39,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ENTERPRISE_PRIVACY_SETTINGS;
+ return SettingsEnums.ENTERPRISE_PRIVACY_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragment.java b/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragment.java
index 1788c33..67bf687 100644
--- a/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragment.java
+++ b/src/com/android/settings/enterprise/EnterpriseSetDefaultAppsListFragment.java
@@ -16,9 +16,9 @@
package com.android.settings.enterprise;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -34,7 +34,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ENTERPRISE_PRIVACY_DEFAULT_APPS;
+ return SettingsEnums.ENTERPRISE_PRIVACY_DEFAULT_APPS;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
index 6ad50a9..e19cfb8 100644
--- a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
+++ b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java
@@ -19,6 +19,7 @@
import android.annotation.UserIdInt;
import android.app.Activity;
import android.app.ActivityManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -32,7 +33,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.os.BatterySipper;
import com.android.internal.os.BatteryStatsHelper;
import com.android.internal.util.ArrayUtils;
@@ -258,7 +258,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FUELGAUGE_POWER_USAGE_DETAIL;
+ return SettingsEnums.FUELGAUGE_POWER_USAGE_DETAIL;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/BatterySaverController.java b/src/com/android/settings/fuelgauge/BatterySaverController.java
index cd32c6c..c4ed88b 100644
--- a/src/com/android/settings/fuelgauge/BatterySaverController.java
+++ b/src/com/android/settings/fuelgauge/BatterySaverController.java
@@ -22,8 +22,8 @@
import android.os.Looper;
import android.os.PowerManager;
import android.provider.Settings;
-
import android.provider.Settings.Global;
+
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
diff --git a/src/com/android/settings/fuelgauge/HighPowerDetail.java b/src/com/android/settings/fuelgauge/HighPowerDetail.java
index 3102973..a7a9812 100644
--- a/src/com/android/settings/fuelgauge/HighPowerDetail.java
+++ b/src/com/android/settings/fuelgauge/HighPowerDetail.java
@@ -18,6 +18,7 @@
import android.app.AppOpsManager;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@@ -32,7 +33,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.applications.AppInfoBase;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -62,7 +62,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_HIGH_POWER_DETAILS;
+ return SettingsEnums.DIALOG_HIGH_POWER_DETAILS;
}
@Override
@@ -153,8 +153,8 @@
@VisibleForTesting
static void logSpecialPermissionChange(boolean whitelist, String packageName, Context context) {
- int logCategory = whitelist ? MetricsProto.MetricsEvent.APP_SPECIAL_PERMISSION_BATTERY_DENY
- : MetricsProto.MetricsEvent.APP_SPECIAL_PERMISSION_BATTERY_ALLOW;
+ int logCategory = whitelist ? SettingsEnums.APP_SPECIAL_PERMISSION_BATTERY_DENY
+ : SettingsEnums.APP_SPECIAL_PERMISSION_BATTERY_ALLOW;
FeatureFactory.getFactory(context).getMetricsFeatureProvider().action(context, logCategory,
packageName);
}
diff --git a/src/com/android/settings/fuelgauge/InactiveApps.java b/src/com/android/settings/fuelgauge/InactiveApps.java
index cb419ca..fdfcaab 100644
--- a/src/com/android/settings/fuelgauge/InactiveApps.java
+++ b/src/com/android/settings/fuelgauge/InactiveApps.java
@@ -23,6 +23,7 @@
import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_RARE;
import static android.app.usage.UsageStatsManager.STANDBY_BUCKET_WORKING_SET;
+import android.app.settings.SettingsEnums;
import android.app.usage.UsageStatsManager;
import android.content.Context;
import android.content.Intent;
@@ -35,7 +36,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceGroup;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -58,7 +58,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FUELGAUGE_INACTIVE_APPS;
+ return SettingsEnums.FUELGAUGE_INACTIVE_APPS;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java b/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
index a4ae1ac..669d7ed 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
@@ -15,6 +15,7 @@
import static com.android.settings.fuelgauge.BatteryBroadcastReceiver.BatteryUpdateType;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -27,7 +28,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.overlay.FeatureFactory;
@@ -81,7 +81,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FUELGAUGE_BATTERY_HISTORY_DETAIL;
+ return SettingsEnums.FUELGAUGE_BATTERY_HISTORY_DETAIL;
}
@Override
@@ -108,7 +108,7 @@
mShowAllApps = !mShowAllApps;
item.setTitle(mShowAllApps ? R.string.hide_extra_apps : R.string.show_all_apps);
mMetricsFeatureProvider.action(getContext(),
- MetricsProto.MetricsEvent.ACTION_SETTINGS_MENU_BATTERY_APPS_TOGGLE,
+ SettingsEnums.ACTION_SETTINGS_MENU_BATTERY_APPS_TOGGLE,
mShowAllApps);
restartBatteryStatsLoader(BatteryUpdateType.MANUAL);
return true;
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 85aa915..75db215 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -18,6 +18,7 @@
import static com.android.settings.fuelgauge.BatteryBroadcastReceiver.BatteryUpdateType;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.BatteryStats;
import android.os.Bundle;
@@ -35,7 +36,6 @@
import androidx.loader.app.LoaderManager.LoaderCallbacks;
import androidx.loader.content.Loader;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
@@ -225,7 +225,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FUELGAUGE_POWER_USAGE_SUMMARY_V2;
+ return SettingsEnums.FUELGAUGE_POWER_USAGE_SUMMARY_V2;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/RestrictedAppDetails.java b/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
index 0906a5d..6722b4a 100644
--- a/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
+++ b/src/com/android/settings/fuelgauge/RestrictedAppDetails.java
@@ -16,6 +16,7 @@
package com.android.settings.fuelgauge;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
@@ -30,7 +31,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceGroup;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.core.InstrumentedPreferenceFragment;
@@ -132,7 +132,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FUELGAUGE_RESTRICTED_APP_DETAILS;
+ return SettingsEnums.FUELGAUGE_RESTRICTED_APP_DETAILS;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/SmartBatterySettings.java b/src/com/android/settings/fuelgauge/SmartBatterySettings.java
index 7076001..5fddbac 100644
--- a/src/com/android/settings/fuelgauge/SmartBatterySettings.java
+++ b/src/com/android/settings/fuelgauge/SmartBatterySettings.java
@@ -16,11 +16,11 @@
package com.android.settings.fuelgauge;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.core.InstrumentedPreferenceFragment;
@@ -48,7 +48,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FUELGAUGE_SMART_BATTERY;
+ return SettingsEnums.FUELGAUGE_SMART_BATTERY;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSchedulePreferenceController.java b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSchedulePreferenceController.java
index 868c73f..2cc73d1 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSchedulePreferenceController.java
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSchedulePreferenceController.java
@@ -20,9 +20,11 @@
import android.os.PowerManager;
import android.provider.Settings;
import android.provider.Settings.Global;
+
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.core.BasePreferenceController;
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSeekBarController.java b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSeekBarController.java
index 6c11576..6253947 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSeekBarController.java
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSeekBarController.java
@@ -20,9 +20,11 @@
import android.os.PowerManager;
import android.provider.Settings;
import android.provider.Settings.Global;
+
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.PreferenceScreen;
+
import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.Utils;
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSettings.java b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSettings.java
index bfd36f3..3f8716d 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSettings.java
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverScheduleSettings.java
@@ -23,15 +23,19 @@
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
+
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.PreferenceScreen;
-import com.android.settings.widget.RadioButtonPickerFragment;
+
import com.android.settings.R;
+import com.android.settings.widget.RadioButtonPickerFragment;
import com.android.settings.widget.RadioButtonPreference;
import com.android.settingslib.fuelgauge.BatterySaverUtils;
import com.android.settingslib.widget.CandidateInfo;
+
import com.google.common.collect.Lists;
+
import java.util.List;
/**
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
index 6aef9b5..6435468 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverSettings.java
@@ -16,20 +16,17 @@
package com.android.settings.fuelgauge.batterysaver;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
-import com.android.settingslib.core.AbstractPreferenceController;
-import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.search.SearchIndexable;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -47,7 +44,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.FUELGAUGE_BATTERY_SAVER;
+ return SettingsEnums.FUELGAUGE_BATTERY_SAVER;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java b/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java
index 2534d08..8b57234 100644
--- a/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java
+++ b/src/com/android/settings/fuelgauge/batterytip/AnomalyDetectionJobService.java
@@ -40,7 +40,6 @@
import androidx.annotation.GuardedBy;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.util.ArrayUtils;
import com.android.settings.R;
import com.android.settings.fuelgauge.BatteryUtils;
@@ -154,7 +153,7 @@
final String versionedPackage = packageName + "/" + versionCode;
if (batteryUtils.shouldHideAnomaly(powerWhitelistBackend, uid, anomalyInfo)) {
metricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsProto.MetricsEvent.ACTION_ANOMALY_IGNORED,
+ SettingsEnums.ACTION_ANOMALY_IGNORED,
SettingsEnums.PAGE_UNKNOWN,
versionedPackage,
anomalyInfo.anomalyType);
@@ -172,7 +171,7 @@
timeMs);
}
metricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsProto.MetricsEvent.ACTION_ANOMALY_TRIGGERED,
+ SettingsEnums.ACTION_ANOMALY_TRIGGERED,
SettingsEnums.PAGE_UNKNOWN,
versionedPackage,
anomalyInfo.anomalyType);
diff --git a/src/com/android/settings/fuelgauge/batterytip/BatteryDatabaseManager.java b/src/com/android/settings/fuelgauge/batterytip/BatteryDatabaseManager.java
index 5fa952c..f75588c 100644
--- a/src/com/android/settings/fuelgauge/batterytip/BatteryDatabaseManager.java
+++ b/src/com/android/settings/fuelgauge/batterytip/BatteryDatabaseManager.java
@@ -19,14 +19,10 @@
import static android.database.sqlite.SQLiteDatabase.CONFLICT_IGNORE;
import static android.database.sqlite.SQLiteDatabase.CONFLICT_REPLACE;
-import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns
- .ANOMALY_STATE;
-import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns
- .ANOMALY_TYPE;
-import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns
- .PACKAGE_NAME;
-import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns
- .TIME_STAMP_MS;
+import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns.ANOMALY_STATE;
+import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns.ANOMALY_TYPE;
+import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns.PACKAGE_NAME;
+import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns.TIME_STAMP_MS;
import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.AnomalyColumns.UID;
import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.Tables.TABLE_ACTION;
import static com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper.Tables.TABLE_ANOMALY;
diff --git a/src/com/android/settings/fuelgauge/batterytip/BatteryTipDialogFragment.java b/src/com/android/settings/fuelgauge/batterytip/BatteryTipDialogFragment.java
index dc79835..58038cd 100644
--- a/src/com/android/settings/fuelgauge/batterytip/BatteryTipDialogFragment.java
+++ b/src/com/android/settings/fuelgauge/batterytip/BatteryTipDialogFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.fuelgauge.batterytip;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -27,7 +28,6 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
@@ -145,7 +145,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.FUELGAUGE_BATTERY_TIP_DIALOG;
+ return SettingsEnums.FUELGAUGE_BATTERY_TIP_DIALOG;
}
@Override
diff --git a/src/com/android/settings/fuelgauge/batterytip/actions/BatterySaverAction.java b/src/com/android/settings/fuelgauge/batterytip/actions/BatterySaverAction.java
index 6eff47a..0a92215 100644
--- a/src/com/android/settings/fuelgauge/batterytip/actions/BatterySaverAction.java
+++ b/src/com/android/settings/fuelgauge/batterytip/actions/BatterySaverAction.java
@@ -16,9 +16,9 @@
package com.android.settings.fuelgauge.batterytip.actions;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.fuelgauge.BatterySaverUtils;
public class BatterySaverAction extends BatteryTipAction {
@@ -33,6 +33,6 @@
public void handlePositiveAction(int metricsKey) {
BatterySaverUtils.setPowerSaveMode(mContext, true, /*needFirstTimeWarning*/ true);
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_TIP_TURN_ON_BATTERY_SAVER, metricsKey);
+ SettingsEnums.ACTION_TIP_TURN_ON_BATTERY_SAVER, metricsKey);
}
}
diff --git a/src/com/android/settings/fuelgauge/batterytip/actions/OpenBatterySaverAction.java b/src/com/android/settings/fuelgauge/batterytip/actions/OpenBatterySaverAction.java
index 236413e..1bc2ebf 100644
--- a/src/com/android/settings/fuelgauge/batterytip/actions/OpenBatterySaverAction.java
+++ b/src/com/android/settings/fuelgauge/batterytip/actions/OpenBatterySaverAction.java
@@ -16,9 +16,9 @@
package com.android.settings.fuelgauge.batterytip.actions;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.fuelgauge.batterysaver.BatterySaverSettings;
@@ -38,7 +38,7 @@
@Override
public void handlePositiveAction(int metricsKey) {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_TIP_OPEN_BATTERY_SAVER_PAGE, metricsKey);
+ SettingsEnums.ACTION_TIP_OPEN_BATTERY_SAVER_PAGE, metricsKey);
new SubSettingLauncher(mContext)
.setDestination(BatterySaverSettings.class.getName())
.setSourceMetricsCategory(metricsKey)
diff --git a/src/com/android/settings/fuelgauge/batterytip/actions/OpenRestrictAppFragmentAction.java b/src/com/android/settings/fuelgauge/batterytip/actions/OpenRestrictAppFragmentAction.java
index 9d35615..f0d9f28 100644
--- a/src/com/android/settings/fuelgauge/batterytip/actions/OpenRestrictAppFragmentAction.java
+++ b/src/com/android/settings/fuelgauge/batterytip/actions/OpenRestrictAppFragmentAction.java
@@ -16,9 +16,10 @@
package com.android.settings.fuelgauge.batterytip.actions;
+import android.app.settings.SettingsEnums;
+
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.InstrumentedPreferenceFragment;
import com.android.settings.fuelgauge.RestrictedAppDetails;
import com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper;
@@ -52,7 +53,7 @@
@Override
public void handlePositiveAction(int metricsKey) {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_TIP_OPEN_APP_RESTRICTION_PAGE, metricsKey);
+ SettingsEnums.ACTION_TIP_OPEN_APP_RESTRICTION_PAGE, metricsKey);
final List<AppInfo> mAppInfos = mRestrictAppTip.getRestrictAppList();
RestrictedAppDetails.startRestrictedAppDetails(mFragment, mAppInfos);
diff --git a/src/com/android/settings/fuelgauge/batterytip/actions/RestrictAppAction.java b/src/com/android/settings/fuelgauge/batterytip/actions/RestrictAppAction.java
index d52a967..33ac5df 100644
--- a/src/com/android/settings/fuelgauge/batterytip/actions/RestrictAppAction.java
+++ b/src/com/android/settings/fuelgauge/batterytip/actions/RestrictAppAction.java
@@ -22,7 +22,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.util.CollectionUtils;
import com.android.settings.fuelgauge.BatteryUtils;
import com.android.settings.fuelgauge.batterytip.AnomalyDatabaseHelper;
@@ -65,14 +64,14 @@
if (CollectionUtils.isEmpty(appInfo.anomalyTypes)) {
// Only log context if there is no anomaly type
mMetricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsProto.MetricsEvent.ACTION_TIP_RESTRICT_APP,
+ SettingsEnums.ACTION_TIP_RESTRICT_APP,
metricsKey,
packageName,
0);
} else {
for (int type : appInfo.anomalyTypes) {
mMetricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsProto.MetricsEvent.ACTION_TIP_RESTRICT_APP,
+ SettingsEnums.ACTION_TIP_RESTRICT_APP,
metricsKey,
packageName,
type);
diff --git a/src/com/android/settings/fuelgauge/batterytip/actions/SmartBatteryAction.java b/src/com/android/settings/fuelgauge/batterytip/actions/SmartBatteryAction.java
index 10a09c5..f6b9c94 100644
--- a/src/com/android/settings/fuelgauge/batterytip/actions/SmartBatteryAction.java
+++ b/src/com/android/settings/fuelgauge/batterytip/actions/SmartBatteryAction.java
@@ -16,9 +16,10 @@
package com.android.settings.fuelgauge.batterytip.actions;
+import android.app.settings.SettingsEnums;
+
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.core.SubSettingLauncher;
@@ -41,7 +42,7 @@
@Override
public void handlePositiveAction(int metricsKey) {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_TIP_OPEN_SMART_BATTERY, metricsKey);
+ SettingsEnums.ACTION_TIP_OPEN_SMART_BATTERY, metricsKey);
new SubSettingLauncher(mSettingsActivity)
.setSourceMetricsCategory(mFragment instanceof Instrumentable
? ((Instrumentable) mFragment).getMetricsCategory()
diff --git a/src/com/android/settings/fuelgauge/batterytip/actions/UnrestrictAppAction.java b/src/com/android/settings/fuelgauge/batterytip/actions/UnrestrictAppAction.java
index db882e5..0ef2c0f 100644
--- a/src/com/android/settings/fuelgauge/batterytip/actions/UnrestrictAppAction.java
+++ b/src/com/android/settings/fuelgauge/batterytip/actions/UnrestrictAppAction.java
@@ -22,7 +22,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.fuelgauge.BatteryUtils;
import com.android.settings.fuelgauge.batterytip.AppInfo;
import com.android.settings.fuelgauge.batterytip.tips.UnrestrictAppTip;
@@ -52,7 +51,7 @@
AppOpsManager.MODE_ALLOWED);
mMetricsFeatureProvider.action(
SettingsEnums.PAGE_UNKNOWN,
- MetricsProto.MetricsEvent.ACTION_TIP_UNRESTRICT_APP,
+ SettingsEnums.ACTION_TIP_UNRESTRICT_APP,
metricsKey,
appInfo.packageName,
0);
diff --git a/src/com/android/settings/fuelgauge/batterytip/tips/BatteryTip.java b/src/com/android/settings/fuelgauge/batterytip/tips/BatteryTip.java
index de71ab2..54eb913 100644
--- a/src/com/android/settings/fuelgauge/batterytip/tips/BatteryTip.java
+++ b/src/com/android/settings/fuelgauge/batterytip/tips/BatteryTip.java
@@ -26,7 +26,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
-import com.android.settings.widget.CardPreference;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import java.lang.annotation.Retention;
diff --git a/src/com/android/settings/fuelgauge/batterytip/tips/EarlyWarningTip.java b/src/com/android/settings/fuelgauge/batterytip/tips/EarlyWarningTip.java
index 28065fd..7674c09 100644
--- a/src/com/android/settings/fuelgauge/batterytip/tips/EarlyWarningTip.java
+++ b/src/com/android/settings/fuelgauge/batterytip/tips/EarlyWarningTip.java
@@ -16,10 +16,10 @@
package com.android.settings.fuelgauge.batterytip.tips;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Parcel;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -79,7 +79,7 @@
@Override
public void log(Context context, MetricsFeatureProvider metricsFeatureProvider) {
- metricsFeatureProvider.action(context, MetricsProto.MetricsEvent.ACTION_EARLY_WARNING_TIP,
+ metricsFeatureProvider.action(context, SettingsEnums.ACTION_EARLY_WARNING_TIP,
mState);
}
diff --git a/src/com/android/settings/fuelgauge/batterytip/tips/HighUsageTip.java b/src/com/android/settings/fuelgauge/batterytip/tips/HighUsageTip.java
index 356097d..0a7b1ab 100644
--- a/src/com/android/settings/fuelgauge/batterytip/tips/HighUsageTip.java
+++ b/src/com/android/settings/fuelgauge/batterytip/tips/HighUsageTip.java
@@ -16,13 +16,13 @@
package com.android.settings.fuelgauge.batterytip.tips;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.fuelgauge.batterytip.AppInfo;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -81,12 +81,12 @@
@Override
public void log(Context context, MetricsFeatureProvider metricsFeatureProvider) {
- metricsFeatureProvider.action(context, MetricsProto.MetricsEvent.ACTION_HIGH_USAGE_TIP,
+ metricsFeatureProvider.action(context, SettingsEnums.ACTION_HIGH_USAGE_TIP,
mState);
for (int i = 0, size = mHighUsageAppList.size(); i < size; i++) {
final AppInfo appInfo = mHighUsageAppList.get(i);
metricsFeatureProvider.action(context,
- MetricsProto.MetricsEvent.ACTION_HIGH_USAGE_TIP_LIST,
+ SettingsEnums.ACTION_HIGH_USAGE_TIP_LIST,
appInfo.packageName);
}
}
diff --git a/src/com/android/settings/fuelgauge/batterytip/tips/LowBatteryTip.java b/src/com/android/settings/fuelgauge/batterytip/tips/LowBatteryTip.java
index b48a7dd..d7acdd2 100644
--- a/src/com/android/settings/fuelgauge/batterytip/tips/LowBatteryTip.java
+++ b/src/com/android/settings/fuelgauge/batterytip/tips/LowBatteryTip.java
@@ -16,11 +16,11 @@
package com.android.settings.fuelgauge.batterytip.tips;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -55,7 +55,7 @@
@Override
public void log(Context context, MetricsFeatureProvider metricsFeatureProvider) {
- metricsFeatureProvider.action(context, MetricsProto.MetricsEvent.ACTION_LOW_BATTERY_TIP,
+ metricsFeatureProvider.action(context, SettingsEnums.ACTION_LOW_BATTERY_TIP,
mState);
}
diff --git a/src/com/android/settings/fuelgauge/batterytip/tips/RestrictAppTip.java b/src/com/android/settings/fuelgauge/batterytip/tips/RestrictAppTip.java
index f166734..1bd760b 100644
--- a/src/com/android/settings/fuelgauge/batterytip/tips/RestrictAppTip.java
+++ b/src/com/android/settings/fuelgauge/batterytip/tips/RestrictAppTip.java
@@ -24,7 +24,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.fuelgauge.batterytip.AppInfo;
@@ -120,14 +119,14 @@
@Override
public void log(Context context, MetricsFeatureProvider metricsFeatureProvider) {
- metricsFeatureProvider.action(context, MetricsProto.MetricsEvent.ACTION_APP_RESTRICTION_TIP,
+ metricsFeatureProvider.action(context, SettingsEnums.ACTION_APP_RESTRICTION_TIP,
mState);
if (mState == StateType.NEW) {
for (int i = 0, size = mRestrictAppList.size(); i < size; i++) {
final AppInfo appInfo = mRestrictAppList.get(i);
for (Integer anomalyType : appInfo.anomalyTypes) {
metricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsProto.MetricsEvent.ACTION_APP_RESTRICTION_TIP_LIST,
+ SettingsEnums.ACTION_APP_RESTRICTION_TIP_LIST,
SettingsEnums.PAGE_UNKNOWN,
appInfo.packageName,
anomalyType);
diff --git a/src/com/android/settings/fuelgauge/batterytip/tips/SmartBatteryTip.java b/src/com/android/settings/fuelgauge/batterytip/tips/SmartBatteryTip.java
index e8dc6a9..106766f 100644
--- a/src/com/android/settings/fuelgauge/batterytip/tips/SmartBatteryTip.java
+++ b/src/com/android/settings/fuelgauge/batterytip/tips/SmartBatteryTip.java
@@ -16,10 +16,10 @@
package com.android.settings.fuelgauge.batterytip.tips;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Parcel;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -58,7 +58,7 @@
@Override
public void log(Context context, MetricsFeatureProvider metricsFeatureProvider) {
- metricsFeatureProvider.action(context, MetricsProto.MetricsEvent.ACTION_SMART_BATTERY_TIP,
+ metricsFeatureProvider.action(context, SettingsEnums.ACTION_SMART_BATTERY_TIP,
mState);
}
diff --git a/src/com/android/settings/fuelgauge/batterytip/tips/SummaryTip.java b/src/com/android/settings/fuelgauge/batterytip/tips/SummaryTip.java
index 0e2e8b5..aec6456 100644
--- a/src/com/android/settings/fuelgauge/batterytip/tips/SummaryTip.java
+++ b/src/com/android/settings/fuelgauge/batterytip/tips/SummaryTip.java
@@ -16,13 +16,13 @@
package com.android.settings.fuelgauge.batterytip.tips;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -71,7 +71,7 @@
@Override
public void log(Context context, MetricsFeatureProvider metricsFeatureProvider) {
- metricsFeatureProvider.action(context, MetricsProto.MetricsEvent.ACTION_SUMMARY_TIP,
+ metricsFeatureProvider.action(context, SettingsEnums.ACTION_SUMMARY_TIP,
mState);
}
diff --git a/src/com/android/settings/gestures/AssistGestureSettings.java b/src/com/android/settings/gestures/AssistGestureSettings.java
index bbd148c..b67fd65 100644
--- a/src/com/android/settings/gestures/AssistGestureSettings.java
+++ b/src/com/android/settings/gestures/AssistGestureSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.overlay.FeatureFactory;
@@ -39,7 +39,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_ASSIST_GESTURE;
+ return SettingsEnums.SETTINGS_ASSIST_GESTURE;
}
@Override
diff --git a/src/com/android/settings/gestures/DoubleTapPowerSettings.java b/src/com/android/settings/gestures/DoubleTapPowerSettings.java
index 8afd2c1..acabdbc 100644
--- a/src/com/android/settings/gestures/DoubleTapPowerSettings.java
+++ b/src/com/android/settings/gestures/DoubleTapPowerSettings.java
@@ -16,11 +16,11 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
@@ -50,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GESTURE_DOUBLE_TAP_POWER;
+ return SettingsEnums.SETTINGS_GESTURE_DOUBLE_TAP_POWER;
}
@Override
diff --git a/src/com/android/settings/gestures/DoubleTapScreenSettings.java b/src/com/android/settings/gestures/DoubleTapScreenSettings.java
index 496a45d..8122504 100644
--- a/src/com/android/settings/gestures/DoubleTapScreenSettings.java
+++ b/src/com/android/settings/gestures/DoubleTapScreenSettings.java
@@ -16,12 +16,12 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.SearchIndexableResource;
import com.android.internal.hardware.AmbientDisplayConfiguration;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
@@ -54,7 +54,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GESTURE_DOUBLE_TAP_SCREEN;
+ return SettingsEnums.SETTINGS_GESTURE_DOUBLE_TAP_SCREEN;
}
@Override
diff --git a/src/com/android/settings/gestures/DoubleTwistGestureSettings.java b/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
index 145a06c..3481929 100644
--- a/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
+++ b/src/com/android/settings/gestures/DoubleTwistGestureSettings.java
@@ -16,11 +16,11 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
@@ -50,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GESTURE_DOUBLE_TWIST;
+ return SettingsEnums.SETTINGS_GESTURE_DOUBLE_TWIST;
}
@Override
diff --git a/src/com/android/settings/gestures/GestureSettings.java b/src/com/android/settings/gestures/GestureSettings.java
index c4911fe..c41d3c6 100644
--- a/src/com/android/settings/gestures/GestureSettings.java
+++ b/src/com/android/settings/gestures/GestureSettings.java
@@ -16,11 +16,11 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
import com.android.internal.hardware.AmbientDisplayConfiguration;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -38,7 +38,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GESTURES;
+ return SettingsEnums.SETTINGS_GESTURES;
}
@Override
diff --git a/src/com/android/settings/gestures/GesturesSettingPreferenceController.java b/src/com/android/settings/gestures/GesturesSettingPreferenceController.java
index 00b7a0c..9366a15 100644
--- a/src/com/android/settings/gestures/GesturesSettingPreferenceController.java
+++ b/src/com/android/settings/gestures/GesturesSettingPreferenceController.java
@@ -20,6 +20,8 @@
import android.content.Context;
import android.provider.Settings;
+import androidx.annotation.NonNull;
+
import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
@@ -29,8 +31,6 @@
import java.util.ArrayList;
import java.util.List;
-import androidx.annotation.NonNull;
-
public class GesturesSettingPreferenceController extends BasePreferenceController {
private final AssistGestureFeatureProvider mFeatureProvider;
private List<AbstractPreferenceController> mGestureControllers;
diff --git a/src/com/android/settings/gestures/PickupGestureSettings.java b/src/com/android/settings/gestures/PickupGestureSettings.java
index 05aba4e..6d47902 100644
--- a/src/com/android/settings/gestures/PickupGestureSettings.java
+++ b/src/com/android/settings/gestures/PickupGestureSettings.java
@@ -16,12 +16,12 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.SearchIndexableResource;
import com.android.internal.hardware.AmbientDisplayConfiguration;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
@@ -54,7 +54,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GESTURE_PICKUP;
+ return SettingsEnums.SETTINGS_GESTURE_PICKUP;
}
@Override
diff --git a/src/com/android/settings/gestures/PreventRingingGesturePreferenceController.java b/src/com/android/settings/gestures/PreventRingingGesturePreferenceController.java
index 8f037ce..d22e42a 100644
--- a/src/com/android/settings/gestures/PreventRingingGesturePreferenceController.java
+++ b/src/com/android/settings/gestures/PreventRingingGesturePreferenceController.java
@@ -24,6 +24,10 @@
import android.os.Handler;
import android.provider.Settings;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceScreen;
+
import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
@@ -37,10 +41,6 @@
import com.android.settingslib.core.lifecycle.events.OnResume;
import com.android.settingslib.core.lifecycle.events.OnSaveInstanceState;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceCategory;
-import androidx.preference.PreferenceScreen;
-
public class PreventRingingGesturePreferenceController extends AbstractPreferenceController
implements RadioButtonPreference.OnClickListener, LifecycleObserver, OnSaveInstanceState,
OnResume, OnPause, OnCreate, PreferenceControllerMixin {
diff --git a/src/com/android/settings/gestures/PreventRingingGestureSettings.java b/src/com/android/settings/gestures/PreventRingingGestureSettings.java
index 420a019..47cd3ea 100644
--- a/src/com/android/settings/gestures/PreventRingingGestureSettings.java
+++ b/src/com/android/settings/gestures/PreventRingingGestureSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -56,7 +56,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_PREVENT_RINGING;
+ return SettingsEnums.SETTINGS_PREVENT_RINGING;
}
@Override
diff --git a/src/com/android/settings/gestures/SwipeToNotificationSettings.java b/src/com/android/settings/gestures/SwipeToNotificationSettings.java
index 6090eb2..230cdda 100644
--- a/src/com/android/settings/gestures/SwipeToNotificationSettings.java
+++ b/src/com/android/settings/gestures/SwipeToNotificationSettings.java
@@ -16,11 +16,11 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
@@ -50,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GESTURE_SWIPE_TO_NOTIFICATION;
+ return SettingsEnums.SETTINGS_GESTURE_SWIPE_TO_NOTIFICATION;
}
@Override
diff --git a/src/com/android/settings/gestures/SwipeUpGestureSettings.java b/src/com/android/settings/gestures/SwipeUpGestureSettings.java
index 41a1aa4..a125643 100644
--- a/src/com/android/settings/gestures/SwipeUpGestureSettings.java
+++ b/src/com/android/settings/gestures/SwipeUpGestureSettings.java
@@ -16,11 +16,11 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
@@ -50,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GESTURE_SWIPE_UP;
+ return SettingsEnums.SETTINGS_GESTURE_SWIPE_UP;
}
@Override
diff --git a/src/com/android/settings/gestures/TapScreenGesturePreferenceController.java b/src/com/android/settings/gestures/TapScreenGesturePreferenceController.java
new file mode 100644
index 0000000..bbffc7c
--- /dev/null
+++ b/src/com/android/settings/gestures/TapScreenGesturePreferenceController.java
@@ -0,0 +1,89 @@
+/*
+ * 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.settings.gestures;
+
+import static android.provider.Settings.Secure.DOZE_TAP_SCREEN_GESTURE;
+
+import android.annotation.UserIdInt;
+import android.content.Context;
+import android.os.UserHandle;
+import android.provider.Settings;
+import android.text.TextUtils;
+
+import com.android.internal.hardware.AmbientDisplayConfiguration;
+
+public class TapScreenGesturePreferenceController extends GesturePreferenceController {
+
+ private static final String PREF_KEY_VIDEO = "gesture_tap_screen_video";
+
+ private AmbientDisplayConfiguration mAmbientConfig;
+ @UserIdInt
+ private final int mUserId;
+
+ public TapScreenGesturePreferenceController(Context context, String key) {
+ super(context, key);
+ mUserId = UserHandle.myUserId();
+ }
+
+ public TapScreenGesturePreferenceController setConfig(AmbientDisplayConfiguration config) {
+ mAmbientConfig = config;
+ return this;
+ }
+
+ @Override
+ public int getAvailabilityStatus() {
+ // No hardware support for this Gesture
+ if (!getAmbientConfig().tapSensorAvailable()) {
+ return UNSUPPORTED_ON_DEVICE;
+ }
+
+ return AVAILABLE;
+ }
+
+ @Override
+ public boolean isSliceable() {
+ return true;
+ }
+
+ @Override
+ protected String getVideoPrefKey() {
+ return PREF_KEY_VIDEO;
+ }
+
+ @Override
+ public CharSequence getSummary() {
+ return super.getSummary();
+ }
+
+ @Override
+ public boolean isChecked() {
+ return getAmbientConfig().tapGestureEnabled(mUserId);
+ }
+
+ @Override
+ public boolean setChecked(boolean isChecked) {
+ return Settings.Secure.putInt(mContext.getContentResolver(), DOZE_TAP_SCREEN_GESTURE,
+ isChecked ? 1 : 0);
+ }
+
+ private AmbientDisplayConfiguration getAmbientConfig() {
+ if (mAmbientConfig == null) {
+ mAmbientConfig = new AmbientDisplayConfiguration(mContext);
+ }
+ return mAmbientConfig;
+ }
+}
\ No newline at end of file
diff --git a/src/com/android/settings/gestures/TapScreenGestureSettings.java b/src/com/android/settings/gestures/TapScreenGestureSettings.java
new file mode 100644
index 0000000..d80c03d
--- /dev/null
+++ b/src/com/android/settings/gestures/TapScreenGestureSettings.java
@@ -0,0 +1,80 @@
+/*
+ * 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.settings.gestures;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.provider.SearchIndexableResource;
+
+import com.android.internal.hardware.AmbientDisplayConfiguration;
+import com.android.internal.logging.nano.MetricsProto;
+import com.android.settings.R;
+import com.android.settings.dashboard.DashboardFragment;
+import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
+import com.android.settingslib.search.SearchIndexable;
+
+import java.util.Arrays;
+import java.util.List;
+
+@SearchIndexable
+public class TapScreenGestureSettings extends DashboardFragment {
+ private static final String TAG = "TapScreenGestureSettings";
+
+ public static final String PREF_KEY_SUGGESTION_COMPLETE =
+ "pref_tap_gesture_suggestion_complete";
+
+ @Override
+ public void onAttach(Context context) {
+ super.onAttach(context);
+ SuggestionFeatureProvider suggestionFeatureProvider = FeatureFactory.getFactory(context)
+ .getSuggestionFeatureProvider(context);
+ SharedPreferences prefs = suggestionFeatureProvider.getSharedPrefs(context);
+ prefs.edit().putBoolean(PREF_KEY_SUGGESTION_COMPLETE, true).apply();
+
+ use(TapScreenGesturePreferenceController.class)
+ .setConfig(new AmbientDisplayConfiguration(context));
+ }
+
+ @Override
+ public int getMetricsCategory() {
+ return MetricsProto.MetricsEvent.SETTINGS_GESTURE_TAP_SCREEN;
+ }
+
+ @Override
+ protected String getLogTag() {
+ return TAG;
+ }
+
+ @Override
+ protected int getPreferenceScreenResId() {
+ return R.xml.tap_screen_gesture_settings;
+ }
+
+ public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+ new BaseSearchIndexProvider() {
+ @Override
+ public List<SearchIndexableResource> getXmlResourcesToIndex(
+ Context context, boolean enabled) {
+ final SearchIndexableResource sir = new SearchIndexableResource(context);
+ sir.xmlResId = R.xml.tap_screen_gesture_settings;
+ return Arrays.asList(sir);
+ }
+ };
+}
diff --git a/src/com/android/settings/gestures/WakeLockScreenGestureSettings.java b/src/com/android/settings/gestures/WakeLockScreenGestureSettings.java
index e6b7265..0fbdaa1 100644
--- a/src/com/android/settings/gestures/WakeLockScreenGestureSettings.java
+++ b/src/com/android/settings/gestures/WakeLockScreenGestureSettings.java
@@ -16,12 +16,12 @@
package com.android.settings.gestures;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.SearchIndexableResource;
import com.android.internal.hardware.AmbientDisplayConfiguration;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
@@ -54,7 +54,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_GESTURE_WAKE_LOCK_SCREEN;
+ return SettingsEnums.SETTINGS_GESTURE_WAKE_LOCK_SCREEN;
}
@Override
diff --git a/src/com/android/settings/homepage/TopLevelSettings.java b/src/com/android/settings/homepage/TopLevelSettings.java
index 8f70b2b..f5dee0c 100644
--- a/src/com/android/settings/homepage/TopLevelSettings.java
+++ b/src/com/android/settings/homepage/TopLevelSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.homepage;
-import static com.android.settings.search.actionbar.SearchMenuController
- .NEED_SEARCH_ICON_IN_ACTION_BAR;
+import static com.android.settings.search.actionbar.SearchMenuController.NEED_SEARCH_ICON_IN_ACTION_BAR;
import static com.android.settingslib.search.SearchIndexable.MOBILE;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
@@ -28,7 +28,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.dashboard.DashboardFragment;
@@ -65,7 +64,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DASHBOARD_SUMMARY;
+ return SettingsEnums.DASHBOARD_SUMMARY;
}
@Override
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/AirplaneModeConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/AirplaneModeConditionController.java
index a4a5a7a..2f55b3f 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/AirplaneModeConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/AirplaneModeConditionController.java
@@ -16,6 +16,7 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -23,7 +24,6 @@
import android.net.ConnectivityManager;
import android.provider.Settings;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.homepage.contextualcards.ContextualCard;
import com.android.settingslib.WirelessUtils;
@@ -72,7 +72,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_AIRPLANE_MODE)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_AIRPLANE_MODE)
.setActionText(mAppContext.getText(R.string.condition_turn_off))
.setName(mAppContext.getPackageName() + "/"
+ mAppContext.getText(R.string.condition_airplane_title))
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/BackgroundDataConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/BackgroundDataConditionController.java
index 550dfc0..419e5c6 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/BackgroundDataConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/BackgroundDataConditionController.java
@@ -16,11 +16,11 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.NetworkPolicyManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Settings;
import com.android.settings.homepage.contextualcards.ContextualCard;
@@ -66,7 +66,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_BACKGROUND_DATA)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_BACKGROUND_DATA)
.setActionText(mAppContext.getText(R.string.condition_turn_off))
.setName(mAppContext.getPackageName() + "/"
+ mAppContext.getText(R.string.condition_bg_data_title))
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/BatterySaverConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/BatterySaverConditionController.java
index 73aa588..b90c1b5 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/BatterySaverConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/BatterySaverConditionController.java
@@ -16,10 +16,10 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.PowerManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.fuelgauge.BatterySaverReceiver;
@@ -60,7 +60,7 @@
public void onPrimaryClick(Context context) {
new SubSettingLauncher(context)
.setDestination(BatterySaverSettings.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.DASHBOARD_SUMMARY)
+ .setSourceMetricsCategory(SettingsEnums.DASHBOARD_SUMMARY)
.setTitleRes(R.string.battery_saver)
.launch();
}
@@ -75,7 +75,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_BATTERY_SAVER)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_BATTERY_SAVER)
.setActionText(mAppContext.getText(R.string.condition_turn_off))
.setName(mAppContext.getPackageName() + "/"
+ mAppContext.getText(R.string.condition_battery_title))
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/CellularDataConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/CellularDataConditionController.java
index f512d92..93b937b 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/CellularDataConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/CellularDataConditionController.java
@@ -16,6 +16,7 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -23,7 +24,6 @@
import android.net.ConnectivityManager;
import android.telephony.TelephonyManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.telephony.TelephonyIntents;
import com.android.settings.R;
import com.android.settings.Settings;
@@ -82,7 +82,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_CELLULAR_DATA)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_CELLULAR_DATA)
.setActionText(mAppContext.getText(R.string.condition_turn_on))
.setName(mAppContext.getPackageName() + "/"
+ mAppContext.getText(R.string.condition_cellular_title))
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/ConditionContextualCardRenderer.java b/src/com/android/settings/homepage/contextualcards/conditional/ConditionContextualCardRenderer.java
index fc936bc..18019a6 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/ConditionContextualCardRenderer.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/ConditionContextualCardRenderer.java
@@ -16,6 +16,7 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
@@ -26,7 +27,6 @@
import androidx.annotation.LayoutRes;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.homepage.contextualcards.ContextualCard;
import com.android.settings.homepage.contextualcards.ContextualCardRenderer;
@@ -64,7 +64,7 @@
final MetricsFeatureProvider metricsFeatureProvider = FeatureFactory.getFactory(
mContext).getMetricsFeatureProvider();
- metricsFeatureProvider.visible(mContext, MetricsProto.MetricsEvent.SETTINGS_HOMEPAGE,
+ metricsFeatureProvider.visible(mContext, SettingsEnums.SETTINGS_HOMEPAGE,
card.getMetricsConstant());
initializePrimaryClick(view, card, metricsFeatureProvider);
initializeView(view, card);
@@ -76,7 +76,7 @@
view.itemView.findViewById(R.id.content).setOnClickListener(
v -> {
metricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_SETTINGS_CONDITION_CLICK,
+ SettingsEnums.ACTION_SETTINGS_CONDITION_CLICK,
card.getMetricsConstant());
mControllerRendererPool.getController(mContext,
card.getCardType()).onPrimaryClick(card);
@@ -101,7 +101,7 @@
button.setOnClickListener(v -> {
final Context viewContext = v.getContext();
metricsFeatureProvider.action(
- viewContext, MetricsProto.MetricsEvent.ACTION_SETTINGS_CONDITION_BUTTON,
+ viewContext, SettingsEnums.ACTION_SETTINGS_CONDITION_BUTTON,
card.getMetricsConstant());
mControllerRendererPool.getController(mContext, card.getCardType())
.onActionClick(card);
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/ConditionFooterContextualCardRenderer.java b/src/com/android/settings/homepage/contextualcards/conditional/ConditionFooterContextualCardRenderer.java
index 53de541..a516e13b 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/ConditionFooterContextualCardRenderer.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/ConditionFooterContextualCardRenderer.java
@@ -23,7 +23,6 @@
import androidx.annotation.LayoutRes;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.homepage.contextualcards.ContextualCard;
import com.android.settings.homepage.contextualcards.ContextualCardRenderer;
@@ -55,7 +54,7 @@
mContext).getMetricsFeatureProvider();
holder.itemView.setOnClickListener(v -> {
metricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsProto.MetricsEvent.ACTION_SETTINGS_CONDITION_EXPAND,
+ SettingsEnums.ACTION_SETTINGS_CONDITION_EXPAND,
SettingsEnums.SETTINGS_HOMEPAGE,
null /* key */,
0 /* false */);
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/ConditionHeaderContextualCardRenderer.java b/src/com/android/settings/homepage/contextualcards/conditional/ConditionHeaderContextualCardRenderer.java
index d7fbee6..2aa8aca 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/ConditionHeaderContextualCardRenderer.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/ConditionHeaderContextualCardRenderer.java
@@ -26,7 +26,6 @@
import androidx.annotation.LayoutRes;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.homepage.contextualcards.ContextualCard;
import com.android.settings.homepage.contextualcards.ContextualCardRenderer;
@@ -68,7 +67,7 @@
});
view.itemView.setOnClickListener(v -> {
metricsFeatureProvider.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsProto.MetricsEvent.ACTION_SETTINGS_CONDITION_EXPAND,
+ SettingsEnums.ACTION_SETTINGS_CONDITION_EXPAND,
SettingsEnums.SETTINGS_HOMEPAGE,
null /* key */,
1 /* true */);
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/DndConditionCardController.java b/src/com/android/settings/homepage/contextualcards/conditional/DndConditionCardController.java
index 488280c..43ff537 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/DndConditionCardController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/DndConditionCardController.java
@@ -17,6 +17,7 @@
package com.android.settings.homepage.contextualcards.conditional;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -25,7 +26,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.homepage.contextualcards.ContextualCard;
@@ -78,7 +78,7 @@
public void onPrimaryClick(Context context) {
new SubSettingLauncher(context)
.setDestination(ZenModeSettings.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.SETTINGS_HOMEPAGE)
+ .setSourceMetricsCategory(SettingsEnums.SETTINGS_HOMEPAGE)
.setTitleRes(R.string.zen_mode_settings_title)
.launch();
}
@@ -92,7 +92,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_DND)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_DND)
.setActionText(mAppContext.getText(R.string.condition_turn_off))
.setName(mAppContext.getPackageName() + "/"
+ mAppContext.getText(R.string.condition_zen_title))
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/HotspotConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/HotspotConditionController.java
index 1305c26..fe5bc93 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/HotspotConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/HotspotConditionController.java
@@ -16,6 +16,7 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -26,7 +27,6 @@
import android.os.UserHandle;
import android.os.UserManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.TetherSettings;
import com.android.settings.core.SubSettingLauncher;
@@ -69,7 +69,7 @@
public void onPrimaryClick(Context context) {
new SubSettingLauncher(context)
.setDestination(TetherSettings.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.DASHBOARD_SUMMARY)
+ .setSourceMetricsCategory(SettingsEnums.DASHBOARD_SUMMARY)
.setTitleRes(R.string.tether_settings_title_all)
.launch();
}
@@ -92,7 +92,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_HOTSPOT)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_HOTSPOT)
.setActionText(mAppContext.getText(R.string.condition_turn_off))
.setName(mAppContext.getPackageName() + "/"
+ mAppContext.getText(R.string.condition_hotspot_title))
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/NightDisplayConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/NightDisplayConditionController.java
index 09d3ba7..a673e46 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/NightDisplayConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/NightDisplayConditionController.java
@@ -16,10 +16,10 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import com.android.internal.app.ColorDisplayController;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.display.NightDisplaySettings;
@@ -55,7 +55,7 @@
public void onPrimaryClick(Context context) {
new SubSettingLauncher(context)
.setDestination(NightDisplaySettings.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.SETTINGS_HOMEPAGE)
+ .setSourceMetricsCategory(SettingsEnums.SETTINGS_HOMEPAGE)
.setTitleRes(R.string.night_display_title)
.launch();
}
@@ -69,7 +69,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_NIGHT_DISPLAY)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_NIGHT_DISPLAY)
.setActionText(mAppContext.getText(R.string.condition_turn_off))
.setName(mAppContext.getPackageName() + "/"
+ mAppContext.getText(R.string.condition_night_display_title))
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/RingerMutedConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/RingerMutedConditionController.java
index 38590f6..f800f92 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/RingerMutedConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/RingerMutedConditionController.java
@@ -16,10 +16,10 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.media.AudioManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.homepage.contextualcards.ContextualCard;
@@ -49,7 +49,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_DEVICE_MUTED)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_DEVICE_MUTED)
.setActionText(
mAppContext.getText(R.string.condition_device_muted_action_turn_on_sound))
.setName(mAppContext.getPackageName() + "/"
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/RingerVibrateConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/RingerVibrateConditionController.java
index eee364f..c193116 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/RingerVibrateConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/RingerVibrateConditionController.java
@@ -16,10 +16,10 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.media.AudioManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.homepage.contextualcards.ContextualCard;
@@ -50,7 +50,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_DEVICE_VIBRATE)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_DEVICE_VIBRATE)
.setActionText(
mAppContext.getText(R.string.condition_device_muted_action_turn_on_sound))
.setName(mAppContext.getPackageName() + "/"
diff --git a/src/com/android/settings/homepage/contextualcards/conditional/WorkModeConditionController.java b/src/com/android/settings/homepage/contextualcards/conditional/WorkModeConditionController.java
index 26616f0..4e901fd 100644
--- a/src/com/android/settings/homepage/contextualcards/conditional/WorkModeConditionController.java
+++ b/src/com/android/settings/homepage/contextualcards/conditional/WorkModeConditionController.java
@@ -16,6 +16,7 @@
package com.android.settings.homepage.contextualcards.conditional;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -25,7 +26,6 @@
import android.os.UserManager;
import android.text.TextUtils;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Settings;
import com.android.settings.homepage.contextualcards.ContextualCard;
@@ -86,7 +86,7 @@
public ContextualCard buildContextualCard() {
return new ConditionalContextualCard.Builder()
.setConditionId(ID)
- .setMetricsConstant(MetricsProto.MetricsEvent.SETTINGS_CONDITION_WORK_MODE)
+ .setMetricsConstant(SettingsEnums.SETTINGS_CONDITION_WORK_MODE)
.setActionText(mAppContext.getText(R.string.condition_turn_on))
.setName(mAppContext.getPackageName() + "/"
+ mAppContext.getText(R.string.condition_work_title))
diff --git a/src/com/android/settings/homepage/contextualcards/deviceinfo/BatteryInfoSlice.java b/src/com/android/settings/homepage/contextualcards/deviceinfo/BatteryInfoSlice.java
index 41095a4..6c7f930 100644
--- a/src/com/android/settings/homepage/contextualcards/deviceinfo/BatteryInfoSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/deviceinfo/BatteryInfoSlice.java
@@ -17,6 +17,7 @@
package com.android.settings.homepage.contextualcards.deviceinfo;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -29,7 +30,6 @@
import androidx.slice.builders.ListBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -94,7 +94,7 @@
final String screenTitle = mContext.getText(R.string.power_usage_summary_title).toString();
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
PowerUsageSummary.class.getName(), "" /* key */, screenTitle,
- MetricsProto.MetricsEvent.SLICE)
+ SettingsEnums.SLICE)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(CustomSliceRegistry.BATTERY_INFO_SLICE_URI);
}
diff --git a/src/com/android/settings/homepage/contextualcards/deviceinfo/DataUsageSlice.java b/src/com/android/settings/homepage/contextualcards/deviceinfo/DataUsageSlice.java
index 6e94f6d..419b770 100644
--- a/src/com/android/settings/homepage/contextualcards/deviceinfo/DataUsageSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/deviceinfo/DataUsageSlice.java
@@ -17,6 +17,7 @@
package com.android.settings.homepage.contextualcards.deviceinfo;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -32,7 +33,6 @@
import androidx.slice.builders.SliceAction;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -93,7 +93,7 @@
final String screenTitle = mContext.getText(R.string.data_usage_wifi_title).toString();
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
DataUsageSummary.class.getName(), "" /* key */, screenTitle,
- MetricsProto.MetricsEvent.SLICE)
+ SettingsEnums.SLICE)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(CustomSliceRegistry.DATA_USAGE_SLICE_URI);
}
diff --git a/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java b/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
index 1f75ab1..e278baa 100644
--- a/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/deviceinfo/DeviceInfoSlice.java
@@ -17,6 +17,7 @@
package com.android.settings.homepage.contextualcards.deviceinfo;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -32,7 +33,6 @@
import androidx.slice.builders.ListBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -84,7 +84,7 @@
final String screenTitle = mContext.getText(R.string.device_info_label).toString();
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
MyDeviceInfoFragment.class.getName(), "" /* key */, screenTitle,
- MetricsProto.MetricsEvent.SLICE)
+ SettingsEnums.SLICE)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(CustomSliceRegistry.DEVICE_INFO_SLICE_URI);
}
@@ -113,7 +113,7 @@
@VisibleForTesting
SubscriptionInfo getFirstSubscriptionInfo() {
final List<SubscriptionInfo> subscriptionInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subscriptionInfoList == null || subscriptionInfoList.isEmpty()) {
return null;
}
diff --git a/src/com/android/settings/homepage/contextualcards/deviceinfo/StorageSlice.java b/src/com/android/settings/homepage/contextualcards/deviceinfo/StorageSlice.java
index 799a701..d03b359 100644
--- a/src/com/android/settings/homepage/contextualcards/deviceinfo/StorageSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/deviceinfo/StorageSlice.java
@@ -17,6 +17,7 @@
package com.android.settings.homepage.contextualcards.deviceinfo;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -29,7 +30,6 @@
import androidx.slice.builders.SliceAction;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -79,7 +79,7 @@
final String screenTitle = mContext.getText(R.string.storage_label).toString();
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
StorageDashboardFragment.class.getName(), "" /* key */, screenTitle,
- MetricsProto.MetricsEvent.SLICE)
+ SettingsEnums.SLICE)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(CustomSliceRegistry.STORAGE_SLICE_URI);
}
diff --git a/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java b/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java
index c0cfb3f..5b5d474 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/BatteryFixSlice.java
@@ -21,6 +21,7 @@
import static com.android.settings.slices.CustomSliceRegistry.BATTERY_FIX_SLICE_URI;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -34,7 +35,6 @@
import androidx.slice.builders.ListBuilder.RowBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.os.BatteryStatsHelper;
import com.android.settings.R;
import com.android.settings.SubSettings;
@@ -125,7 +125,7 @@
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
PowerUsageSummary.class.getName(), BatteryTipPreferenceController.PREF_NAME,
screenTitle,
- MetricsProto.MetricsEvent.SLICE)
+ SettingsEnums.SLICE)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(contentUri);
}
diff --git a/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java b/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
index b2bec7f..03868ee 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/BluetoothDevicesSlice.java
@@ -36,7 +36,6 @@
import androidx.slice.builders.SliceAction;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -158,7 +157,7 @@
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
ConnectedDeviceDashboardFragment.class.getName(), "" /* key */,
screenTitle,
- MetricsProto.MetricsEvent.SLICE)
+ SettingsEnums.SLICE)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(getUri());
}
diff --git a/src/com/android/settings/homepage/contextualcards/slices/LowStorageSlice.java b/src/com/android/settings/homepage/contextualcards/slices/LowStorageSlice.java
index 03e4301..2bc09e9 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/LowStorageSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/LowStorageSlice.java
@@ -17,6 +17,7 @@
package com.android.settings.homepage.contextualcards.slices;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -29,7 +30,6 @@
import androidx.slice.builders.ListBuilder.RowBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -109,7 +109,7 @@
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
StorageSettings.class.getName(), "" /* key */,
screenTitle,
- MetricsProto.MetricsEvent.SLICE)
+ SettingsEnums.SLICE)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(CustomSliceRegistry.LOW_STORAGE_SLICE_URI);
}
diff --git a/src/com/android/settings/inputmethod/AvailableVirtualKeyboardFragment.java b/src/com/android/settings/inputmethod/AvailableVirtualKeyboardFragment.java
index 0410176..c8b5b6d 100644
--- a/src/com/android/settings/inputmethod/AvailableVirtualKeyboardFragment.java
+++ b/src/com/android/settings/inputmethod/AvailableVirtualKeyboardFragment.java
@@ -21,6 +21,7 @@
import android.annotation.Nullable;
import android.app.Activity;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
@@ -34,7 +35,6 @@
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -90,7 +90,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ENABLE_VIRTUAL_KEYBOARDS;
+ return SettingsEnums.ENABLE_VIRTUAL_KEYBOARDS;
}
@Nullable
diff --git a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
index f354089..38df8d7 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndSubtypeEnabler.java
@@ -16,12 +16,12 @@
package com.android.settings.inputmethod;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -31,7 +31,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.INPUTMETHOD_SUBTYPE_ENABLER;
+ return SettingsEnums.INPUTMETHOD_SUBTYPE_ENABLER;
}
@Override
diff --git a/src/com/android/settings/inputmethod/KeyboardLayoutDialogFragment.java b/src/com/android/settings/inputmethod/KeyboardLayoutDialogFragment.java
index 5618697..f91c9d8 100644
--- a/src/com/android/settings/inputmethod/KeyboardLayoutDialogFragment.java
+++ b/src/com/android/settings/inputmethod/KeyboardLayoutDialogFragment.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -40,7 +41,6 @@
import androidx.loader.content.AsyncTaskLoader;
import androidx.loader.content.Loader;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -66,7 +66,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_KEYBOARD_LAYOUT;
+ return SettingsEnums.DIALOG_KEYBOARD_LAYOUT;
}
@Override
diff --git a/src/com/android/settings/inputmethod/KeyboardLayoutPickerFragment.java b/src/com/android/settings/inputmethod/KeyboardLayoutPickerFragment.java
index 2c3f89b..a13ebc0 100644
--- a/src/com/android/settings/inputmethod/KeyboardLayoutPickerFragment.java
+++ b/src/com/android/settings/inputmethod/KeyboardLayoutPickerFragment.java
@@ -16,10 +16,10 @@
package com.android.settings.inputmethod;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.hardware.input.InputDeviceIdentifier;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -36,7 +36,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.INPUTMETHOD_KEYBOARD;
+ return SettingsEnums.INPUTMETHOD_KEYBOARD;
}
@Override
diff --git a/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java b/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java
index 8d45178..119571d 100644
--- a/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java
+++ b/src/com/android/settings/inputmethod/PhysicalKeyboardFragment.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
@@ -39,7 +40,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.util.Preconditions;
import com.android.settings.R;
import com.android.settings.Settings;
@@ -132,7 +132,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.PHYSICAL_KEYBOARDS;
+ return SettingsEnums.PHYSICAL_KEYBOARDS;
}
private void scheduleUpdateHardKeyboards() {
diff --git a/src/com/android/settings/inputmethod/SpellCheckersSettings.java b/src/com/android/settings/inputmethod/SpellCheckersSettings.java
index 2870484..974f2c4 100644
--- a/src/com/android/settings/inputmethod/SpellCheckersSettings.java
+++ b/src/com/android/settings/inputmethod/SpellCheckersSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.inputmethod;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.ApplicationInfo;
@@ -33,7 +34,6 @@
import androidx.preference.Preference.OnPreferenceClickListener;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
@@ -58,7 +58,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.INPUTMETHOD_SPELL_CHECKERS;
+ return SettingsEnums.INPUTMETHOD_SPELL_CHECKERS;
}
@Override
diff --git a/src/com/android/settings/inputmethod/UserDictionaryAddWordFragment.java b/src/com/android/settings/inputmethod/UserDictionaryAddWordFragment.java
index fd33051..dc2aa49 100644
--- a/src/com/android/settings/inputmethod/UserDictionaryAddWordFragment.java
+++ b/src/com/android/settings/inputmethod/UserDictionaryAddWordFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.inputmethod;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
@@ -25,7 +26,6 @@
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.inputmethod.UserDictionaryAddWordContents.LocaleRenderer;
@@ -105,7 +105,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.INPUTMETHOD_USER_DICTIONARY_ADD_WORD;
+ return SettingsEnums.INPUTMETHOD_USER_DICTIONARY_ADD_WORD;
}
@Override
diff --git a/src/com/android/settings/inputmethod/UserDictionaryList.java b/src/com/android/settings/inputmethod/UserDictionaryList.java
index b3ea47e..497b380 100644
--- a/src/com/android/settings/inputmethod/UserDictionaryList.java
+++ b/src/com/android/settings/inputmethod/UserDictionaryList.java
@@ -16,12 +16,12 @@
package com.android.settings.inputmethod;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -38,7 +38,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.INPUTMETHOD_USER_DICTIONARY;
+ return SettingsEnums.INPUTMETHOD_USER_DICTIONARY;
}
@Override
diff --git a/src/com/android/settings/inputmethod/UserDictionarySettings.java b/src/com/android/settings/inputmethod/UserDictionarySettings.java
index cdc8b07..eccfb3c 100644
--- a/src/com/android/settings/inputmethod/UserDictionarySettings.java
+++ b/src/com/android/settings/inputmethod/UserDictionarySettings.java
@@ -18,6 +18,7 @@
import android.annotation.Nullable;
import android.app.ActionBar;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -42,7 +43,6 @@
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.overlay.FeatureFactory;
@@ -68,7 +68,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.USER_DICTIONARY_SETTINGS;
+ return SettingsEnums.USER_DICTIONARY_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/inputmethod/VirtualKeyboardFragment.java b/src/com/android/settings/inputmethod/VirtualKeyboardFragment.java
index e1c9615..cb7831e 100644
--- a/src/com/android/settings/inputmethod/VirtualKeyboardFragment.java
+++ b/src/com/android/settings/inputmethod/VirtualKeyboardFragment.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
@@ -29,7 +30,6 @@
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.util.Preconditions;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -75,7 +75,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.VIRTUAL_KEYBOARDS;
+ return SettingsEnums.VIRTUAL_KEYBOARDS;
}
private void updateInputMethodPreferenceViews() {
diff --git a/src/com/android/settings/language/LanguageAndInputSettings.java b/src/com/android/settings/language/LanguageAndInputSettings.java
index ae0a568..3a8aeac 100644
--- a/src/com/android/settings/language/LanguageAndInputSettings.java
+++ b/src/com/android/settings/language/LanguageAndInputSettings.java
@@ -17,6 +17,7 @@
package com.android.settings.language;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
@@ -30,7 +31,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.SummaryLoader;
@@ -58,7 +58,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_LANGUAGE_CATEGORY;
+ return SettingsEnums.SETTINGS_LANGUAGE_CATEGORY;
}
@Override
diff --git a/src/com/android/settings/language/PhoneLanguagePreferenceController.java b/src/com/android/settings/language/PhoneLanguagePreferenceController.java
index c88bdb6..4f67a8f 100644
--- a/src/com/android/settings/language/PhoneLanguagePreferenceController.java
+++ b/src/com/android/settings/language/PhoneLanguagePreferenceController.java
@@ -16,11 +16,11 @@
package com.android.settings.language;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.core.SubSettingLauncher;
@@ -74,7 +74,7 @@
}
new SubSettingLauncher(mContext)
.setDestination(LocaleListEditor.class.getName())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.SETTINGS_LANGUAGE_CATEGORY)
+ .setSourceMetricsCategory(SettingsEnums.SETTINGS_LANGUAGE_CATEGORY)
.setTitleRes(R.string.language_picker_title)
.launch();
return true;
diff --git a/src/com/android/settings/localepicker/LocaleListEditor.java b/src/com/android/settings/localepicker/LocaleListEditor.java
index cb66764..bee5152 100644
--- a/src/com/android/settings/localepicker/LocaleListEditor.java
+++ b/src/com/android/settings/localepicker/LocaleListEditor.java
@@ -19,6 +19,7 @@
import static android.os.UserManager.DISALLOW_CONFIG_LOCALE;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
@@ -36,7 +37,6 @@
import com.android.internal.app.LocalePicker;
import com.android.internal.app.LocaleStore;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.RestrictedSettingsFragment;
@@ -68,7 +68,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.USER_LOCALE_LIST;
+ return SettingsEnums.USER_LOCALE_LIST;
}
@Override
diff --git a/src/com/android/settings/location/LocationSettings.java b/src/com/android/settings/location/LocationSettings.java
index 78a1541..6871428 100644
--- a/src/com/android/settings/location/LocationSettings.java
+++ b/src/com/android/settings/location/LocationSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.location;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.location.SettingInjectorService;
import android.os.Bundle;
@@ -24,7 +25,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceGroup;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.dashboard.DashboardFragment;
@@ -69,7 +69,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.LOCATION;
+ return SettingsEnums.LOCATION;
}
@Override
diff --git a/src/com/android/settings/location/LocationSlice.java b/src/com/android/settings/location/LocationSlice.java
index 6dc4241..e2078e3 100644
--- a/src/com/android/settings/location/LocationSlice.java
+++ b/src/com/android/settings/location/LocationSlice.java
@@ -23,6 +23,7 @@
import android.annotation.ColorInt;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -33,7 +34,6 @@
import androidx.slice.builders.ListBuilder.RowBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -88,7 +88,7 @@
final Uri contentUri = new Uri.Builder().appendPath(KEY_LOCATION).build();
return SliceBuilderUtils.buildSearchResultPageIntent(mContext,
LocationSettings.class.getName(), KEY_LOCATION, screenTitle,
- MetricsEvent.LOCATION)
+ SettingsEnums.LOCATION)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(contentUri);
}
diff --git a/src/com/android/settings/location/RecentLocationAccessPreferenceController.java b/src/com/android/settings/location/RecentLocationAccessPreferenceController.java
index 0d5cca5..2d84e21 100644
--- a/src/com/android/settings/location/RecentLocationAccessPreferenceController.java
+++ b/src/com/android/settings/location/RecentLocationAccessPreferenceController.java
@@ -27,6 +27,7 @@
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.location.RecentLocationAccesses;
import com.android.settingslib.widget.AppEntitiesHeaderController;
+import com.android.settingslib.widget.AppEntityInfo;
import com.android.settingslib.widget.LayoutPreference;
import java.util.List;
@@ -90,7 +91,12 @@
int i = 0;
for (; i < Math.min(recentLocationAccesses.size(), MAXIMUM_APP_COUNT); i++) {
final RecentLocationAccesses.Access access = recentLocationAccesses.get(i);
- mController.setAppEntity(i, access.icon, access.label, access.contentDescription);
+ final AppEntityInfo appEntityInfo = new AppEntityInfo.Builder()
+ .setIcon(access.icon)
+ .setTitle(access.label)
+ .setSummary(access.contentDescription)
+ .build();
+ mController.setAppEntity(i, appEntityInfo);
}
for (; i < MAXIMUM_APP_COUNT; i++) {
mController.removeAppEntity(i);
diff --git a/src/com/android/settings/location/ScanningSettings.java b/src/com/android/settings/location/ScanningSettings.java
index 86402c0..31ec955 100644
--- a/src/com/android/settings/location/ScanningSettings.java
+++ b/src/com/android/settings/location/ScanningSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.location;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -40,7 +40,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.LOCATION_SCANNING;
+ return SettingsEnums.LOCATION_SCANNING;
}
@Override
diff --git a/src/com/android/settings/network/AirplaneModePreferenceController.java b/src/com/android/settings/network/AirplaneModePreferenceController.java
index 1c4e351..1490e8a 100644
--- a/src/com/android/settings/network/AirplaneModePreferenceController.java
+++ b/src/com/android/settings/network/AirplaneModePreferenceController.java
@@ -21,7 +21,6 @@
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.SystemProperties;
-import android.text.TextUtils;
import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
diff --git a/src/com/android/settings/network/ApnEditor.java b/src/com/android/settings/network/ApnEditor.java
index a16be66..4de4026 100644
--- a/src/com/android/settings/network/ApnEditor.java
+++ b/src/com/android/settings/network/ApnEditor.java
@@ -19,6 +19,7 @@
import static android.content.Context.TELEPHONY_SERVICE;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
@@ -49,7 +50,6 @@
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.util.ArrayUtils;
import com.android.settings.R;
@@ -483,7 +483,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APN_EDITOR;
+ return SettingsEnums.APN_EDITOR;
}
@VisibleForTesting
@@ -1202,7 +1202,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_APN_EDITOR_ERROR;
+ return SettingsEnums.DIALOG_APN_EDITOR_ERROR;
}
}
diff --git a/src/com/android/settings/network/ApnSettings.java b/src/com/android/settings/network/ApnSettings.java
index ac3b1f6..174257b 100755
--- a/src/com/android/settings/network/ApnSettings.java
+++ b/src/com/android/settings/network/ApnSettings.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.ContentValues;
@@ -51,7 +52,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceGroup;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.uicc.UiccController;
@@ -173,7 +173,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.APN;
+ return SettingsEnums.APN;
}
@Override
@@ -518,7 +518,7 @@
@Override
public int getDialogMetricsCategory(int dialogId) {
if (dialogId == DIALOG_RESTORE_DEFAULTAPN) {
- return MetricsEvent.DIALOG_APN_RESTORE_DEFAULT;
+ return SettingsEnums.DIALOG_APN_RESTORE_DEFAULT;
}
return 0;
}
diff --git a/src/com/android/settings/network/MobileNetworkListController.java b/src/com/android/settings/network/MobileNetworkListController.java
index bd198e6..7de6cdd 100644
--- a/src/com/android/settings/network/MobileNetworkListController.java
+++ b/src/com/android/settings/network/MobileNetworkListController.java
@@ -26,6 +26,12 @@
import android.telephony.SubscriptionManager;
import android.util.ArrayMap;
+import androidx.lifecycle.Lifecycle;
+import androidx.lifecycle.LifecycleObserver;
+import androidx.lifecycle.OnLifecycleEvent;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.network.telephony.MobileNetworkActivity;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -33,12 +39,6 @@
import java.util.List;
import java.util.Map;
-import androidx.lifecycle.Lifecycle;
-import androidx.lifecycle.LifecycleObserver;
-import androidx.lifecycle.OnLifecycleEvent;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceScreen;
-
/**
* This populates the entries on a page which lists all available mobile subscriptions. Each entry
* has the name of the subscription with some subtext giving additional detail, and clicking on the
diff --git a/src/com/android/settings/network/MobileNetworkListFragment.java b/src/com/android/settings/network/MobileNetworkListFragment.java
index 8787378..c90827e 100644
--- a/src/com/android/settings/network/MobileNetworkListFragment.java
+++ b/src/com/android/settings/network/MobileNetworkListFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.network;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
@@ -44,9 +45,7 @@
@Override
public int getMetricsCategory() {
- // TODO(asargent) - return SettingsEnums.MOBILE_NETWORK_LIST once the CL defining it has
- // landed.
- return 0;
+ return SettingsEnums.MOBILE_NETWORK_LIST;
}
@Override
diff --git a/src/com/android/settings/network/MobileNetworkSummaryController.java b/src/com/android/settings/network/MobileNetworkSummaryController.java
index bbc4ea4..cc15676 100644
--- a/src/com/android/settings/network/MobileNetworkSummaryController.java
+++ b/src/com/android/settings/network/MobileNetworkSummaryController.java
@@ -24,18 +24,18 @@
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
-import com.android.settings.R;
-import com.android.settings.network.telephony.MobileNetworkActivity;
-import com.android.settingslib.core.AbstractPreferenceController;
-
-import java.util.List;
-
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
+import com.android.settings.R;
+import com.android.settings.network.telephony.MobileNetworkActivity;
+import com.android.settingslib.core.AbstractPreferenceController;
+
+import java.util.List;
+
public class MobileNetworkSummaryController extends AbstractPreferenceController implements
SubscriptionsChangeListener.SubscriptionsChangeListenerClient, LifecycleObserver {
private static final String TAG = "MobileNetSummaryCtlr";
diff --git a/src/com/android/settings/network/MultiNetworkHeaderController.java b/src/com/android/settings/network/MultiNetworkHeaderController.java
index 8860c47..938c753 100644
--- a/src/com/android/settings/network/MultiNetworkHeaderController.java
+++ b/src/com/android/settings/network/MultiNetworkHeaderController.java
@@ -16,17 +16,17 @@
package com.android.settings.network;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.settings.core.BasePreferenceController;
-import com.android.settings.wifi.WifiConnectionPreferenceController;
-import com.android.settingslib.core.lifecycle.Lifecycle;
-
import androidx.annotation.VisibleForTesting;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.wifi.WifiConnectionPreferenceController;
+import com.android.settingslib.core.lifecycle.Lifecycle;
+
// This controls a header at the top of the Network & internet page that only appears when there
// are two or more active mobile subscriptions. It shows an overview of available network
// connections with an entry for wifi (if connected) and an entry for each subscription.
@@ -52,7 +52,7 @@
WifiConnectionPreferenceController createWifiController(Lifecycle lifecycle) {
final int prefOrder = 0;
return new WifiConnectionPreferenceController(mContext, lifecycle, this, mPreferenceKey,
- prefOrder, MetricsProto.MetricsEvent.SETTINGS_NETWORK_CATEGORY);
+ prefOrder, SettingsEnums.SETTINGS_NETWORK_CATEGORY);
}
@VisibleForTesting
diff --git a/src/com/android/settings/network/NetworkDashboardFragment.java b/src/com/android/settings/network/NetworkDashboardFragment.java
index efdb556..7672c2e 100644
--- a/src/com/android/settings/network/NetworkDashboardFragment.java
+++ b/src/com/android/settings/network/NetworkDashboardFragment.java
@@ -15,10 +15,10 @@
*/
package com.android.settings.network;
-import static com.android.settings.network.MobilePlanPreferenceController
- .MANAGE_MOBILE_PLAN_DIALOG_ID;
+import static com.android.settings.network.MobilePlanPreferenceController.MANAGE_MOBILE_PLAN_DIALOG_ID;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
import android.util.Log;
@@ -26,7 +26,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.FeatureFlags;
import com.android.settings.dashboard.DashboardFragment;
@@ -51,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_NETWORK_CATEGORY;
+ return SettingsEnums.SETTINGS_NETWORK_CATEGORY;
}
@Override
@@ -158,7 +157,7 @@
@Override
public int getDialogMetricsCategory(int dialogId) {
if (MANAGE_MOBILE_PLAN_DIALOG_ID == dialogId) {
- return MetricsProto.MetricsEvent.DIALOG_MANAGE_MOBILE_PLAN;
+ return SettingsEnums.DIALOG_MANAGE_MOBILE_PLAN;
}
return 0;
}
diff --git a/src/com/android/settings/network/NetworkScorerPicker.java b/src/com/android/settings/network/NetworkScorerPicker.java
index d9c20ff..52e4ed9 100644
--- a/src/com/android/settings/network/NetworkScorerPicker.java
+++ b/src/com/android/settings/network/NetworkScorerPicker.java
@@ -15,6 +15,7 @@
*/
package com.android.settings.network;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.net.NetworkScoreManager;
import android.net.NetworkScorerAppData;
@@ -28,7 +29,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.InstrumentedPreferenceFragment;
import com.android.settings.widget.RadioButtonPreference;
@@ -45,7 +45,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_NETWORK_SCORER;
+ return SettingsEnums.SETTINGS_NETWORK_SCORER;
}
@Override
diff --git a/src/com/android/settings/network/PrivateDnsModeDialogPreference.java b/src/com/android/settings/network/PrivateDnsModeDialogPreference.java
index 322fdc4..1655c69 100644
--- a/src/com/android/settings/network/PrivateDnsModeDialogPreference.java
+++ b/src/com/android/settings/network/PrivateDnsModeDialogPreference.java
@@ -19,11 +19,10 @@
import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_OFF;
import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_OPPORTUNISTIC;
import static android.net.ConnectivityManager.PRIVATE_DNS_MODE_PROVIDER_HOSTNAME;
-import static android.system.OsConstants.AF_INET;
-import static android.system.OsConstants.AF_INET6;
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.ContentResolver;
import android.content.Context;
@@ -33,7 +32,6 @@
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
-import android.system.Os;
import android.text.Editable;
import android.text.TextWatcher;
import android.text.method.LinkMovementMethod;
@@ -49,7 +47,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.utils.AnnotationSpan;
@@ -203,7 +200,7 @@
}
FeatureFactory.getFactory(context).getMetricsFeatureProvider().action(context,
- MetricsProto.MetricsEvent.ACTION_PRIVATE_DNS_MODE, mMode);
+ SettingsEnums.ACTION_PRIVATE_DNS_MODE, mMode);
Settings.Global.putString(context.getContentResolver(), MODE_KEY, mMode);
}
}
diff --git a/src/com/android/settings/network/PrivateDnsPreferenceController.java b/src/com/android/settings/network/PrivateDnsPreferenceController.java
index 37adea7..47c3a95 100644
--- a/src/com/android/settings/network/PrivateDnsPreferenceController.java
+++ b/src/com/android/settings/network/PrivateDnsPreferenceController.java
@@ -45,11 +45,11 @@
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.core.lifecycle.LifecycleObserver;
import com.android.settingslib.core.lifecycle.events.OnStart;
import com.android.settingslib.core.lifecycle.events.OnStop;
-import com.android.settingslib.RestrictedLockUtilsInternal;
-import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
import java.net.InetAddress;
import java.util.List;
diff --git a/src/com/android/settings/network/SubscriptionUtil.java b/src/com/android/settings/network/SubscriptionUtil.java
index 6b14759..fbc6edd 100644
--- a/src/com/android/settings/network/SubscriptionUtil.java
+++ b/src/com/android/settings/network/SubscriptionUtil.java
@@ -20,12 +20,12 @@
import android.telephony.SubscriptionManager;
import android.text.TextUtils;
+import androidx.annotation.VisibleForTesting;
+
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import androidx.annotation.VisibleForTesting;
-
public class SubscriptionUtil {
private static List<SubscriptionInfo> sResultsForTesting;
diff --git a/src/com/android/settings/network/SubscriptionsPreferenceController.java b/src/com/android/settings/network/SubscriptionsPreferenceController.java
index bf6d39c..6952a1e 100644
--- a/src/com/android/settings/network/SubscriptionsPreferenceController.java
+++ b/src/com/android/settings/network/SubscriptionsPreferenceController.java
@@ -25,12 +25,6 @@
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
-import com.android.settings.R;
-import com.android.settings.network.telephony.MobileNetworkActivity;
-import com.android.settingslib.core.AbstractPreferenceController;
-
-import java.util.Map;
-
import androidx.collection.ArrayMap;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
@@ -39,6 +33,12 @@
import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceScreen;
+import com.android.settings.R;
+import com.android.settings.network.telephony.MobileNetworkActivity;
+import com.android.settingslib.core.AbstractPreferenceController;
+
+import java.util.Map;
+
/**
* This manages a set of Preferences it places into a PreferenceGroup owned by some parent
* controller class - one for each available subscription. This controller is only considered
diff --git a/src/com/android/settings/network/telephony/CarrierPreferenceController.java b/src/com/android/settings/network/telephony/CarrierPreferenceController.java
index 3dab15e..61232f5 100644
--- a/src/com/android/settings/network/telephony/CarrierPreferenceController.java
+++ b/src/com/android/settings/network/telephony/CarrierPreferenceController.java
@@ -16,8 +16,8 @@
package com.android.settings.network.telephony;
-import android.content.Context;
import android.content.ComponentName;
+import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
diff --git a/src/com/android/settings/network/telephony/DataServiceSetupPreferenceController.java b/src/com/android/settings/network/telephony/DataServiceSetupPreferenceController.java
index 129ceb1..75579dd 100644
--- a/src/com/android/settings/network/telephony/DataServiceSetupPreferenceController.java
+++ b/src/com/android/settings/network/telephony/DataServiceSetupPreferenceController.java
@@ -26,7 +26,6 @@
import android.telephony.TelephonyManager;
import android.text.TextUtils;
-import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import com.android.internal.telephony.PhoneConstants;
diff --git a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
index d2ec162..fcd2fa0 100644
--- a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
+++ b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
@@ -17,7 +17,6 @@
package com.android.settings.network.telephony;
import android.content.Context;
-import android.content.res.Resources;
import android.os.PersistableBundle;
import android.provider.Settings;
import android.telephony.CarrierConfigManager;
diff --git a/src/com/android/settings/network/telephony/EuiccPreferenceController.java b/src/com/android/settings/network/telephony/EuiccPreferenceController.java
index 8d03908..ae207a2 100644
--- a/src/com/android/settings/network/telephony/EuiccPreferenceController.java
+++ b/src/com/android/settings/network/telephony/EuiccPreferenceController.java
@@ -18,9 +18,6 @@
import android.content.Context;
import android.content.Intent;
-import android.os.PersistableBundle;
-import android.provider.Settings;
-import android.telephony.CarrierConfigManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.euicc.EuiccManager;
diff --git a/src/com/android/settings/network/telephony/MobileNetworkActivity.java b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
index 93ba918..a5f011c 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkActivity.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
@@ -69,7 +69,7 @@
@Override
public void onSubscriptionsChanged() {
if (!Objects.equals(mSubscriptionInfos,
- mSubscriptionManager.getActiveSubscriptionInfoList())) {
+ mSubscriptionManager.getActiveSubscriptionInfoList(true))) {
updateSubscriptions(null);
}
}
@@ -87,7 +87,7 @@
setActionBar(findViewById(R.id.mobile_action_bar));
mPhoneChangeReceiver = new PhoneChangeReceiver();
mSubscriptionManager = getSystemService(SubscriptionManager.class);
- mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList(true);
mCurSubscriptionId = savedInstanceState != null
? savedInstanceState.getInt(Settings.EXTRA_SUB_ID, SUB_ID_NULL)
: SUB_ID_NULL;
@@ -136,7 +136,7 @@
@VisibleForTesting
void updateSubscriptions(Bundle savedInstanceState) {
- mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionInfos = mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (!FeatureFlagPersistent.isEnabled(this, FeatureFlags.NETWORK_INTERNET_V2)) {
updateBottomNavigationView();
diff --git a/src/com/android/settings/network/telephony/MobileNetworkSettings.java b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
index 6e5dece..9665c09 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkSettings.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkSettings.java
@@ -34,7 +34,10 @@
import com.android.internal.telephony.TelephonyIntents;
import com.android.settings.R;
+import com.android.settings.core.FeatureFlags;
import com.android.settings.dashboard.RestrictedDashboardFragment;
+import com.android.settings.datausage.DataUsageSummaryPreferenceController;
+import com.android.settings.development.featureflags.FeatureFlagPersistent;
import com.android.settings.network.telephony.cdma.CdmaSubscriptionPreferenceController;
import com.android.settings.network.telephony.cdma.CdmaSystemSelectPreferenceController;
import com.android.settings.network.telephony.gsm.AutoSelectPreferenceController;
@@ -42,6 +45,7 @@
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
import com.android.settings.widget.PreferenceCategoryController;
+import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.search.SearchIndexable;
import java.util.ArrayList;
@@ -105,12 +109,23 @@
}
@Override
- public void onAttach(Context context) {
- super.onAttach(context);
-
+ protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
mSubId = getArguments().getInt(Settings.EXTRA_SUB_ID,
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
+ if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2) &&
+ mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
+ return Arrays.asList(
+ new DataUsageSummaryPreferenceController(getActivity(), getSettingsLifecycle(),
+ this, mSubId));
+ }
+ return Arrays.asList();
+ }
+
+ @Override
+ public void onAttach(Context context) {
+ super.onAttach(context);
+
use(MobileDataPreferenceController.class).init(getFragmentManager(), mSubId);
use(RoamingPreferenceController.class).init(getFragmentManager(), mSubId);
use(ApnPreferenceController.class).init(mSubId);
@@ -163,7 +178,11 @@
@Override
protected int getPreferenceScreenResId() {
- return R.xml.mobile_network_settings;
+ if (FeatureFlagPersistent.isEnabled(getContext(), FeatureFlags.NETWORK_INTERNET_V2)) {
+ return R.xml.mobile_network_settings_v2;
+ } else {
+ return R.xml.mobile_network_settings;
+ }
}
@Override
diff --git a/src/com/android/settings/network/telephony/MobileNetworkUtils.java b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
index 27cc367..c5cdd3a 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkUtils.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkUtils.java
@@ -27,7 +27,6 @@
import android.os.PersistableBundle;
import android.os.SystemProperties;
import android.provider.Settings;
-import android.service.carrier.CarrierMessagingService;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telephony.CarrierConfigManager;
@@ -45,7 +44,6 @@
import com.android.ims.ImsManager;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneConstants;
-import com.android.settings.R;
import java.util.Arrays;
import java.util.List;
@@ -227,7 +225,7 @@
if (disableOtherSubscriptions) {
List<SubscriptionInfo> subInfoList =
- subscriptionManager.getActiveSubscriptionInfoList();
+ subscriptionManager.getActiveSubscriptionInfoList(true);
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
// We never disable mobile data for opportunistic subscriptions.
diff --git a/src/com/android/settings/network/telephony/NetworkSelectSettings.java b/src/com/android/settings/network/telephony/NetworkSelectSettings.java
index 3b9b2f5..ff04583 100644
--- a/src/com/android/settings/network/telephony/NetworkSelectSettings.java
+++ b/src/com/android/settings/network/telephony/NetworkSelectSettings.java
@@ -37,7 +37,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.OperatorInfo;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -162,7 +161,7 @@
mSelectedPreference.setSummary(R.string.network_connecting);
mMetricsFeatureProvider.action(getContext(),
- MetricsEvent.ACTION_MOBILE_NETWORK_MANUAL_SELECT_NETWORK);
+ SettingsEnums.ACTION_MOBILE_NETWORK_MANUAL_SELECT_NETWORK);
// Set summary as "Disconnected" to the previously connected network
if (mConnectedPreferenceCategory.getPreferenceCount() > 0) {
diff --git a/src/com/android/settings/network/telephony/RoamingDialogFragment.java b/src/com/android/settings/network/telephony/RoamingDialogFragment.java
index c349c1a..c527d3c 100644
--- a/src/com/android/settings/network/telephony/RoamingDialogFragment.java
+++ b/src/com/android/settings/network/telephony/RoamingDialogFragment.java
@@ -26,9 +26,6 @@
import android.telephony.CarrierConfigManager;
import android.telephony.TelephonyManager;
-import androidx.fragment.app.DialogFragment;
-import androidx.fragment.app.Fragment;
-
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
diff --git a/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java b/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java
index 41bf3ef..c653890 100644
--- a/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java
+++ b/src/com/android/settings/network/telephony/cdma/CdmaSubscriptionPreferenceController.java
@@ -19,13 +19,11 @@
import android.content.Context;
import android.os.SystemProperties;
import android.provider.Settings;
-import android.telephony.TelephonyManager;
import android.text.TextUtils;
import androidx.annotation.VisibleForTesting;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
-import androidx.preference.PreferenceManager;
import com.android.internal.telephony.Phone;
import com.android.settings.network.telephony.MobileNetworkUtils;
diff --git a/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java b/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
index 0e47d9b..fdc9f7f 100644
--- a/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
+++ b/src/com/android/settings/network/telephony/gsm/AutoSelectPreferenceController.java
@@ -31,7 +31,6 @@
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.core.TogglePreferenceController;
import com.android.settings.network.telephony.MobileNetworkUtils;
-import com.android.settings.network.telephony.MobileNetworkActivity;
import com.android.settings.network.telephony.NetworkSelectSettings;
import java.util.ArrayList;
diff --git a/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java b/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
index ab25e15..e8a392a 100644
--- a/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
+++ b/src/com/android/settings/network/telephony/gsm/OpenNetworkSelectPagePreferenceController.java
@@ -32,7 +32,6 @@
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.network.telephony.MobileNetworkUtils;
-import com.android.settings.network.telephony.MobileNetworkActivity;
import com.android.settings.network.telephony.NetworkSelectSettings;
/**
diff --git a/src/com/android/settings/nfc/AndroidBeam.java b/src/com/android/settings/nfc/AndroidBeam.java
index a157c7f..1f75a25 100644
--- a/src/com/android/settings/nfc/AndroidBeam.java
+++ b/src/com/android/settings/nfc/AndroidBeam.java
@@ -18,6 +18,7 @@
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.PackageManager;
import android.nfc.NfcAdapter;
@@ -33,7 +34,6 @@
import android.widget.Switch;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.core.InstrumentedFragment;
@@ -142,6 +142,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NFC_BEAM;
+ return SettingsEnums.NFC_BEAM;
}
}
diff --git a/src/com/android/settings/nfc/PaymentSettings.java b/src/com/android/settings/nfc/PaymentSettings.java
index e78c90d..5742d1a 100644
--- a/src/com/android/settings/nfc/PaymentSettings.java
+++ b/src/com/android/settings/nfc/PaymentSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.nfc;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -30,7 +31,6 @@
import android.view.View;
import android.view.ViewGroup;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -53,7 +53,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NFC_PAYMENT;
+ return SettingsEnums.NFC_PAYMENT;
}
@Override
diff --git a/src/com/android/settings/notification/AbstractZenModeAutomaticRulePreferenceController.java b/src/com/android/settings/notification/AbstractZenModeAutomaticRulePreferenceController.java
index 1499656..58e1916 100644
--- a/src/com/android/settings/notification/AbstractZenModeAutomaticRulePreferenceController.java
+++ b/src/com/android/settings/notification/AbstractZenModeAutomaticRulePreferenceController.java
@@ -18,6 +18,7 @@
import android.app.AutomaticZenRule;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -31,7 +32,6 @@
import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -141,7 +141,7 @@
@Override
public void onOk(String ruleName, Fragment parent) {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_MODE_RULE_NAME_CHANGE_OK);
+ SettingsEnums.ACTION_ZEN_MODE_RULE_NAME_CHANGE_OK);
AutomaticZenRule rule = new AutomaticZenRule(ruleName, mRuleInfo.serviceComponent,
mRuleInfo.configurationActivity, mRuleInfo.defaultConditionId, null,
NotificationManager.INTERRUPTION_FILTER_PRIORITY, true);
diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java
index c628da9..6da3165 100644
--- a/src/com/android/settings/notification/AppNotificationSettings.java
+++ b/src/com/android/settings/notification/AppNotificationSettings.java
@@ -18,6 +18,7 @@
import android.app.NotificationChannel;
import android.app.NotificationChannelGroup;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -30,7 +31,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.widget.MasterCheckBoxPreference;
@@ -56,7 +56,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_APP_NOTIFICATION;
+ return SettingsEnums.NOTIFICATION_APP_NOTIFICATION;
}
@Override
diff --git a/src/com/android/settings/notification/ChannelGroupNotificationSettings.java b/src/com/android/settings/notification/ChannelGroupNotificationSettings.java
index 17710c4..1f8b1c3 100644
--- a/src/com/android/settings/notification/ChannelGroupNotificationSettings.java
+++ b/src/com/android/settings/notification/ChannelGroupNotificationSettings.java
@@ -17,12 +17,12 @@
package com.android.settings.notification;
import android.app.NotificationChannel;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.util.Log;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -35,7 +35,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_CHANNEL_GROUP;
+ return SettingsEnums.NOTIFICATION_CHANNEL_GROUP;
}
@Override
diff --git a/src/com/android/settings/notification/ChannelNotificationSettings.java b/src/com/android/settings/notification/ChannelNotificationSettings.java
index 3580967..0e1f386 100644
--- a/src/com/android/settings/notification/ChannelNotificationSettings.java
+++ b/src/com/android/settings/notification/ChannelNotificationSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@@ -25,7 +26,6 @@
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -38,7 +38,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_TOPIC_NOTIFICATION;
+ return SettingsEnums.NOTIFICATION_TOPIC_NOTIFICATION;
}
@Override
diff --git a/src/com/android/settings/notification/ChannelSummaryPreference.java b/src/com/android/settings/notification/ChannelSummaryPreference.java
index c716038..338e5e0 100644
--- a/src/com/android/settings/notification/ChannelSummaryPreference.java
+++ b/src/com/android/settings/notification/ChannelSummaryPreference.java
@@ -21,11 +21,11 @@
import android.view.View;
import android.widget.CheckBox;
+import androidx.preference.PreferenceViewHolder;
+
import com.android.settings.R;
import com.android.settingslib.TwoTargetPreference;
-import androidx.preference.PreferenceViewHolder;
-
/**
* A custom preference that provides inline checkbox and tappable target.
*/
diff --git a/src/com/android/settings/notification/ConfigureNotificationSettings.java b/src/com/android/settings/notification/ConfigureNotificationSettings.java
index 9da8ca1..1b860e3 100644
--- a/src/com/android/settings/notification/ConfigureNotificationSettings.java
+++ b/src/com/android/settings/notification/ConfigureNotificationSettings.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.Application;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@@ -28,7 +29,6 @@
import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.RingtonePreference;
import com.android.settings.core.OnActivityResultListener;
@@ -67,7 +67,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CONFIGURE_NOTIFICATION;
+ return SettingsEnums.CONFIGURE_NOTIFICATION;
}
@Override
diff --git a/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java b/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
index 54a0d5e..8677c02 100644
--- a/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
+++ b/src/com/android/settings/notification/NotificationAccessConfirmationActivity.java
@@ -17,12 +17,9 @@
package com.android.settings.notification;
-import static com.android.internal.notification.NotificationAccessConfirmationActivityContract
- .EXTRA_COMPONENT_NAME;
-import static com.android.internal.notification.NotificationAccessConfirmationActivityContract
- .EXTRA_PACKAGE_TITLE;
-import static com.android.internal.notification.NotificationAccessConfirmationActivityContract
- .EXTRA_USER_ID;
+import static com.android.internal.notification.NotificationAccessConfirmationActivityContract.EXTRA_COMPONENT_NAME;
+import static com.android.internal.notification.NotificationAccessConfirmationActivityContract.EXTRA_PACKAGE_TITLE;
+import static com.android.internal.notification.NotificationAccessConfirmationActivityContract.EXTRA_USER_ID;
import android.Manifest;
import android.annotation.Nullable;
diff --git a/src/com/android/settings/notification/NotificationAccessSettings.java b/src/com/android/settings/notification/NotificationAccessSettings.java
index 4d581bb..81edc5b 100644
--- a/src/com/android/settings/notification/NotificationAccessSettings.java
+++ b/src/com/android/settings/notification/NotificationAccessSettings.java
@@ -18,6 +18,7 @@
import android.app.Dialog;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.os.AsyncTask;
@@ -32,7 +33,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.overlay.FeatureFactory;
@@ -77,7 +77,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ACCESS;
+ return SettingsEnums.NOTIFICATION_ACCESS;
}
@Override
@@ -132,8 +132,8 @@
@VisibleForTesting
void logSpecialPermissionChange(boolean enable, String packageName) {
- int logCategory = enable ? MetricsEvent.APP_SPECIAL_PERMISSION_NOTIVIEW_ALLOW
- : MetricsEvent.APP_SPECIAL_PERMISSION_NOTIVIEW_DENY;
+ int logCategory = enable ? SettingsEnums.APP_SPECIAL_PERMISSION_NOTIVIEW_ALLOW
+ : SettingsEnums.APP_SPECIAL_PERMISSION_NOTIVIEW_DENY;
FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider().action(getContext(),
logCategory, packageName);
}
@@ -164,7 +164,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_DISABLE_NOTIFICATION_ACCESS;
+ return SettingsEnums.DIALOG_DISABLE_NOTIFICATION_ACCESS;
}
@Override
diff --git a/src/com/android/settings/notification/NotificationBackend.java b/src/com/android/settings/notification/NotificationBackend.java
index d5fea09..a2be3ea 100644
--- a/src/com/android/settings/notification/NotificationBackend.java
+++ b/src/com/android/settings/notification/NotificationBackend.java
@@ -21,7 +21,6 @@
import android.app.INotificationManager;
import android.app.NotificationChannel;
import android.app.NotificationChannelGroup;
-import android.app.NotificationManager;
import android.app.usage.IUsageStatsManager;
import android.app.usage.UsageEvents;
import android.content.Context;
@@ -39,6 +38,8 @@
import android.util.IconDrawableFactory;
import android.util.Log;
+import androidx.annotation.VisibleForTesting;
+
import com.android.settingslib.R;
import com.android.settingslib.Utils;
import com.android.settingslib.utils.StringUtil;
@@ -48,8 +49,6 @@
import java.util.List;
import java.util.Map;
-import androidx.annotation.VisibleForTesting;
-
public class NotificationBackend {
private static final String TAG = "NotificationBackend";
diff --git a/src/com/android/settings/notification/NotificationSettingsBase.java b/src/com/android/settings/notification/NotificationSettingsBase.java
index 7053bb3..0b79e20 100644
--- a/src/com/android/settings/notification/NotificationSettingsBase.java
+++ b/src/com/android/settings/notification/NotificationSettingsBase.java
@@ -50,7 +50,6 @@
import com.android.settings.applications.AppInfoBase;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.dashboard.DashboardFragment;
-import com.android.settings.widget.MasterCheckBoxPreference;
import com.android.settingslib.RestrictedLockUtilsInternal;
import java.util.ArrayList;
diff --git a/src/com/android/settings/notification/NotificationStation.java b/src/com/android/settings/notification/NotificationStation.java
index 91ebc88..ee6a05b 100644
--- a/src/com/android/settings/notification/NotificationStation.java
+++ b/src/com/android/settings/notification/NotificationStation.java
@@ -24,6 +24,7 @@
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.IntentSender;
@@ -56,7 +57,6 @@
import androidx.preference.PreferenceViewHolder;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
@@ -183,7 +183,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_STATION;
+ return SettingsEnums.NOTIFICATION_STATION;
}
@Override
diff --git a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
index bbc01f5..1c8c88e 100644
--- a/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
+++ b/src/com/android/settings/notification/RecentNotifyingAppsPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import android.app.Application;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -35,7 +36,6 @@
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.applications.AppInfoBase;
import com.android.settings.core.PreferenceControllerMixin;
@@ -47,7 +47,6 @@
import com.android.settingslib.utils.StringUtil;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -213,7 +212,7 @@
.setTitleRes(R.string.notifications_title)
.setArguments(args)
.setSourceMetricsCategory(
- MetricsProto.MetricsEvent.MANAGE_APPLICATIONS_NOTIFICATIONS)
+ SettingsEnums.MANAGE_APPLICATIONS_NOTIFICATIONS)
.toIntent());
pref.setEnabled(mNotificationBackend.isBlockable(mContext, appEntry.info));
pref.setOnPreferenceChangeListener((preference, newValue) -> {
diff --git a/src/com/android/settings/notification/RedactionInterstitial.java b/src/com/android/settings/notification/RedactionInterstitial.java
index 11861e0..cc26f8a 100644
--- a/src/com/android/settings/notification/RedactionInterstitial.java
+++ b/src/com/android/settings/notification/RedactionInterstitial.java
@@ -23,6 +23,7 @@
import static com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
@@ -37,7 +38,6 @@
import android.widget.RadioGroup;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.RestrictedRadioButton;
import com.android.settings.SettingsActivity;
@@ -102,7 +102,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_REDACTION;
+ return SettingsEnums.NOTIFICATION_REDACTION;
}
@Override
diff --git a/src/com/android/settings/notification/SettingsEnableZenModeDialog.java b/src/com/android/settings/notification/SettingsEnableZenModeDialog.java
index dccdc26..880db35 100644
--- a/src/com/android/settings/notification/SettingsEnableZenModeDialog.java
+++ b/src/com/android/settings/notification/SettingsEnableZenModeDialog.java
@@ -17,9 +17,9 @@
package com.android.settings.notification;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
public class SettingsEnableZenModeDialog extends InstrumentedDialogFragment {
@@ -32,6 +32,6 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.NOTIFICATION_ZEN_MODE_ENABLE_DIALOG;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_ENABLE_DIALOG;
}
}
diff --git a/src/com/android/settings/notification/SettingsZenDurationDialog.java b/src/com/android/settings/notification/SettingsZenDurationDialog.java
index 23bf1a9..355d483 100644
--- a/src/com/android/settings/notification/SettingsZenDurationDialog.java
+++ b/src/com/android/settings/notification/SettingsZenDurationDialog.java
@@ -17,9 +17,9 @@
package com.android.settings.notification;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
public class SettingsZenDurationDialog extends InstrumentedDialogFragment {
@@ -32,6 +32,6 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.NOTIFICATION_ZEN_MODE_DURATION_DIALOG;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_DURATION_DIALOG;
}
}
diff --git a/src/com/android/settings/notification/SoundSettings.java b/src/com/android/settings/notification/SoundSettings.java
index 99fd3d5..e8b7ee0 100644
--- a/src/com/android/settings/notification/SoundSettings.java
+++ b/src/com/android/settings/notification/SoundSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@@ -31,8 +32,6 @@
import androidx.preference.ListPreference;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.RingtonePreference;
import com.android.settings.core.OnActivityResultListener;
@@ -83,7 +82,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SOUND;
+ return SettingsEnums.SOUND;
}
@Override
@@ -132,9 +131,9 @@
public void onDisplayPreferenceDialog(Preference preference) {
final int metricsCategory;
if (mHfpOutputControllerKey.equals(preference.getKey())) {
- metricsCategory = MetricsProto.MetricsEvent.DIALOG_SWITCH_HFP_DEVICES;
+ metricsCategory = SettingsEnums.DIALOG_SWITCH_HFP_DEVICES;
} else if (mMediaOutputControllerKey.equals(preference.getKey())) {
- metricsCategory = MetricsProto.MetricsEvent.DIALOG_SWITCH_A2DP_DEVICES;
+ metricsCategory = SettingsEnums.DIALOG_SWITCH_A2DP_DEVICES;
} else {
metricsCategory = Instrumentable.METRICS_CATEGORY_UNKNOWN;
}
diff --git a/src/com/android/settings/notification/WorkSoundPreferenceController.java b/src/com/android/settings/notification/WorkSoundPreferenceController.java
index b640d5a..c708b37 100644
--- a/src/com/android/settings/notification/WorkSoundPreferenceController.java
+++ b/src/com/android/settings/notification/WorkSoundPreferenceController.java
@@ -18,6 +18,7 @@
import android.annotation.UserIdInt;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
@@ -40,7 +41,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.TwoStatePreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.DefaultRingtonePreference;
import com.android.settings.R;
import com.android.settings.Utils;
@@ -331,7 +331,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_UNIFY_SOUND_SETTINGS;
+ return SettingsEnums.DIALOG_UNIFY_SOUND_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/notification/ZenAccessSettings.java b/src/com/android/settings/notification/ZenAccessSettings.java
index 70c7150..d057c75 100644
--- a/src/com/android/settings/notification/ZenAccessSettings.java
+++ b/src/com/android/settings/notification/ZenAccessSettings.java
@@ -21,6 +21,7 @@
import android.app.AppGlobals;
import android.app.Dialog;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.ApplicationInfo;
@@ -49,7 +50,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.overlay.FeatureFactory;
@@ -74,7 +74,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_ACCESS;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_ACCESS;
}
@Override
@@ -211,8 +211,8 @@
@VisibleForTesting
static void logSpecialPermissionChange(boolean enable, String packageName, Context context) {
- int logCategory = enable ? MetricsEvent.APP_SPECIAL_PERMISSION_DND_ALLOW
- : MetricsEvent.APP_SPECIAL_PERMISSION_DND_DENY;
+ int logCategory = enable ? SettingsEnums.APP_SPECIAL_PERMISSION_DND_ALLOW
+ : SettingsEnums.APP_SPECIAL_PERMISSION_DND_DENY;
FeatureFactory.getFactory(context).getMetricsFeatureProvider().action(context,
logCategory, packageName);
}
@@ -248,7 +248,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_ZEN_ACCESS_GRANT;
+ return SettingsEnums.DIALOG_ZEN_ACCESS_GRANT;
}
public ScaryWarningDialogFragment setPkgInfo(String pkg, CharSequence label) {
@@ -300,7 +300,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_ZEN_ACCESS_REVOKE;
+ return SettingsEnums.DIALOG_ZEN_ACCESS_REVOKE;
}
public FriendlyWarningDialogFragment setPkgInfo(String pkg, CharSequence label) {
diff --git a/src/com/android/settings/notification/ZenAutomaticRuleHeaderPreferenceController.java b/src/com/android/settings/notification/ZenAutomaticRuleHeaderPreferenceController.java
index 5fa3954..73a03cb 100644
--- a/src/com/android/settings/notification/ZenAutomaticRuleHeaderPreferenceController.java
+++ b/src/com/android/settings/notification/ZenAutomaticRuleHeaderPreferenceController.java
@@ -24,15 +24,12 @@
import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.service.notification.ZenModeConfig;
-import android.text.TextUtils;
import android.util.Slog;
import android.view.View;
-import androidx.fragment.app.Fragment;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.widget.EntityHeaderController;
diff --git a/src/com/android/settings/notification/ZenCustomRuleBlockedEffectsSettings.java b/src/com/android/settings/notification/ZenCustomRuleBlockedEffectsSettings.java
index 3f75a20..b407445 100644
--- a/src/com/android/settings/notification/ZenCustomRuleBlockedEffectsSettings.java
+++ b/src/com/android/settings/notification/ZenCustomRuleBlockedEffectsSettings.java
@@ -16,11 +16,11 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.service.notification.ZenPolicy;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -46,26 +46,26 @@
mControllers = new ArrayList<>();
mControllers.add(new ZenRuleVisEffectPreferenceController(context, getSettingsLifecycle(),
"zen_effect_intent", ZenPolicy.VISUAL_EFFECT_FULL_SCREEN_INTENT,
- MetricsEvent.ACTION_ZEN_BLOCK_FULL_SCREEN_INTENTS, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_FULL_SCREEN_INTENTS, null));
mControllers.add(new ZenRuleVisEffectPreferenceController(context, getSettingsLifecycle(),
"zen_effect_light", ZenPolicy.VISUAL_EFFECT_LIGHTS,
- MetricsEvent.ACTION_ZEN_BLOCK_LIGHT, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_LIGHT, null));
mControllers.add(new ZenRuleVisEffectPreferenceController(context, getSettingsLifecycle(),
"zen_effect_peek", ZenPolicy.VISUAL_EFFECT_PEEK,
- MetricsEvent.ACTION_ZEN_BLOCK_PEEK, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_PEEK, null));
mControllers.add(new ZenRuleVisEffectPreferenceController(context, getSettingsLifecycle(),
"zen_effect_status", ZenPolicy.VISUAL_EFFECT_STATUS_BAR,
- MetricsEvent.ACTION_ZEN_BLOCK_STATUS,
+ SettingsEnums.ACTION_ZEN_BLOCK_STATUS,
new int[] {ZenPolicy.VISUAL_EFFECT_NOTIFICATION_LIST}));
mControllers.add(new ZenRuleVisEffectPreferenceController(context, getSettingsLifecycle(),
"zen_effect_badge", ZenPolicy.VISUAL_EFFECT_BADGE,
- MetricsEvent.ACTION_ZEN_BLOCK_BADGE, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_BADGE, null));
mControllers.add(new ZenRuleVisEffectPreferenceController(context, getSettingsLifecycle(),
"zen_effect_ambient", ZenPolicy.VISUAL_EFFECT_AMBIENT,
- MetricsEvent.ACTION_ZEN_BLOCK_AMBIENT, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_AMBIENT, null));
mControllers.add(new ZenRuleVisEffectPreferenceController(context, getSettingsLifecycle(),
"zen_effect_list", ZenPolicy.VISUAL_EFFECT_NOTIFICATION_LIST,
- MetricsEvent.ACTION_ZEN_BLOCK_NOTIFICATION_LIST, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_NOTIFICATION_LIST, null));
return mControllers;
}
@@ -76,6 +76,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ZEN_CUSTOM_RULE_VIS_EFFECTS;
+ return SettingsEnums.ZEN_CUSTOM_RULE_VIS_EFFECTS;
}
}
diff --git a/src/com/android/settings/notification/ZenCustomRuleCallsSettings.java b/src/com/android/settings/notification/ZenCustomRuleCallsSettings.java
index 808264e..42e62c3 100644
--- a/src/com/android/settings/notification/ZenCustomRuleCallsSettings.java
+++ b/src/com/android/settings/notification/ZenCustomRuleCallsSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.service.notification.ZenPolicy;
@@ -23,7 +24,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.widget.FooterPreference;
@@ -49,7 +49,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.ZEN_CUSTOM_RULE_CALLS;
+ return SettingsEnums.ZEN_CUSTOM_RULE_CALLS;
}
@Override
diff --git a/src/com/android/settings/notification/ZenCustomRuleConfigSettings.java b/src/com/android/settings/notification/ZenCustomRuleConfigSettings.java
index fd8ce2b..c39b4d5 100644
--- a/src/com/android/settings/notification/ZenCustomRuleConfigSettings.java
+++ b/src/com/android/settings/notification/ZenCustomRuleConfigSettings.java
@@ -17,13 +17,13 @@
package com.android.settings.notification;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.service.notification.ZenPolicy;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -60,7 +60,7 @@
new SubSettingLauncher(mContext)
.setDestination(ZenCustomRuleCallsSettings.class.getName())
.setArguments(createZenRuleBundle())
- .setSourceMetricsCategory(MetricsEvent.ZEN_CUSTOM_RULE_CALLS)
+ .setSourceMetricsCategory(SettingsEnums.ZEN_CUSTOM_RULE_CALLS)
.launch();
return true;
}
@@ -74,7 +74,7 @@
new SubSettingLauncher(mContext)
.setDestination(ZenCustomRuleMessagesSettings.class.getName())
.setArguments(createZenRuleBundle())
- .setSourceMetricsCategory(MetricsEvent.ZEN_CUSTOM_RULE_MESSAGES)
+ .setSourceMetricsCategory(SettingsEnums.ZEN_CUSTOM_RULE_MESSAGES)
.launch();
return true;
}
@@ -89,7 +89,7 @@
.setDestination(ZenCustomRuleNotificationsSettings.class.getName())
.setArguments(createZenRuleBundle())
.setSourceMetricsCategory
- (MetricsEvent.ZEN_CUSTOM_RULE_NOTIFICATION_RESTRICTIONS)
+ (SettingsEnums.ZEN_CUSTOM_RULE_NOTIFICATION_RESTRICTIONS)
.launch();
return true;
}
@@ -123,7 +123,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ZEN_CUSTOM_RULE_SOUND_SETTINGS;
+ return SettingsEnums.ZEN_CUSTOM_RULE_SOUND_SETTINGS;
}
@Override
@@ -131,19 +131,19 @@
mControllers = new ArrayList<>();
mControllers.add(new ZenRuleCustomSwitchPreferenceController(context,
getSettingsLifecycle(), ALARMS_KEY, ZenPolicy.PRIORITY_CATEGORY_ALARMS,
- MetricsEvent.ACTION_ZEN_ALLOW_ALARMS));
+ SettingsEnums.ACTION_ZEN_ALLOW_ALARMS));
mControllers.add(new ZenRuleCustomSwitchPreferenceController(context,
getSettingsLifecycle(), MEDIA_KEY, ZenPolicy.PRIORITY_CATEGORY_MEDIA,
- MetricsEvent.ACTION_ZEN_ALLOW_MEDIA));
+ SettingsEnums.ACTION_ZEN_ALLOW_MEDIA));
mControllers.add(new ZenRuleCustomSwitchPreferenceController(context,
getSettingsLifecycle(), SYSTEM_KEY, ZenPolicy.PRIORITY_CATEGORY_SYSTEM,
- MetricsEvent.ACTION_ZEN_ALLOW_SYSTEM));
+ SettingsEnums.ACTION_ZEN_ALLOW_SYSTEM));
mControllers.add(new ZenRuleCustomSwitchPreferenceController(context,
getSettingsLifecycle(), REMINDERS_KEY, ZenPolicy.PRIORITY_CATEGORY_REMINDERS,
- MetricsEvent.ACTION_ZEN_ALLOW_REMINDERS));
+ SettingsEnums.ACTION_ZEN_ALLOW_REMINDERS));
mControllers.add(new ZenRuleCustomSwitchPreferenceController(context,
getSettingsLifecycle(), EVENTS_KEY, ZenPolicy.PRIORITY_CATEGORY_EVENTS,
- MetricsEvent.ACTION_ZEN_ALLOW_EVENTS));
+ SettingsEnums.ACTION_ZEN_ALLOW_EVENTS));
return mControllers;
}
diff --git a/src/com/android/settings/notification/ZenCustomRuleMessagesSettings.java b/src/com/android/settings/notification/ZenCustomRuleMessagesSettings.java
index 8db2824..746dff3 100644
--- a/src/com/android/settings/notification/ZenCustomRuleMessagesSettings.java
+++ b/src/com/android/settings/notification/ZenCustomRuleMessagesSettings.java
@@ -16,13 +16,13 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.widget.FooterPreference;
@@ -42,7 +42,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.ZEN_CUSTOM_RULE_MESSAGES;
+ return SettingsEnums.ZEN_CUSTOM_RULE_MESSAGES;
}
@Override
diff --git a/src/com/android/settings/notification/ZenCustomRuleNotificationsSettings.java b/src/com/android/settings/notification/ZenCustomRuleNotificationsSettings.java
index a23bc6d..9d7d5a3 100644
--- a/src/com/android/settings/notification/ZenCustomRuleNotificationsSettings.java
+++ b/src/com/android/settings/notification/ZenCustomRuleNotificationsSettings.java
@@ -16,9 +16,9 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.widget.FooterPreference;
@@ -58,6 +58,6 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.ZEN_CUSTOM_RULE_NOTIFICATION_RESTRICTIONS;
+ return SettingsEnums.ZEN_CUSTOM_RULE_NOTIFICATION_RESTRICTIONS;
}
}
diff --git a/src/com/android/settings/notification/ZenCustomRuleSettings.java b/src/com/android/settings/notification/ZenCustomRuleSettings.java
index ebd6306..d7ca8c0 100644
--- a/src/com/android/settings/notification/ZenCustomRuleSettings.java
+++ b/src/com/android/settings/notification/ZenCustomRuleSettings.java
@@ -16,9 +16,9 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -37,7 +37,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.ZEN_CUSTOM_RULE_SETTINGS;
+ return SettingsEnums.ZEN_CUSTOM_RULE_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/notification/ZenDeleteRuleDialog.java b/src/com/android/settings/notification/ZenDeleteRuleDialog.java
index 804196e..694fcba 100644
--- a/src/com/android/settings/notification/ZenDeleteRuleDialog.java
+++ b/src/com/android/settings/notification/ZenDeleteRuleDialog.java
@@ -17,18 +17,18 @@
package com.android.settings.notification;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.BidiFormatter;
import android.view.View;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.settings.R;
-import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
-
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
+import com.android.settings.R;
+import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
+
public class ZenDeleteRuleDialog extends InstrumentedDialogFragment {
protected static final String TAG = "ZenDeleteRuleDialog";
private static final String EXTRA_ZEN_RULE_NAME = "zen_rule_name";
@@ -58,7 +58,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.NOTIFICATION_ZEN_MODE_DELETE_RULE_DIALOG;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_DELETE_RULE_DIALOG;
}
@Override
diff --git a/src/com/android/settings/notification/ZenModeAlarmsPreferenceController.java b/src/com/android/settings/notification/ZenModeAlarmsPreferenceController.java
index b877668..00e9736 100644
--- a/src/com/android/settings/notification/ZenModeAlarmsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeAlarmsPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import android.app.NotificationManager.Policy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.Settings;
import android.util.Log;
@@ -24,7 +25,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.core.lifecycle.Lifecycle;
public class ZenModeAlarmsPreferenceController extends
@@ -75,7 +75,7 @@
Log.d(TAG, "onPrefChange allowAlarms=" + allowAlarms);
}
- mMetricsFeatureProvider.action(mContext, MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_ALARMS,
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ZEN_ALLOW_ALARMS,
allowAlarms);
mBackend.saveSoundPolicy(Policy.PRIORITY_CATEGORY_ALARMS, allowAlarms);
diff --git a/src/com/android/settings/notification/ZenModeAllBypassingAppsPreferenceController.java b/src/com/android/settings/notification/ZenModeAllBypassingAppsPreferenceController.java
index 5539ba4..ee7868c 100644
--- a/src/com/android/settings/notification/ZenModeAllBypassingAppsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeAllBypassingAppsPreferenceController.java
@@ -18,11 +18,17 @@
import android.app.Application;
import android.app.NotificationChannel;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.Settings;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import androidx.annotation.VisibleForTesting;
+import androidx.core.text.BidiFormatter;
+import androidx.fragment.app.Fragment;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.applications.AppInfoBase;
import com.android.settings.core.PreferenceControllerMixin;
@@ -34,13 +40,6 @@
import java.util.ArrayList;
import java.util.List;
-import androidx.annotation.VisibleForTesting;
-import androidx.core.text.BidiFormatter;
-import androidx.fragment.app.Fragment;
-import androidx.lifecycle.Lifecycle;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceScreen;
-
/**
* Adds a preference to the PreferenceScreen for each notification channel that can bypass DND.
*/
@@ -139,7 +138,7 @@
.setTitleRes(R.string.notification_channel_title)
.setResultListener(mHostFragment, 0)
.setSourceMetricsCategory(
- MetricsEvent.NOTIFICATION_ZEN_MODE_OVERRIDING_APP)
+ SettingsEnums.NOTIFICATION_ZEN_MODE_OVERRIDING_APP)
.launch();
return true;
}
diff --git a/src/com/android/settings/notification/ZenModeAutomationSettings.java b/src/com/android/settings/notification/ZenModeAutomationSettings.java
index 57ee545..0f87907 100644
--- a/src/com/android/settings/notification/ZenModeAutomationSettings.java
+++ b/src/com/android/settings/notification/ZenModeAutomationSettings.java
@@ -19,6 +19,7 @@
import android.app.AlertDialog;
import android.app.AutomaticZenRule;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -30,7 +31,6 @@
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -86,7 +86,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_AUTOMATION;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_AUTOMATION;
}
protected static ManagedServiceSettings.Config getConditionProviderConfig() {
diff --git a/src/com/android/settings/notification/ZenModeBlockedEffectsSettings.java b/src/com/android/settings/notification/ZenModeBlockedEffectsSettings.java
index 6c7477a..613bd35 100644
--- a/src/com/android/settings/notification/ZenModeBlockedEffectsSettings.java
+++ b/src/com/android/settings/notification/ZenModeBlockedEffectsSettings.java
@@ -24,11 +24,11 @@
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_PEEK;
import static android.app.NotificationManager.Policy.SUPPRESSED_EFFECT_STATUS_BAR;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -59,26 +59,26 @@
List<AbstractPreferenceController> controllers = new ArrayList<>();
controllers.add(new ZenModeVisEffectPreferenceController(context, lifecycle,
"zen_effect_intent", SUPPRESSED_EFFECT_FULL_SCREEN_INTENT,
- MetricsEvent.ACTION_ZEN_BLOCK_FULL_SCREEN_INTENTS, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_FULL_SCREEN_INTENTS, null));
controllers.add(new ZenModeVisEffectPreferenceController(context, lifecycle,
"zen_effect_light", SUPPRESSED_EFFECT_LIGHTS,
- MetricsEvent.ACTION_ZEN_BLOCK_LIGHT, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_LIGHT, null));
controllers.add(new ZenModeVisEffectPreferenceController(context, lifecycle,
"zen_effect_peek", SUPPRESSED_EFFECT_PEEK,
- MetricsEvent.ACTION_ZEN_BLOCK_PEEK, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_PEEK, null));
controllers.add(new ZenModeVisEffectPreferenceController(context, lifecycle,
"zen_effect_status", SUPPRESSED_EFFECT_STATUS_BAR,
- MetricsEvent.ACTION_ZEN_BLOCK_STATUS,
+ SettingsEnums.ACTION_ZEN_BLOCK_STATUS,
new int[] {SUPPRESSED_EFFECT_NOTIFICATION_LIST}));
controllers.add(new ZenModeVisEffectPreferenceController(context, lifecycle,
"zen_effect_badge", SUPPRESSED_EFFECT_BADGE,
- MetricsEvent.ACTION_ZEN_BLOCK_BADGE, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_BADGE, null));
controllers.add(new ZenModeVisEffectPreferenceController(context, lifecycle,
"zen_effect_ambient", SUPPRESSED_EFFECT_AMBIENT,
- MetricsEvent.ACTION_ZEN_BLOCK_AMBIENT, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_AMBIENT, null));
controllers.add(new ZenModeVisEffectPreferenceController(context, lifecycle,
"zen_effect_list", SUPPRESSED_EFFECT_NOTIFICATION_LIST,
- MetricsEvent.ACTION_ZEN_BLOCK_NOTIFICATION_LIST, null));
+ SettingsEnums.ACTION_ZEN_BLOCK_NOTIFICATION_LIST, null));
return controllers;
}
@@ -89,7 +89,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ZEN_WHAT_TO_BLOCK;
+ return SettingsEnums.ZEN_WHAT_TO_BLOCK;
}
/**
diff --git a/src/com/android/settings/notification/ZenModeButtonPreferenceController.java b/src/com/android/settings/notification/ZenModeButtonPreferenceController.java
index 8ebc6b8..4829a28 100644
--- a/src/com/android/settings/notification/ZenModeButtonPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeButtonPreferenceController.java
@@ -16,6 +16,7 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.Settings;
import android.view.View;
@@ -24,7 +25,6 @@
import androidx.fragment.app.FragmentManager;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -70,7 +70,7 @@
.findViewById(R.id.zen_mode_settings_turn_off_button);
mZenButtonOff.setOnClickListener(v -> {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
+ SettingsEnums.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
mBackend.setZenMode(Settings.Global.ZEN_MODE_OFF);
});
}
@@ -100,21 +100,21 @@
case Settings.Secure.ZEN_DURATION_PROMPT:
mZenButtonOn.setOnClickListener(v -> {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
+ SettingsEnums.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
new SettingsEnableZenModeDialog().show(mFragment, TAG);
});
break;
case Settings.Secure.ZEN_DURATION_FOREVER:
mZenButtonOn.setOnClickListener(v -> {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
+ SettingsEnums.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
mBackend.setZenMode(Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS);
});
break;
default:
mZenButtonOn.setOnClickListener(v -> {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
+ SettingsEnums.ACTION_ZEN_TOGGLE_DND_BUTTON, false);
mBackend.setZenModeForDuration(zenDuration);
});
}
diff --git a/src/com/android/settings/notification/ZenModeBypassingAppsSettings.java b/src/com/android/settings/notification/ZenModeBypassingAppsSettings.java
index 53dc8d1..455de42 100644
--- a/src/com/android/settings/notification/ZenModeBypassingAppsSettings.java
+++ b/src/com/android/settings/notification/ZenModeBypassingAppsSettings.java
@@ -18,10 +18,12 @@
import android.app.Activity;
import android.app.Application;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import androidx.fragment.app.Fragment;
+
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -31,8 +33,6 @@
import java.util.ArrayList;
import java.util.List;
-import androidx.fragment.app.Fragment;
-
@SearchIndexable
public class ZenModeBypassingAppsSettings extends ZenModeSettingsBase implements
Indexable {
@@ -69,7 +69,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_OVERRIDING_APPS;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_OVERRIDING_APPS;
}
/**
diff --git a/src/com/android/settings/notification/ZenModeCallsPreferenceController.java b/src/com/android/settings/notification/ZenModeCallsPreferenceController.java
index 5bacafb..0a8b931 100644
--- a/src/com/android/settings/notification/ZenModeCallsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeCallsPreferenceController.java
@@ -18,11 +18,11 @@
import android.content.Context;
+import androidx.preference.Preference;
+
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
-import androidx.preference.Preference;
-
public class ZenModeCallsPreferenceController extends
AbstractZenModePreferenceController implements PreferenceControllerMixin {
diff --git a/src/com/android/settings/notification/ZenModeCallsSettings.java b/src/com/android/settings/notification/ZenModeCallsSettings.java
index fa77bb0..a1d0ec7 100644
--- a/src/com/android/settings/notification/ZenModeCallsSettings.java
+++ b/src/com/android/settings/notification/ZenModeCallsSettings.java
@@ -18,10 +18,10 @@
import static android.app.NotificationManager.Policy.PRIORITY_CATEGORY_CALLS;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -61,7 +61,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_PRIORITY;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_PRIORITY;
}
/**
diff --git a/src/com/android/settings/notification/ZenModeEventRuleSettings.java b/src/com/android/settings/notification/ZenModeEventRuleSettings.java
index ee3ed1c..4a1a342 100644
--- a/src/com/android/settings/notification/ZenModeEventRuleSettings.java
+++ b/src/com/android/settings/notification/ZenModeEventRuleSettings.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import android.app.AutomaticZenRule;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.database.Cursor;
@@ -33,7 +34,6 @@
import androidx.preference.PreferenceScreen;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -180,7 +180,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_EVENT_RULE;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_EVENT_RULE;
}
private List<CalendarInfo> getCalendars(Context context) {
diff --git a/src/com/android/settings/notification/ZenModeEventsPreferenceController.java b/src/com/android/settings/notification/ZenModeEventsPreferenceController.java
index 235ebd5..9a45a90 100644
--- a/src/com/android/settings/notification/ZenModeEventsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeEventsPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import android.app.NotificationManager.Policy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.Settings;
import android.util.Log;
@@ -24,7 +25,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.core.lifecycle.Lifecycle;
public class ZenModeEventsPreferenceController extends AbstractZenModePreferenceController
@@ -70,7 +70,7 @@
if (ZenModeSettingsBase.DEBUG) {
Log.d(TAG, "onPrefChange allowEvents=" + allowEvents);
}
- mMetricsFeatureProvider.action(mContext, MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_EVENTS,
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ZEN_ALLOW_EVENTS,
allowEvents);
mBackend.saveSoundPolicy(Policy.PRIORITY_CATEGORY_EVENTS, allowEvents);
return true;
diff --git a/src/com/android/settings/notification/ZenModeMessagesSettings.java b/src/com/android/settings/notification/ZenModeMessagesSettings.java
index e09d583..a03d088 100644
--- a/src/com/android/settings/notification/ZenModeMessagesSettings.java
+++ b/src/com/android/settings/notification/ZenModeMessagesSettings.java
@@ -18,10 +18,10 @@
import static android.app.NotificationManager.Policy.PRIORITY_CATEGORY_MESSAGES;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -58,7 +58,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_PRIORITY;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_PRIORITY;
}
/**
diff --git a/src/com/android/settings/notification/ZenModeRemindersPreferenceController.java b/src/com/android/settings/notification/ZenModeRemindersPreferenceController.java
index 41f1eb1..8e64be3 100644
--- a/src/com/android/settings/notification/ZenModeRemindersPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeRemindersPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.Settings;
import android.util.Log;
@@ -24,7 +25,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.core.lifecycle.Lifecycle;
public class ZenModeRemindersPreferenceController extends AbstractZenModePreferenceController
@@ -71,7 +71,7 @@
Log.d(TAG, "onPrefChange allowReminders=" + allowReminders);
}
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_REMINDERS, allowReminders);
+ SettingsEnums.ACTION_ZEN_ALLOW_REMINDERS, allowReminders);
mBackend.saveSoundPolicy(NotificationManager.Policy.PRIORITY_CATEGORY_REMINDERS,
allowReminders);
return true;
diff --git a/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceController.java b/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceController.java
index db5c6e1..d658d5f 100644
--- a/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeRepeatCallersPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import android.app.NotificationManager.Policy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.Settings;
import android.util.Log;
@@ -25,7 +26,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -95,7 +95,7 @@
Log.d(TAG, "onPrefChange allowRepeatCallers=" + allowRepeatCallers);
}
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_REPEAT_CALLS, allowRepeatCallers);
+ SettingsEnums.ACTION_ZEN_ALLOW_REPEAT_CALLS, allowRepeatCallers);
mBackend.saveSoundPolicy(Policy.PRIORITY_CATEGORY_REPEAT_CALLERS, allowRepeatCallers);
return true;
}
diff --git a/src/com/android/settings/notification/ZenModeRestrictNotificationsSettings.java b/src/com/android/settings/notification/ZenModeRestrictNotificationsSettings.java
index 56ed086..90d97f0 100644
--- a/src/com/android/settings/notification/ZenModeRestrictNotificationsSettings.java
+++ b/src/com/android/settings/notification/ZenModeRestrictNotificationsSettings.java
@@ -16,11 +16,11 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -71,7 +71,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SETTINGS_ZEN_NOTIFICATIONS;
+ return SettingsEnums.SETTINGS_ZEN_NOTIFICATIONS;
}
/**
diff --git a/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java b/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
index 8aa993f..e879ece 100644
--- a/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
+++ b/src/com/android/settings/notification/ZenModeScheduleRuleSettings.java
@@ -19,6 +19,7 @@
import android.app.AutomaticZenRule;
import android.app.Dialog;
import android.app.TimePickerDialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
@@ -37,7 +38,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -211,7 +211,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_SCHEDULE_RULE;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_SCHEDULE_RULE;
}
@Override
@@ -302,7 +302,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_ZEN_TIMEPICKER;
+ return SettingsEnums.DIALOG_ZEN_TIMEPICKER;
}
@Override
diff --git a/src/com/android/settings/notification/ZenModeSettings.java b/src/com/android/settings/notification/ZenModeSettings.java
index bdf80a6..9360a33 100644
--- a/src/com/android/settings/notification/ZenModeSettings.java
+++ b/src/com/android/settings/notification/ZenModeSettings.java
@@ -28,8 +28,8 @@
import android.app.AutomaticZenRule;
import android.app.NotificationManager;
import android.app.NotificationManager.Policy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import android.icu.text.ListFormatter;
import android.provider.SearchIndexableResource;
import android.provider.Settings;
import android.service.notification.ZenModeConfig;
@@ -37,7 +37,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -66,7 +65,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE;
}
@Override
diff --git a/src/com/android/settings/notification/ZenModeSettingsFooterPreferenceController.java b/src/com/android/settings/notification/ZenModeSettingsFooterPreferenceController.java
index 7c2464c..e7ce1dd 100644
--- a/src/com/android/settings/notification/ZenModeSettingsFooterPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeSettingsFooterPreferenceController.java
@@ -18,6 +18,7 @@
import android.app.Dialog;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.icu.text.ListFormatter;
@@ -34,7 +35,6 @@
import androidx.fragment.app.FragmentManager;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -225,7 +225,7 @@
.setDestination(
ZenModeAutomationSettings.class.getName())
.setSourceMetricsCategory(
- MetricsEvent.NOTIFICATION_ZEN_MODE_AUTOMATION)
+ SettingsEnums.NOTIFICATION_ZEN_MODE_AUTOMATION)
.launch();
}
})
@@ -270,7 +270,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ZEN_CUSTOM_SETTINGS_DIALOG;
+ return SettingsEnums.ZEN_CUSTOM_SETTINGS_DIALOG;
}
private int getAllowRes(boolean allow) {
diff --git a/src/com/android/settings/notification/ZenModeSliceBuilder.java b/src/com/android/settings/notification/ZenModeSliceBuilder.java
index 5c88fb6..ceb36fe 100644
--- a/src/com/android/settings/notification/ZenModeSliceBuilder.java
+++ b/src/com/android/settings/notification/ZenModeSliceBuilder.java
@@ -23,6 +23,7 @@
import android.annotation.ColorInt;
import android.app.NotificationManager;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
@@ -35,7 +36,6 @@
import androidx.slice.builders.ListBuilder.RowBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -114,7 +114,7 @@
final String screenTitle = context.getText(R.string.zen_mode_settings_title).toString();
return SliceBuilderUtils.buildSearchResultPageIntent(context,
ZenModeSettings.class.getName(), ZEN_MODE_KEY, screenTitle,
- MetricsEvent.NOTIFICATION_ZEN_MODE)
+ SettingsEnums.NOTIFICATION_ZEN_MODE)
.setClassName(context.getPackageName(), SubSettings.class.getName())
.setData(contentUri);
}
diff --git a/src/com/android/settings/notification/ZenModeSoundVibrationSettings.java b/src/com/android/settings/notification/ZenModeSoundVibrationSettings.java
index 5bc5848..9f30759 100644
--- a/src/com/android/settings/notification/ZenModeSoundVibrationSettings.java
+++ b/src/com/android/settings/notification/ZenModeSoundVibrationSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -64,7 +64,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_PRIORITY;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_PRIORITY;
}
/**
diff --git a/src/com/android/settings/notification/ZenModeSystemPreferenceController.java b/src/com/android/settings/notification/ZenModeSystemPreferenceController.java
index 73907b9..c2f4060 100644
--- a/src/com/android/settings/notification/ZenModeSystemPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeSystemPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import android.app.NotificationManager.Policy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.Settings;
import android.util.Log;
@@ -24,7 +25,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.core.lifecycle.Lifecycle;
public class ZenModeSystemPreferenceController extends
@@ -74,7 +74,7 @@
Log.d(TAG, "onPrefChange allowSystem=" + allowSystem);
}
- mMetricsFeatureProvider.action(mContext, MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_SYSTEM,
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ZEN_ALLOW_SYSTEM,
allowSystem);
mBackend.saveSoundPolicy(Policy.PRIORITY_CATEGORY_SYSTEM, allowSystem);
return true;
diff --git a/src/com/android/settings/notification/ZenModeVisEffectsAllPreferenceController.java b/src/com/android/settings/notification/ZenModeVisEffectsAllPreferenceController.java
index 66b2c7b..07e3429 100644
--- a/src/com/android/settings/notification/ZenModeVisEffectsAllPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeVisEffectsAllPreferenceController.java
@@ -17,12 +17,12 @@
package com.android.settings.notification;
import android.app.NotificationManager.Policy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.core.lifecycle.Lifecycle;
public class ZenModeVisEffectsAllPreferenceController
@@ -70,7 +70,7 @@
@Override
public void onRadioButtonClick(ZenCustomRadioButtonPreference p) {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_SOUND_AND_VIS_EFFECTS, true);
+ SettingsEnums.ACTION_ZEN_SOUND_AND_VIS_EFFECTS, true);
mBackend.saveVisualEffectsPolicy(EFFECTS, true);
}
}
diff --git a/src/com/android/settings/notification/ZenModeVisEffectsCustomPreferenceController.java b/src/com/android/settings/notification/ZenModeVisEffectsCustomPreferenceController.java
index 414465f..6948669 100644
--- a/src/com/android/settings/notification/ZenModeVisEffectsCustomPreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeVisEffectsCustomPreferenceController.java
@@ -17,12 +17,12 @@
package com.android.settings.notification;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -81,7 +81,7 @@
protected void select() {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_CUSTOM, true);
+ SettingsEnums.ACTION_ZEN_CUSTOM, true);
}
private void launchCustomSettings() {
@@ -89,7 +89,7 @@
new SubSettingLauncher(mContext)
.setDestination(ZenModeBlockedEffectsSettings.class.getName())
.setTitleRes(R.string.zen_mode_what_to_block_title)
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.SETTINGS_ZEN_NOTIFICATIONS)
+ .setSourceMetricsCategory(SettingsEnums.SETTINGS_ZEN_NOTIFICATIONS)
.launch();
}
}
\ No newline at end of file
diff --git a/src/com/android/settings/notification/ZenModeVisEffectsNonePreferenceController.java b/src/com/android/settings/notification/ZenModeVisEffectsNonePreferenceController.java
index 17fbdb2..7f729c7 100644
--- a/src/com/android/settings/notification/ZenModeVisEffectsNonePreferenceController.java
+++ b/src/com/android/settings/notification/ZenModeVisEffectsNonePreferenceController.java
@@ -17,12 +17,12 @@
package com.android.settings.notification;
import android.app.NotificationManager.Policy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.core.lifecycle.Lifecycle;
public class ZenModeVisEffectsNonePreferenceController
@@ -69,7 +69,7 @@
@Override
public void onRadioButtonClick(ZenCustomRadioButtonPreference preference) {
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_SOUND_ONLY, true);
+ SettingsEnums.ACTION_ZEN_SOUND_ONLY, true);
mBackend.saveVisualEffectsPolicy(EFFECTS, false);
}
}
diff --git a/src/com/android/settings/notification/ZenOnboardingActivity.java b/src/com/android/settings/notification/ZenOnboardingActivity.java
index 9e90415..87411c2 100644
--- a/src/com/android/settings/notification/ZenOnboardingActivity.java
+++ b/src/com/android/settings/notification/ZenOnboardingActivity.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.NotificationManager;
import android.app.NotificationManager.Policy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -32,7 +33,6 @@
import androidx.annotation.VisibleForTesting;
import com.android.internal.logging.MetricsLogger;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
import com.android.settings.overlay.FeatureFactory;
@@ -100,7 +100,7 @@
mKeepCurrentSettingButton.setOnClickListener(currentSettingClickListener);
mKeepCurrentSettingButton.setChecked(true);
- mMetrics.visible(MetricsEvent.SETTINGS_ZEN_ONBOARDING);
+ mMetrics.visible(SettingsEnums.SETTINGS_ZEN_ONBOARDING);
}
@VisibleForTesting
@@ -114,7 +114,7 @@
}
public void launchSettings(View button) {
- mMetrics.action(MetricsEvent.ACTION_ZEN_ONBOARDING_SETTINGS);
+ mMetrics.action(SettingsEnums.ACTION_ZEN_ONBOARDING_SETTINGS);
Intent settings = new Intent(Settings.ACTION_ZEN_MODE_SETTINGS);
settings.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(settings);
@@ -130,9 +130,9 @@
policy.priorityMessageSenders,
NotificationManager.Policy.getAllSuppressedVisualEffects());
mNm.setNotificationPolicy(newPolicy);
- mMetrics.action(MetricsEvent.ACTION_ZEN_ONBOARDING_OK);
+ mMetrics.action(SettingsEnums.ACTION_ZEN_ONBOARDING_OK);
} else {
- mMetrics.action(MetricsEvent.ACTION_ZEN_ONBOARDING_KEEP_CURRENT_SETTINGS);
+ mMetrics.action(SettingsEnums.ACTION_ZEN_ONBOARDING_KEEP_CURRENT_SETTINGS);
}
Settings.Secure.putInt(getApplicationContext().getContentResolver(),
diff --git a/src/com/android/settings/notification/ZenRuleButtonsPreferenceController.java b/src/com/android/settings/notification/ZenRuleButtonsPreferenceController.java
index 1d43f6d..a773908 100644
--- a/src/com/android/settings/notification/ZenRuleButtonsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleButtonsPreferenceController.java
@@ -17,11 +17,11 @@
package com.android.settings.notification;
import android.app.AutomaticZenRule;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
-import android.util.Log;
import android.view.View;
import androidx.fragment.app.Fragment;
@@ -83,7 +83,7 @@
return;
}
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_MODE_RULE_NAME_CHANGE_OK);
+ SettingsEnums.ACTION_ZEN_MODE_RULE_NAME_CHANGE_OK);
mRule.setName(ruleName);
mRule.setModified(true);
mBackend.updateZenRule(mId, mRule);
@@ -104,7 +104,7 @@
Bundle bundle = new Bundle();
bundle.putString(ZenModeAutomationSettings.DELETE, id);
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_DELETE_RULE_OK);
+ SettingsEnums.ACTION_ZEN_DELETE_RULE_OK);
new SubSettingLauncher(mContext)
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
.setDestination(ZenModeAutomationSettings.class.getName())
diff --git a/src/com/android/settings/notification/ZenRuleCallsPreferenceController.java b/src/com/android/settings/notification/ZenRuleCallsPreferenceController.java
index b27c5fe..87f2db2 100644
--- a/src/com/android/settings/notification/ZenRuleCallsPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleCallsPreferenceController.java
@@ -16,6 +16,7 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
import android.text.TextUtils;
@@ -49,7 +50,7 @@
public boolean onPreferenceChange(Preference preference, Object selectedContactsFrom) {
int allowCalls = ZenModeBackend.getZenPolicySettingFromPrefKey(
selectedContactsFrom.toString());
- mMetricsFeatureProvider.action(mContext, MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_CALLS,
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ZEN_ALLOW_CALLS,
Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_TOGGLE_EXCEPTION, allowCalls),
Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_RULE_ID, mId));
mRule.setZenPolicy(new ZenPolicy.Builder(mRule.getZenPolicy())
diff --git a/src/com/android/settings/notification/ZenRuleCustomPolicyPreferenceController.java b/src/com/android/settings/notification/ZenRuleCustomPolicyPreferenceController.java
index 39de0eb..e41d55f 100644
--- a/src/com/android/settings/notification/ZenRuleCustomPolicyPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleCustomPolicyPreferenceController.java
@@ -16,14 +16,13 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
-import android.util.Log;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.SubSettingLauncher;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -75,7 +74,7 @@
new SubSettingLauncher(mContext)
.setDestination(ZenCustomRuleConfigSettings.class.getName())
.setArguments(createBundle())
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.ZEN_CUSTOM_RULE_SOUND_SETTINGS)
+ .setSourceMetricsCategory(SettingsEnums.ZEN_CUSTOM_RULE_SOUND_SETTINGS)
.launch();
}
}
\ No newline at end of file
diff --git a/src/com/android/settings/notification/ZenRuleCustomSwitchPreferenceController.java b/src/com/android/settings/notification/ZenRuleCustomSwitchPreferenceController.java
index 804469e..69aa81e 100644
--- a/src/com/android/settings/notification/ZenRuleCustomSwitchPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleCustomSwitchPreferenceController.java
@@ -16,6 +16,7 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
import android.util.Log;
diff --git a/src/com/android/settings/notification/ZenRuleDefaultPolicyPreferenceController.java b/src/com/android/settings/notification/ZenRuleDefaultPolicyPreferenceController.java
index 857d853..da40e6c 100644
--- a/src/com/android/settings/notification/ZenRuleDefaultPolicyPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleDefaultPolicyPreferenceController.java
@@ -16,13 +16,14 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.util.Pair;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -53,8 +54,8 @@
if (mId == null || mRule == null) {
return;
}
- mMetricsFeatureProvider.action(mContext, MetricsEvent.ZEN_CUSTOM_RULE_DEFAULT_SETTINGS,
- Pair.create(MetricsEvent.FIELD_ZEN_RULE_ID, mId));
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ZEN_CUSTOM_RULE_DEFAULT_SETTINGS,
+ Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_RULE_ID, mId));
mPreference.setChecked(mRule.getZenPolicy() == null);
}
}
\ No newline at end of file
diff --git a/src/com/android/settings/notification/ZenRuleMessagesPreferenceController.java b/src/com/android/settings/notification/ZenRuleMessagesPreferenceController.java
index 010e152..59ad3a8 100644
--- a/src/com/android/settings/notification/ZenRuleMessagesPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleMessagesPreferenceController.java
@@ -16,6 +16,7 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
import android.text.TextUtils;
@@ -50,7 +51,7 @@
int allowMessages = ZenModeBackend.getZenPolicySettingFromPrefKey(
selectedContactsFrom.toString());
mMetricsFeatureProvider.action(mContext,
- MetricsProto.MetricsEvent.ACTION_ZEN_ALLOW_MESSAGES,
+ SettingsEnums.ACTION_ZEN_ALLOW_MESSAGES,
Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_TOGGLE_EXCEPTION, allowMessages),
Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_RULE_ID, mId));
mRule.setZenPolicy(new ZenPolicy.Builder(mRule.getZenPolicy())
diff --git a/src/com/android/settings/notification/ZenRuleNameDialog.java b/src/com/android/settings/notification/ZenRuleNameDialog.java
index 9ae32ff..edb3035 100644
--- a/src/com/android/settings/notification/ZenRuleNameDialog.java
+++ b/src/com/android/settings/notification/ZenRuleNameDialog.java
@@ -17,6 +17,7 @@
package com.android.settings.notification;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.net.Uri;
@@ -30,7 +31,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -42,7 +42,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.NOTIFICATION_ZEN_MODE_RULE_NAME_DIALOG;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_RULE_NAME_DIALOG;
}
/**
diff --git a/src/com/android/settings/notification/ZenRulePreference.java b/src/com/android/settings/notification/ZenRulePreference.java
index 91f68e8..613eb1d 100644
--- a/src/com/android/settings/notification/ZenRulePreference.java
+++ b/src/com/android/settings/notification/ZenRulePreference.java
@@ -20,10 +20,8 @@
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
-import android.content.pm.ApplicationInfo;
import android.content.pm.ComponentInfo;
import android.content.pm.PackageManager;
-import android.content.pm.ServiceInfo;
import android.service.notification.ZenModeConfig;
import android.view.View;
import android.widget.CheckBox;
@@ -32,7 +30,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
-import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.utils.ManagedServiceSettings;
import com.android.settings.utils.ZenServiceListing;
@@ -40,7 +37,6 @@
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import java.util.Map;
-import java.util.Objects;
public class ZenRulePreference extends TwoTargetPreference {
private static final ManagedServiceSettings.Config CONFIG =
diff --git a/src/com/android/settings/notification/ZenRuleRepeatCallersPreferenceController.java b/src/com/android/settings/notification/ZenRuleRepeatCallersPreferenceController.java
index 1161bec..7f3b063 100644
--- a/src/com/android/settings/notification/ZenRuleRepeatCallersPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleRepeatCallersPreferenceController.java
@@ -15,6 +15,7 @@
*/
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
import android.util.Log;
@@ -24,7 +25,7 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.core.lifecycle.Lifecycle;
public class ZenRuleRepeatCallersPreferenceController extends
@@ -73,9 +74,9 @@
Log.d(TAG, KEY + " onPrefChange mRule=" + mRule + " mCategory="
+ ZenPolicy.PRIORITY_CATEGORY_REPEAT_CALLERS + " allow=" + allow);
}
- mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_ZEN_ALLOW_REPEAT_CALLS,
- Pair.create(MetricsEvent.FIELD_ZEN_TOGGLE_EXCEPTION, allow ? 1 : 0),
- Pair.create(MetricsEvent.FIELD_ZEN_RULE_ID, mId));
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ZEN_ALLOW_REPEAT_CALLS,
+ Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_TOGGLE_EXCEPTION, allow ? 1 : 0),
+ Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_RULE_ID, mId));
mRule.setZenPolicy(new ZenPolicy.Builder(mRule.getZenPolicy())
.allowRepeatCallers(allow)
.build());
diff --git a/src/com/android/settings/notification/ZenRuleSelectionDialog.java b/src/com/android/settings/notification/ZenRuleSelectionDialog.java
index 7f0b4c2..5b4b35b 100644
--- a/src/com/android/settings/notification/ZenRuleSelectionDialog.java
+++ b/src/com/android/settings/notification/ZenRuleSelectionDialog.java
@@ -16,16 +16,14 @@
package com.android.settings.notification;
-import static com.android.internal.logging.nano.MetricsProto.MetricsEvent;
-
import android.app.Dialog;
import android.app.NotificationManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.ApplicationInfo;
import android.content.pm.ComponentInfo;
import android.content.pm.PackageManager;
-import android.content.pm.ServiceInfo;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -37,6 +35,9 @@
import android.widget.LinearLayout;
import android.widget.TextView;
+import androidx.appcompat.app.AlertDialog;
+import androidx.fragment.app.Fragment;
+
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.utils.ZenServiceListing;
@@ -47,9 +48,6 @@
import java.util.Set;
import java.util.TreeSet;
-import androidx.appcompat.app.AlertDialog;
-import androidx.fragment.app.Fragment;
-
public class ZenRuleSelectionDialog extends InstrumentedDialogFragment {
private static final String TAG = "ZenRuleSelectionDialog";
private static final boolean DEBUG = ZenModeSettings.DEBUG;
@@ -72,7 +70,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.NOTIFICATION_ZEN_MODE_RULE_SELECTION_DIALOG;
+ return SettingsEnums.NOTIFICATION_ZEN_MODE_RULE_SELECTION_DIALOG;
}
public static void show(Context context, Fragment parent, PositiveClickListener
diff --git a/src/com/android/settings/notification/ZenRuleVisEffectPreferenceController.java b/src/com/android/settings/notification/ZenRuleVisEffectPreferenceController.java
index 94b8234..f579151 100644
--- a/src/com/android/settings/notification/ZenRuleVisEffectPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleVisEffectPreferenceController.java
@@ -16,9 +16,9 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
-import android.util.Log;
import android.util.Pair;
import androidx.annotation.VisibleForTesting;
diff --git a/src/com/android/settings/notification/ZenRuleVisEffectsAllPreferenceController.java b/src/com/android/settings/notification/ZenRuleVisEffectsAllPreferenceController.java
index 9ddd624..1c6874e 100644
--- a/src/com/android/settings/notification/ZenRuleVisEffectsAllPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleVisEffectsAllPreferenceController.java
@@ -16,15 +16,15 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
-import android.util.Log;
import android.util.Pair;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -44,8 +44,8 @@
mPreference = (ZenCustomRadioButtonPreference) screen.findPreference(getPreferenceKey());
mPreference.setOnRadioButtonClickListener(p -> {
- mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_ZEN_SOUND_ONLY,
- Pair.create(MetricsEvent.FIELD_ZEN_RULE_ID, mId));
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ZEN_SOUND_ONLY,
+ Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_RULE_ID, mId));
mRule.setZenPolicy(new ZenPolicy.Builder(mRule.getZenPolicy())
.showAllVisualEffects()
.build());
diff --git a/src/com/android/settings/notification/ZenRuleVisEffectsCustomPreferenceController.java b/src/com/android/settings/notification/ZenRuleVisEffectsCustomPreferenceController.java
index 64dd71c..3cdd86a 100644
--- a/src/com/android/settings/notification/ZenRuleVisEffectsCustomPreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleVisEffectsCustomPreferenceController.java
@@ -16,13 +16,14 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.util.Pair;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.core.SubSettingLauncher;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -64,12 +65,12 @@
}
private void launchCustomSettings() {
- mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_ZEN_SHOW_CUSTOM,
- Pair.create(MetricsEvent.FIELD_ZEN_RULE_ID, mId));
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ZEN_SHOW_CUSTOM,
+ Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_RULE_ID, mId));
new SubSettingLauncher(mContext)
.setDestination(ZenCustomRuleBlockedEffectsSettings.class.getName())
.setArguments(createBundle())
- .setSourceMetricsCategory(MetricsEvent.ZEN_CUSTOM_RULE_VIS_EFFECTS)
+ .setSourceMetricsCategory(SettingsEnums.ZEN_CUSTOM_RULE_VIS_EFFECTS)
.launch();
}
}
\ No newline at end of file
diff --git a/src/com/android/settings/notification/ZenRuleVisEffectsNonePreferenceController.java b/src/com/android/settings/notification/ZenRuleVisEffectsNonePreferenceController.java
index 4f98924..875fb43 100644
--- a/src/com/android/settings/notification/ZenRuleVisEffectsNonePreferenceController.java
+++ b/src/com/android/settings/notification/ZenRuleVisEffectsNonePreferenceController.java
@@ -16,15 +16,15 @@
package com.android.settings.notification;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.service.notification.ZenPolicy;
-import android.util.Log;
import android.util.Pair;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
+import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -41,11 +41,11 @@
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
- mPreference = (ZenCustomRadioButtonPreference) screen.findPreference(getPreferenceKey());
+ mPreference = screen.findPreference(getPreferenceKey());
mPreference.setOnRadioButtonClickListener(p -> {
- mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_ZEN_SOUND_AND_VIS_EFFECTS,
- Pair.create(MetricsEvent.FIELD_ZEN_RULE_ID, mId));
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_ZEN_SOUND_AND_VIS_EFFECTS,
+ Pair.create(MetricsProto.MetricsEvent.FIELD_ZEN_RULE_ID, mId));
mRule.setZenPolicy(new ZenPolicy.Builder(mRule.getZenPolicy())
.hideAllVisualEffects()
.build());
diff --git a/src/com/android/settings/panel/PanelFragment.java b/src/com/android/settings/panel/PanelFragment.java
index 7655be8..3d302fc 100644
--- a/src/com/android/settings/panel/PanelFragment.java
+++ b/src/com/android/settings/panel/PanelFragment.java
@@ -22,21 +22,18 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-
import android.widget.Button;
import android.widget.TextView;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.settings.R;
-
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.settings.R;
import com.android.settings.overlay.FeatureFactory;
public class PanelFragment extends Fragment {
diff --git a/src/com/android/settings/panel/SettingsPanelActivity.java b/src/com/android/settings/panel/SettingsPanelActivity.java
index ffe94f8..02e14e8 100644
--- a/src/com/android/settings/panel/SettingsPanelActivity.java
+++ b/src/com/android/settings/panel/SettingsPanelActivity.java
@@ -18,7 +18,6 @@
import android.content.Intent;
import android.os.Bundle;
-
import android.util.Log;
import android.view.Gravity;
import android.view.Window;
diff --git a/src/com/android/settings/panel/VolumePanel.java b/src/com/android/settings/panel/VolumePanel.java
index c0118d7..352fed5 100644
--- a/src/com/android/settings/panel/VolumePanel.java
+++ b/src/com/android/settings/panel/VolumePanel.java
@@ -27,6 +27,7 @@
import android.provider.Settings;
import com.android.settings.R;
+
import java.util.ArrayList;
import java.util.List;
diff --git a/src/com/android/settings/password/BiometricFragment.java b/src/com/android/settings/password/BiometricFragment.java
index 3a12bac..13ec543 100644
--- a/src/com/android/settings/password/BiometricFragment.java
+++ b/src/com/android/settings/password/BiometricFragment.java
@@ -27,13 +27,11 @@
import android.os.Handler;
import android.os.Looper;
-import com.android.settings.core.InstrumentedFragment;
-
-import androidx.annotation.NonNull;
-import androidx.fragment.app.Fragment;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import com.android.settings.core.InstrumentedFragment;
+
import java.util.concurrent.Executor;
/**
diff --git a/src/com/android/settings/password/ChooseLockGeneric.java b/src/com/android/settings/password/ChooseLockGeneric.java
index cbb3593..ca96344 100644
--- a/src/com/android/settings/password/ChooseLockGeneric.java
+++ b/src/com/android/settings/password/ChooseLockGeneric.java
@@ -25,6 +25,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.UserInfo;
@@ -51,7 +52,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.EncryptionInterstitial;
import com.android.settings.EventLogTags;
@@ -157,7 +157,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CHOOSE_LOCK_GENERIC;
+ return SettingsEnums.CHOOSE_LOCK_GENERIC;
}
@Override
@@ -1022,7 +1022,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_FRP;
+ return SettingsEnums.DIALOG_FRP;
}
}
}
diff --git a/src/com/android/settings/password/ChooseLockPassword.java b/src/com/android/settings/password/ChooseLockPassword.java
index 35bc45e..6ff93f3 100644
--- a/src/com/android/settings/password/ChooseLockPassword.java
+++ b/src/com/android/settings/password/ChooseLockPassword.java
@@ -25,6 +25,7 @@
import android.app.Activity;
import android.app.admin.DevicePolicyManager;
import android.app.admin.PasswordMetrics;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources.Theme;
@@ -56,7 +57,6 @@
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockPatternUtils.RequestThrottledException;
import com.android.internal.widget.TextViewInputDisabler;
@@ -526,7 +526,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CHOOSE_LOCK_PASSWORD;
+ return SettingsEnums.CHOOSE_LOCK_PASSWORD;
}
@Override
diff --git a/src/com/android/settings/password/ChooseLockPattern.java b/src/com/android/settings/password/ChooseLockPattern.java
index 2738a26..55ca4ba 100644
--- a/src/com/android/settings/password/ChooseLockPattern.java
+++ b/src/com/android/settings/password/ChooseLockPattern.java
@@ -17,6 +17,7 @@
package com.android.settings.password;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.res.ColorStateList;
@@ -34,7 +35,6 @@
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.LockPatternUtils.RequestThrottledException;
@@ -303,7 +303,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CHOOSE_LOCK_PATTERN;
+ return SettingsEnums.CHOOSE_LOCK_PATTERN;
}
diff --git a/src/com/android/settings/password/ChooseLockSettingsHelper.java b/src/com/android/settings/password/ChooseLockSettingsHelper.java
index 1c9191a..8d0fa60 100644
--- a/src/com/android/settings/password/ChooseLockSettingsHelper.java
+++ b/src/com/android/settings/password/ChooseLockSettingsHelper.java
@@ -29,7 +29,6 @@
import androidx.fragment.app.Fragment;
import com.android.internal.widget.LockPatternUtils;
-import com.android.settings.SettingsActivity;
import com.android.settings.Utils;
import com.google.android.setupcompat.util.WizardManagerHelper;
diff --git a/src/com/android/settings/password/ChooseLockTypeDialogFragment.java b/src/com/android/settings/password/ChooseLockTypeDialogFragment.java
index 191f827..8793471 100644
--- a/src/com/android/settings/password/ChooseLockTypeDialogFragment.java
+++ b/src/com/android/settings/password/ChooseLockTypeDialogFragment.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@@ -34,7 +35,6 @@
import androidx.appcompat.app.AlertDialog.Builder;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -139,7 +139,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SETTINGS_CHOOSE_LOCK_DIALOG;
+ return SettingsEnums.SETTINGS_CHOOSE_LOCK_DIALOG;
}
private static class ScreenLockAdapter extends ArrayAdapter<ScreenLockType> {
diff --git a/src/com/android/settings/password/ConfirmLockPassword.java b/src/com/android/settings/password/ConfirmLockPassword.java
index b5bca15..7344077 100644
--- a/src/com/android/settings/password/ConfirmLockPassword.java
+++ b/src/com/android/settings/password/ConfirmLockPassword.java
@@ -17,6 +17,7 @@
package com.android.settings.password;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.graphics.Typeface;
@@ -41,7 +42,6 @@
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternChecker;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.TextViewInputDisabler;
@@ -274,7 +274,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CONFIRM_LOCK_PASSWORD;
+ return SettingsEnums.CONFIRM_LOCK_PASSWORD;
}
@Override
diff --git a/src/com/android/settings/password/ConfirmLockPattern.java b/src/com/android/settings/password/ConfirmLockPattern.java
index 83141ea..5645193 100644
--- a/src/com/android/settings/password/ConfirmLockPattern.java
+++ b/src/com/android/settings/password/ConfirmLockPattern.java
@@ -17,6 +17,7 @@
package com.android.settings.password;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
@@ -31,7 +32,6 @@
import android.view.animation.Interpolator;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LinearLayoutWithDefaultTouchRecepient;
import com.android.internal.widget.LockPatternChecker;
import com.android.internal.widget.LockPatternUtils;
@@ -200,7 +200,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CONFIRM_LOCK_PATTERN;
+ return SettingsEnums.CONFIRM_LOCK_PATTERN;
}
@Override
diff --git a/src/com/android/settings/password/SetupSkipDialog.java b/src/com/android/settings/password/SetupSkipDialog.java
index ad28ddb..dc1894e 100644
--- a/src/com/android/settings/password/SetupSkipDialog.java
+++ b/src/com/android/settings/password/SetupSkipDialog.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
@@ -25,7 +26,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -48,7 +48,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_FINGERPRINT_SKIP_SETUP;
+ return SettingsEnums.DIALOG_FINGERPRINT_SKIP_SETUP;
}
@Override
diff --git a/src/com/android/settings/print/PrintJobSettingsFragment.java b/src/com/android/settings/print/PrintJobSettingsFragment.java
index 1d6ff5a..eeb8ed4 100644
--- a/src/com/android/settings/print/PrintJobSettingsFragment.java
+++ b/src/com/android/settings/print/PrintJobSettingsFragment.java
@@ -16,6 +16,7 @@
package com.android.settings.print;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.print.PrintJob;
@@ -24,7 +25,6 @@
import android.view.MenuItem;
import android.view.View;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -56,7 +56,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.PRINT_JOB_SETTINGS;
+ return SettingsEnums.PRINT_JOB_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/print/PrintServiceSettingsFragment.java b/src/com/android/settings/print/PrintServiceSettingsFragment.java
index 58e4ada..d120062 100644
--- a/src/com/android/settings/print/PrintServiceSettingsFragment.java
+++ b/src/com/android/settings/print/PrintServiceSettingsFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.print;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -55,7 +56,6 @@
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.AdapterDataObserver;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
@@ -117,7 +117,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.PRINT_SERVICE_SETTINGS;
+ return SettingsEnums.PRINT_SERVICE_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/print/PrintSettingsFragment.java b/src/com/android/settings/print/PrintSettingsFragment.java
index 63ffe87..955d4f7 100644
--- a/src/com/android/settings/print/PrintSettingsFragment.java
+++ b/src/com/android/settings/print/PrintSettingsFragment.java
@@ -18,6 +18,7 @@
import static com.android.settings.print.PrintSettingPreferenceController.shouldShowToUser;
+import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
@@ -51,7 +52,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.search.Indexable;
@@ -96,7 +96,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.PRINT_SETTINGS;
+ return SettingsEnums.PRINT_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/privacy/PermissionBarChartPreferenceController.java b/src/com/android/settings/privacy/PermissionBarChartPreferenceController.java
new file mode 100644
index 0000000..3fac672
--- /dev/null
+++ b/src/com/android/settings/privacy/PermissionBarChartPreferenceController.java
@@ -0,0 +1,165 @@
+/*
+ * 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.settings.privacy;
+
+import static com.android.settingslib.widget.BarChartPreference.MAXIMUM_BAR_VIEWS;
+
+import static java.util.concurrent.TimeUnit.DAYS;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.graphics.drawable.Drawable;
+import android.permission.PermissionControllerManager;
+import android.permission.RuntimePermissionUsageInfo;
+import android.util.Log;
+import android.view.View;
+
+import androidx.annotation.NonNull;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settingslib.widget.BarChartInfo;
+import com.android.settingslib.widget.BarChartPreference;
+import com.android.settingslib.widget.BarViewInfo;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.concurrent.Executors;
+
+
+public class PermissionBarChartPreferenceController extends BasePreferenceController implements
+ PermissionControllerManager.OnPermissionUsageResultCallback {
+
+ private static final String TAG = "BarChartPreferenceCtl";
+
+ private PackageManager mPackageManager;
+ private BarChartPreference mBarChartPreference;
+ private List<RuntimePermissionUsageInfo> mOldUsageInfos;
+
+ public PermissionBarChartPreferenceController(Context context, String preferenceKey) {
+ super(context, preferenceKey);
+ mOldUsageInfos = new ArrayList<>();
+ mPackageManager = context.getPackageManager();
+ }
+
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE_UNSEARCHABLE;
+ }
+
+ @Override
+ public void displayPreference(PreferenceScreen screen) {
+ super.displayPreference(screen);
+ mBarChartPreference = (BarChartPreference) screen.findPreference(getPreferenceKey());
+
+ final BarChartInfo info = new BarChartInfo.Builder()
+ .setTitle(R.string.permission_bar_chart_title)
+ .setDetails(R.string.permission_bar_chart_details)
+ .setEmptyText(R.string.permission_bar_chart_empty_text)
+ .setDetailsOnClickListener((View v) -> {
+ final Intent intent = new Intent(Intent.ACTION_REVIEW_PERMISSION_USAGE);
+ mContext.startActivity(intent);
+ })
+ .build();
+
+ mBarChartPreference.initializeBarChart(info);
+ }
+
+ @Override
+ public void updateState(Preference preference) {
+ retrievePermissionUsageData();
+ }
+
+ @Override
+ public void onPermissionUsageResult(@NonNull List<RuntimePermissionUsageInfo> usageInfos) {
+ usageInfos.sort(Comparator.comparingInt(
+ RuntimePermissionUsageInfo::getAppAccessCount).reversed());
+
+ // If the result is different, we need to update bar views.
+ if (!areSamePermissionGroups(usageInfos)) {
+ mBarChartPreference.setBarViewInfos(createBarViews(usageInfos));
+ mOldUsageInfos = usageInfos;
+ }
+ }
+
+ private void retrievePermissionUsageData() {
+ mContext.getSystemService(PermissionControllerManager.class).getPermissionUsages(
+ false /* countSystem */, (int) DAYS.toSeconds(1),
+ mContext.getMainExecutor() /* executor */, this /* callback */);
+ }
+
+ private BarViewInfo[] createBarViews(List<RuntimePermissionUsageInfo> usageInfos) {
+ if (usageInfos.isEmpty()) {
+ return null;
+ }
+
+ final BarViewInfo[] barViewInfos = new BarViewInfo[
+ Math.min(BarChartPreference.MAXIMUM_BAR_VIEWS, usageInfos.size())];
+
+ for (int index = 0; index < barViewInfos.length; index++) {
+ final RuntimePermissionUsageInfo permissionGroupInfo = usageInfos.get(index);
+
+ barViewInfos[index] = new BarViewInfo(
+ getPermissionGroupIcon(permissionGroupInfo.getName()),
+ permissionGroupInfo.getAppAccessCount(),
+ R.string.storage_detail_apps);
+
+ // Set the click listener for each bar view.
+ // The listener will navigate user to permission usage app.
+ barViewInfos[index].setClickListener((View v) -> {
+ final Intent intent = new Intent(Intent.ACTION_REVIEW_PERMISSION_USAGE);
+ intent.putExtra(Intent.EXTRA_PERMISSION_GROUP_NAME, permissionGroupInfo.getName());
+ mContext.startActivity(intent);
+ });
+ }
+
+ return barViewInfos;
+ }
+
+ private Drawable getPermissionGroupIcon(CharSequence permissionGroup) {
+ Drawable icon = null;
+ try {
+ icon = mPackageManager.getPermissionGroupInfo(permissionGroup.toString(), 0)
+ .loadIcon(mPackageManager);
+ } catch (PackageManager.NameNotFoundException e) {
+ Log.w(TAG, "Cannot find group icon for " + permissionGroup, e);
+ }
+
+ return icon;
+ }
+
+ private boolean areSamePermissionGroups(List<RuntimePermissionUsageInfo> newUsageInfos) {
+ if (newUsageInfos.size() != mOldUsageInfos.size()) {
+ return false;
+ }
+
+ for (int index = 0; index < newUsageInfos.size(); index++) {
+ final RuntimePermissionUsageInfo newInfo = newUsageInfos.get(index);
+ final RuntimePermissionUsageInfo oldInfo = mOldUsageInfos.get(index);
+
+ if (!newInfo.getName().equals(oldInfo.getName()) ||
+ newInfo.getAppAccessCount() != oldInfo.getAppAccessCount()) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
diff --git a/src/com/android/settings/privacy/PrivacyDashboardFragment.java b/src/com/android/settings/privacy/PrivacyDashboardFragment.java
index 91e85b3..8f1d4c7 100644
--- a/src/com/android/settings/privacy/PrivacyDashboardFragment.java
+++ b/src/com/android/settings/privacy/PrivacyDashboardFragment.java
@@ -16,10 +16,10 @@
package com.android.settings.privacy;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.notification.LockScreenNotificationPreferenceController;
@@ -42,7 +42,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TOP_LEVEL_PRIVACY;
+ return SettingsEnums.TOP_LEVEL_PRIVACY;
}
@Override
diff --git a/src/com/android/settings/search/BaseSearchIndexProvider.java b/src/com/android/settings/search/BaseSearchIndexProvider.java
index efbefde..80775bf 100644
--- a/src/com/android/settings/search/BaseSearchIndexProvider.java
+++ b/src/com/android/settings/search/BaseSearchIndexProvider.java
@@ -18,8 +18,7 @@
import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_KEY;
import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_SEARCHABLE;
-import static com.android.settings.core.PreferenceXmlParserUtils.MetadataFlag
- .FLAG_INCLUDE_PREF_SCREEN;
+import static com.android.settings.core.PreferenceXmlParserUtils.MetadataFlag.FLAG_INCLUDE_PREF_SCREEN;
import static com.android.settings.core.PreferenceXmlParserUtils.MetadataFlag.FLAG_NEED_KEY;
import static com.android.settings.core.PreferenceXmlParserUtils.MetadataFlag.FLAG_NEED_SEARCHABLE;
diff --git a/src/com/android/settings/search/SearchFeatureProvider.java b/src/com/android/settings/search/SearchFeatureProvider.java
index 34f8629..b98936e 100644
--- a/src/com/android/settings/search/SearchFeatureProvider.java
+++ b/src/com/android/settings/search/SearchFeatureProvider.java
@@ -20,6 +20,7 @@
import android.annotation.NonNull;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -29,7 +30,6 @@
import android.view.ViewGroup;
import android.widget.Toolbar;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.overlay.FeatureFactory;
@@ -99,7 +99,7 @@
FeatureFactory.getFactory(context).getSlicesFeatureProvider()
.indexSliceDataAsync(activity.getApplicationContext());
FeatureFactory.getFactory(context).getMetricsFeatureProvider()
- .action(context, MetricsProto.MetricsEvent.ACTION_SEARCH_RESULTS);
+ .action(context, SettingsEnums.ACTION_SEARCH_RESULTS);
activity.startActivityForResult(intent, REQUEST_CODE);
});
}
diff --git a/src/com/android/settings/search/actionbar/SearchMenuController.java b/src/com/android/settings/search/actionbar/SearchMenuController.java
index 643f0c3..2f1c270 100644
--- a/src/com/android/settings/search/actionbar/SearchMenuController.java
+++ b/src/com/android/settings/search/actionbar/SearchMenuController.java
@@ -17,6 +17,7 @@
package com.android.settings.search.actionbar;
import android.annotation.NonNull;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -27,7 +28,6 @@
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.overlay.FeatureFactory;
@@ -88,7 +88,7 @@
}
FeatureFactory.getFactory(context).getMetricsFeatureProvider()
- .action(context, MetricsProto.MetricsEvent.ACTION_SEARCH_RESULTS);
+ .action(context, SettingsEnums.ACTION_SEARCH_RESULTS);
mHost.startActivityForResult(intent, 0 /* requestCode */);
return true;
});
diff --git a/src/com/android/settings/security/ConfigureKeyGuardDialog.java b/src/com/android/settings/security/ConfigureKeyGuardDialog.java
index 01c0e9e..fff106c 100644
--- a/src/com/android/settings/security/ConfigureKeyGuardDialog.java
+++ b/src/com/android/settings/security/ConfigureKeyGuardDialog.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
@@ -26,7 +27,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.CredentialStorage;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -44,7 +44,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.CONFIGURE_KEYGUARD_DIALOG;
+ return SettingsEnums.CONFIGURE_KEYGUARD_DIALOG;
}
@Override
diff --git a/src/com/android/settings/security/CryptKeeperSettings.java b/src/com/android/settings/security/CryptKeeperSettings.java
index a0e5a8e..c80ad11 100644
--- a/src/com/android/settings/security/CryptKeeperSettings.java
+++ b/src/com/android/settings/security/CryptKeeperSettings.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -36,7 +37,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.CryptKeeperConfirm;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
@@ -123,7 +123,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CRYPT_KEEPER;
+ return SettingsEnums.CRYPT_KEEPER;
}
@Override
diff --git a/src/com/android/settings/security/EncryptionAndCredential.java b/src/com/android/settings/security/EncryptionAndCredential.java
index 7f50c5d..a6d2a0a 100644
--- a/src/com/android/settings/security/EncryptionAndCredential.java
+++ b/src/com/android/settings/security/EncryptionAndCredential.java
@@ -16,14 +16,13 @@
package com.android.settings.security;
-import static com.android.settings.security.EncryptionStatusPreferenceController
- .PREF_KEY_ENCRYPTION_DETAIL_PAGE;
+import static com.android.settings.security.EncryptionStatusPreferenceController.PREF_KEY_ENCRYPTION_DETAIL_PAGE;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.UserManager;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -46,7 +45,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.ENCRYPTION_AND_CREDENTIAL;
+ return SettingsEnums.ENCRYPTION_AND_CREDENTIAL;
}
@Override
diff --git a/src/com/android/settings/security/LockscreenDashboardFragment.java b/src/com/android/settings/security/LockscreenDashboardFragment.java
index 62c8d6b..1935f05 100644
--- a/src/com/android/settings/security/LockscreenDashboardFragment.java
+++ b/src/com/android/settings/security/LockscreenDashboardFragment.java
@@ -16,20 +16,19 @@
package com.android.settings.security;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
import androidx.annotation.VisibleForTesting;
import com.android.internal.hardware.AmbientDisplayConfiguration;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.display.AmbientDisplayAlwaysOnPreferenceController;
import com.android.settings.display.AmbientDisplayNotificationsPreferenceController;
import com.android.settings.gestures.DoubleTapScreenPreferenceController;
import com.android.settings.gestures.PickupGesturePreferenceController;
-import com.android.settings.gestures.WakeScreenGesturePreferenceController;
import com.android.settings.notification.LockScreenNotificationPreferenceController;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settings.security.screenlock.LockScreenPreferenceController;
@@ -70,7 +69,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SETTINGS_LOCK_SCREEN_PREFERENCES;
+ return SettingsEnums.SETTINGS_LOCK_SCREEN_PREFERENCES;
}
@Override
diff --git a/src/com/android/settings/security/ScreenPinningSettings.java b/src/com/android/settings/security/ScreenPinningSettings.java
index 092ec91..22223fd 100644
--- a/src/com/android/settings/security/ScreenPinningSettings.java
+++ b/src/com/android/settings/security/ScreenPinningSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.security;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
@@ -32,7 +33,6 @@
import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
@@ -61,7 +61,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SCREEN_PINNING;
+ return SettingsEnums.SCREEN_PINNING;
}
@Override
diff --git a/src/com/android/settings/security/SecuritySettings.java b/src/com/android/settings/security/SecuritySettings.java
index aa347c8..660eab5 100644
--- a/src/com/android/settings/security/SecuritySettings.java
+++ b/src/com/android/settings/security/SecuritySettings.java
@@ -15,14 +15,13 @@
*/
package com.android.settings.security;
-import static com.android.settings.security.EncryptionStatusPreferenceController
- .PREF_KEY_ENCRYPTION_SECURITY_PAGE;
+import static com.android.settings.security.EncryptionStatusPreferenceController.PREF_KEY_ENCRYPTION_SECURITY_PAGE;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.biometrics.face.FaceStatusPreferenceController;
import com.android.settings.biometrics.fingerprint.FingerprintProfileStatusPreferenceController;
@@ -54,7 +53,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SECURITY;
+ return SettingsEnums.SECURITY;
}
@Override
diff --git a/src/com/android/settings/security/SimLockPreferenceController.java b/src/com/android/settings/security/SimLockPreferenceController.java
index d8d6252..d4def6b 100644
--- a/src/com/android/settings/security/SimLockPreferenceController.java
+++ b/src/com/android/settings/security/SimLockPreferenceController.java
@@ -77,7 +77,7 @@
*/
private boolean isSimReady() {
final List<SubscriptionInfo> subInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
final int simState = mTelephonyManager.getSimState(subInfo.getSimSlotIndex());
@@ -95,7 +95,7 @@
*/
private boolean isSimIccReady() {
final List<SubscriptionInfo> subInfoList =
- mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubscriptionManager.getActiveSubscriptionInfoList(true);
if (subInfoList != null) {
for (SubscriptionInfo subInfo : subInfoList) {
diff --git a/src/com/android/settings/security/UnificationConfirmationDialog.java b/src/com/android/settings/security/UnificationConfirmationDialog.java
index ba4065f..d8638bc 100644
--- a/src/com/android/settings/security/UnificationConfirmationDialog.java
+++ b/src/com/android/settings/security/UnificationConfirmationDialog.java
@@ -17,13 +17,13 @@
package com.android.settings.security;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.FragmentManager;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -74,6 +74,6 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_UNIFICATION_CONFIRMATION;
+ return SettingsEnums.DIALOG_UNIFICATION_CONFIRMATION;
}
}
diff --git a/src/com/android/settings/security/screenlock/ScreenLockSettings.java b/src/com/android/settings/security/screenlock/ScreenLockSettings.java
index 90b5e3f..3fa9dd8 100644
--- a/src/com/android/settings/security/screenlock/ScreenLockSettings.java
+++ b/src/com/android/settings/security/screenlock/ScreenLockSettings.java
@@ -16,13 +16,13 @@
package com.android.settings.security.screenlock;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.UserHandle;
import android.provider.SearchIndexableResource;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -47,7 +47,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SCREEN_LOCK_SETTINGS;
+ return SettingsEnums.SCREEN_LOCK_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/security/trustagent/TrustAgentSettings.java b/src/com/android/settings/security/trustagent/TrustAgentSettings.java
index 11d2341..36a3867 100644
--- a/src/com/android/settings/security/trustagent/TrustAgentSettings.java
+++ b/src/com/android/settings/security/trustagent/TrustAgentSettings.java
@@ -16,10 +16,10 @@
package com.android.settings.security.trustagent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -35,7 +35,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TRUST_AGENT;
+ return SettingsEnums.TRUST_AGENT;
}
@Override
diff --git a/src/com/android/settings/security/trustagent/TrustAgentsExtendUnlockPreferenceController.java b/src/com/android/settings/security/trustagent/TrustAgentsExtendUnlockPreferenceController.java
index bfbebaf..036e07f 100644
--- a/src/com/android/settings/security/trustagent/TrustAgentsExtendUnlockPreferenceController.java
+++ b/src/com/android/settings/security/trustagent/TrustAgentsExtendUnlockPreferenceController.java
@@ -17,7 +17,6 @@
package com.android.settings.security.trustagent;
import android.content.Context;
-import android.os.UserHandle;
import android.provider.Settings;
import com.android.settings.core.TogglePreferenceController;
diff --git a/src/com/android/settings/security/trustagent/TrustLostLocksScreenPreferenceController.java b/src/com/android/settings/security/trustagent/TrustLostLocksScreenPreferenceController.java
index b5e0dd7..e0c5168 100644
--- a/src/com/android/settings/security/trustagent/TrustLostLocksScreenPreferenceController.java
+++ b/src/com/android/settings/security/trustagent/TrustLostLocksScreenPreferenceController.java
@@ -17,7 +17,6 @@
package com.android.settings.security.trustagent;
import android.content.Context;
-import android.os.UserHandle;
import android.provider.Settings;
import com.android.settings.core.TogglePreferenceController;
diff --git a/src/com/android/settings/shortcut/CreateShortcut.java b/src/com/android/settings/shortcut/CreateShortcut.java
index b5b6438..392685f 100644
--- a/src/com/android/settings/shortcut/CreateShortcut.java
+++ b/src/com/android/settings/shortcut/CreateShortcut.java
@@ -16,13 +16,12 @@
package com.android.settings.shortcut;
-import static com.android.settings.search.actionbar.SearchMenuController
- .NEED_SEARCH_ICON_IN_ACTION_BAR;
+import static com.android.settings.search.actionbar.SearchMenuController.NEED_SEARCH_ICON_IN_ACTION_BAR;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -62,7 +61,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_CREATE_SHORTCUT;
+ return SettingsEnums.SETTINGS_CREATE_SHORTCUT;
}
@Override
diff --git a/src/com/android/settings/shortcut/CreateShortcutPreferenceController.java b/src/com/android/settings/shortcut/CreateShortcutPreferenceController.java
index 3576034..9b9de5f 100644
--- a/src/com/android/settings/shortcut/CreateShortcutPreferenceController.java
+++ b/src/com/android/settings/shortcut/CreateShortcutPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.shortcut;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
@@ -42,7 +43,6 @@
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceGroup;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Settings.TetherSettingsActivity;
import com.android.settings.core.BasePreferenceController;
@@ -213,7 +213,7 @@
return;
}
mMetricsFeatureProvider.action(
- mContext, MetricsProto.MetricsEvent.ACTION_SETTINGS_CREATE_SHORTCUT,
+ mContext, SettingsEnums.ACTION_SETTINGS_CREATE_SHORTCUT,
info.activityInfo.name);
}
diff --git a/src/com/android/settings/sim/SimDialogActivity.java b/src/com/android/settings/sim/SimDialogActivity.java
index 8a99e66..987826c 100644
--- a/src/com/android/settings/sim/SimDialogActivity.java
+++ b/src/com/android/settings/sim/SimDialogActivity.java
@@ -153,7 +153,7 @@
final ArrayList<String> list = new ArrayList<String>();
final SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
final List<SubscriptionInfo> subInfoList =
- subscriptionManager.getActiveSubscriptionInfoList();
+ subscriptionManager.getActiveSubscriptionInfoList(true);
final int selectableSubInfoLength = subInfoList == null ? 0 : subInfoList.size();
final DialogInterface.OnClickListener selectionListener =
diff --git a/src/com/android/settings/sim/SimSelectNotification.java b/src/com/android/settings/sim/SimSelectNotification.java
index 6806f9f..cf67f5e 100644
--- a/src/com/android/settings/sim/SimSelectNotification.java
+++ b/src/com/android/settings/sim/SimSelectNotification.java
@@ -80,7 +80,7 @@
}
}
- List<SubscriptionInfo> sil = subscriptionManager.getActiveSubscriptionInfoList();
+ List<SubscriptionInfo> sil = subscriptionManager.getActiveSubscriptionInfoList(true);
if (sil == null || sil.size() < 1) {
Log.d(TAG, "Subscription list is empty");
return;
diff --git a/src/com/android/settings/sim/SimSettings.java b/src/com/android/settings/sim/SimSettings.java
index cf6d5f3..b646b3b 100644
--- a/src/com/android/settings/sim/SimSettings.java
+++ b/src/com/android/settings/sim/SimSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.sim;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
@@ -36,7 +37,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.TelephonyProperties;
import com.android.settings.R;
import com.android.settings.RestrictedSettingsFragment;
@@ -84,7 +84,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SIM;
+ return SettingsEnums.SIM;
}
@Override
@@ -114,7 +114,7 @@
};
private void updateSubscriptions() {
- mSubInfoList = mSubscriptionManager.getActiveSubscriptionInfoList();
+ mSubInfoList = mSubscriptionManager.getActiveSubscriptionInfoList(true);
for (int i = 0; i < mNumSlots; ++i) {
Preference pref = mSimCards.findPreference("sim" + i);
if (pref instanceof SimPreference) {
diff --git a/src/com/android/settings/slices/SliceBroadcastReceiver.java b/src/com/android/settings/slices/SliceBroadcastReceiver.java
index 28b2f81..061cf18 100644
--- a/src/com/android/settings/slices/SliceBroadcastReceiver.java
+++ b/src/com/android/settings/slices/SliceBroadcastReceiver.java
@@ -40,7 +40,6 @@
import android.text.TextUtils;
import android.util.Log;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.bluetooth.BluetoothSliceBuilder;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.core.SliderPreferenceController;
@@ -208,7 +207,7 @@
private void logSliceValueChange(Context context, String sliceKey, int newValue) {
FeatureFactory.getFactory(context).getMetricsFeatureProvider()
.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsEvent.ACTION_SETTINGS_SLICE_CHANGED,
+ SettingsEnums.ACTION_SETTINGS_SLICE_CHANGED,
SettingsEnums.PAGE_UNKNOWN,
sliceKey, newValue);
}
diff --git a/src/com/android/settings/slices/SliceBuilderUtils.java b/src/com/android/settings/slices/SliceBuilderUtils.java
index 925306e..8b4bb74 100644
--- a/src/com/android/settings/slices/SliceBuilderUtils.java
+++ b/src/com/android/settings/slices/SliceBuilderUtils.java
@@ -42,7 +42,6 @@
import androidx.slice.builders.ListBuilder.RowBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SubSettings;
@@ -80,7 +79,7 @@
final BasePreferenceController controller = getPreferenceController(context, sliceData);
FeatureFactory.getFactory(context).getMetricsFeatureProvider()
.action(SettingsEnums.PAGE_UNKNOWN,
- MetricsEvent.ACTION_SETTINGS_SLICE_REQUESTED,
+ SettingsEnums.ACTION_SETTINGS_SLICE_REQUESTED,
SettingsEnums.PAGE_UNKNOWN,
sliceData.getKey(),
0);
diff --git a/src/com/android/settings/slices/SliceDataConverter.java b/src/com/android/settings/slices/SliceDataConverter.java
index dcc8089..6949273 100644
--- a/src/com/android/settings/slices/SliceDataConverter.java
+++ b/src/com/android/settings/slices/SliceDataConverter.java
@@ -21,9 +21,9 @@
import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_ICON;
import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_KEY;
import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_PLATFORM_SLICE_FLAG;
-import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_UNAVAILABLE_SLICE_SUBTITLE;
import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_SUMMARY;
import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_TITLE;
+import static com.android.settings.core.PreferenceXmlParserUtils.METADATA_UNAVAILABLE_SLICE_SUBTITLE;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.content.ComponentName;
diff --git a/src/com/android/settings/system/ResetDashboardFragment.java b/src/com/android/settings/system/ResetDashboardFragment.java
index 772f18b..5243d6a 100644
--- a/src/com/android/settings/system/ResetDashboardFragment.java
+++ b/src/com/android/settings/system/ResetDashboardFragment.java
@@ -16,10 +16,10 @@
package com.android.settings.system;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.applications.manageapplications.ResetAppPrefPreferenceController;
import com.android.settings.dashboard.DashboardFragment;
@@ -40,7 +40,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.RESET_DASHBOARD;
+ return SettingsEnums.RESET_DASHBOARD;
}
@Override
diff --git a/src/com/android/settings/system/SystemDashboardFragment.java b/src/com/android/settings/system/SystemDashboardFragment.java
index 4f0c738..5c642b2 100644
--- a/src/com/android/settings/system/SystemDashboardFragment.java
+++ b/src/com/android/settings/system/SystemDashboardFragment.java
@@ -15,6 +15,7 @@
*/
package com.android.settings.system;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
@@ -23,7 +24,6 @@
import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -53,7 +53,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_SYSTEM_CATEGORY;
+ return SettingsEnums.SETTINGS_SYSTEM_CATEGORY;
}
@Override
diff --git a/src/com/android/settings/tts/TextToSpeechSettings.java b/src/com/android/settings/tts/TextToSpeechSettings.java
index bd85ef3..d4c7318 100644
--- a/src/com/android/settings/tts/TextToSpeechSettings.java
+++ b/src/com/android/settings/tts/TextToSpeechSettings.java
@@ -20,6 +20,7 @@
import static android.provider.Settings.Secure.TTS_DEFAULT_RATE;
import static android.provider.Settings.Secure.TTS_DEFAULT_SYNTH;
+import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.ContentResolver;
import android.content.Context;
@@ -38,7 +39,6 @@
import androidx.preference.ListPreference;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
@@ -150,7 +150,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TTS_TEXT_TO_SPEECH;
+ return SettingsEnums.TTS_TEXT_TO_SPEECH;
}
@Override
diff --git a/src/com/android/settings/tts/TtsEnginePreferenceFragment.java b/src/com/android/settings/tts/TtsEnginePreferenceFragment.java
index 27c9547..43bb459 100644
--- a/src/com/android/settings/tts/TtsEnginePreferenceFragment.java
+++ b/src/com/android/settings/tts/TtsEnginePreferenceFragment.java
@@ -2,6 +2,7 @@
import static android.provider.Settings.Secure.TTS_DEFAULT_SYNTH;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
import android.provider.SearchIndexableResource;
@@ -13,7 +14,6 @@
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.SettingsPreferenceFragment;
@@ -68,7 +68,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TTS_ENGINE_SETTINGS;
+ return SettingsEnums.TTS_ENGINE_SETTINGS;
}
@Override
diff --git a/src/com/android/settings/users/AppRestrictionsFragment.java b/src/com/android/settings/users/AppRestrictionsFragment.java
index 5f899eb..7b15e8a 100644
--- a/src/com/android/settings/users/AppRestrictionsFragment.java
+++ b/src/com/android/settings/users/AppRestrictionsFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.users;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -53,7 +54,6 @@
import androidx.preference.PreferenceViewHolder;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.Utils;
@@ -244,7 +244,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.USERS_APP_RESTRICTIONS;
+ return SettingsEnums.USERS_APP_RESTRICTIONS;
}
@Override
diff --git a/src/com/android/settings/users/AutoSyncDataPreferenceController.java b/src/com/android/settings/users/AutoSyncDataPreferenceController.java
index 13a2cdf..e7c5cb6 100644
--- a/src/com/android/settings/users/AutoSyncDataPreferenceController.java
+++ b/src/com/android/settings/users/AutoSyncDataPreferenceController.java
@@ -17,6 +17,7 @@
import android.app.ActivityManager;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
@@ -31,7 +32,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -147,7 +147,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_CONFIRM_AUTO_SYNC_CHANGE;
+ return SettingsEnums.DIALOG_CONFIRM_AUTO_SYNC_CHANGE;
}
@Override
diff --git a/src/com/android/settings/users/OwnerInfoSettings.java b/src/com/android/settings/users/OwnerInfoSettings.java
index 8915a27..d06ba64 100644
--- a/src/com/android/settings/users/OwnerInfoSettings.java
+++ b/src/com/android/settings/users/OwnerInfoSettings.java
@@ -17,6 +17,7 @@
package com.android.settings.users;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
@@ -29,7 +30,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -96,6 +96,6 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_OWNER_INFO_SETTINGS;
+ return SettingsEnums.DIALOG_OWNER_INFO_SETTINGS;
}
}
diff --git a/src/com/android/settings/users/RestrictedProfileSettings.java b/src/com/android/settings/users/RestrictedProfileSettings.java
index 99ae26d..b00ee83 100644
--- a/src/com/android/settings/users/RestrictedProfileSettings.java
+++ b/src/com/android/settings/users/RestrictedProfileSettings.java
@@ -17,6 +17,7 @@
package com.android.settings.users;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.UserInfo;
@@ -26,7 +27,6 @@
import android.widget.ImageView;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
@@ -138,9 +138,9 @@
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case DIALOG_ID_EDIT_USER_INFO:
- return MetricsProto.MetricsEvent.DIALOG_USER_EDIT;
+ return SettingsEnums.DIALOG_USER_EDIT;
case DIALOG_CONFIRM_REMOVE:
- return MetricsProto.MetricsEvent.DIALOG_USER_REMOVE;
+ return SettingsEnums.DIALOG_USER_REMOVE;
default:
return 0;
}
diff --git a/src/com/android/settings/users/UserDetailsSettings.java b/src/com/android/settings/users/UserDetailsSettings.java
index 99d3ca4..371c152 100644
--- a/src/com/android/settings/users/UserDetailsSettings.java
+++ b/src/com/android/settings/users/UserDetailsSettings.java
@@ -17,6 +17,7 @@
package com.android.settings.users;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.UserInfo;
@@ -27,8 +28,6 @@
import androidx.preference.Preference;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settingslib.RestrictedLockUtilsInternal;
@@ -70,7 +69,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.USER_DETAILS;
+ return SettingsEnums.USER_DETAILS;
}
@Override
@@ -198,11 +197,11 @@
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case DIALOG_CONFIRM_REMOVE:
- return MetricsProto.MetricsEvent.DIALOG_USER_REMOVE;
+ return SettingsEnums.DIALOG_USER_REMOVE;
case DIALOG_CONFIRM_ENABLE_CALLING:
- return MetricsProto.MetricsEvent.DIALOG_USER_ENABLE_CALLING;
+ return SettingsEnums.DIALOG_USER_ENABLE_CALLING;
case DIALOG_CONFIRM_ENABLE_CALLING_AND_SMS:
- return MetricsProto.MetricsEvent.DIALOG_USER_ENABLE_CALLING_AND_SMS;
+ return SettingsEnums.DIALOG_USER_ENABLE_CALLING_AND_SMS;
default:
return 0;
}
diff --git a/src/com/android/settings/users/UserSettings.java b/src/com/android/settings/users/UserSettings.java
index 5b4055c..21552ce 100644
--- a/src/com/android/settings/users/UserSettings.java
+++ b/src/com/android/settings/users/UserSettings.java
@@ -20,6 +20,7 @@
import android.app.ActivityManager;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
@@ -56,7 +57,6 @@
import androidx.preference.PreferenceGroup;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.util.UserIcons;
import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R;
@@ -205,7 +205,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.USER;
+ return SettingsEnums.USER;
}
@Override
@@ -702,23 +702,23 @@
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case DIALOG_CONFIRM_REMOVE:
- return MetricsEvent.DIALOG_USER_REMOVE;
+ return SettingsEnums.DIALOG_USER_REMOVE;
case DIALOG_USER_CANNOT_MANAGE:
- return MetricsEvent.DIALOG_USER_CANNOT_MANAGE;
+ return SettingsEnums.DIALOG_USER_CANNOT_MANAGE;
case DIALOG_ADD_USER:
- return MetricsEvent.DIALOG_USER_ADD;
+ return SettingsEnums.DIALOG_USER_ADD;
case DIALOG_SETUP_USER:
- return MetricsEvent.DIALOG_USER_SETUP;
+ return SettingsEnums.DIALOG_USER_SETUP;
case DIALOG_SETUP_PROFILE:
- return MetricsEvent.DIALOG_USER_SETUP_PROFILE;
+ return SettingsEnums.DIALOG_USER_SETUP_PROFILE;
case DIALOG_CHOOSE_USER_TYPE:
- return MetricsEvent.DIALOG_USER_CHOOSE_TYPE;
+ return SettingsEnums.DIALOG_USER_CHOOSE_TYPE;
case DIALOG_NEED_LOCKSCREEN:
- return MetricsEvent.DIALOG_USER_NEED_LOCKSCREEN;
+ return SettingsEnums.DIALOG_USER_NEED_LOCKSCREEN;
case DIALOG_CONFIRM_EXIT_GUEST:
- return MetricsEvent.DIALOG_USER_CONFIRM_EXIT_GUEST;
+ return SettingsEnums.DIALOG_USER_CONFIRM_EXIT_GUEST;
case DIALOG_USER_PROFILE_EDITOR:
- return MetricsEvent.DIALOG_USER_EDIT_PROFILE;
+ return SettingsEnums.DIALOG_USER_EDIT_PROFILE;
default:
return 0;
}
diff --git a/src/com/android/settings/utils/ManagedServiceSettings.java b/src/com/android/settings/utils/ManagedServiceSettings.java
index 16f79c2..3ec63c3 100644
--- a/src/com/android/settings/utils/ManagedServiceSettings.java
+++ b/src/com/android/settings/utils/ManagedServiceSettings.java
@@ -20,6 +20,7 @@
import android.app.ActivityManager;
import android.app.Dialog;
import android.app.admin.DevicePolicyManager;
+import android.app.settings.SettingsEnums;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageItemInfo;
@@ -32,7 +33,11 @@
import android.util.Log;
import android.view.View;
-import com.android.internal.logging.nano.MetricsProto;
+import androidx.appcompat.app.AlertDialog;
+import androidx.fragment.app.Fragment;
+import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreference;
+
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -42,11 +47,6 @@
import java.util.List;
-import androidx.appcompat.app.AlertDialog;
-import androidx.fragment.app.Fragment;
-import androidx.preference.PreferenceScreen;
-import androidx.preference.SwitchPreference;
-
public abstract class ManagedServiceSettings extends EmptyTextSettings {
private static final String TAG = "ManagedServiceSettings";
private final Config mConfig;
@@ -193,7 +193,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_SERVICE_ACCESS_WARNING;
+ return SettingsEnums.DIALOG_SERVICE_ACCESS_WARNING;
}
public ScaryWarningDialogFragment setServiceInfo(ComponentName cn, String label,
diff --git a/src/com/android/settings/vpn2/AppDialogFragment.java b/src/com/android/settings/vpn2/AppDialogFragment.java
index 0bf5215..0d0022f 100644
--- a/src/com/android/settings/vpn2/AppDialogFragment.java
+++ b/src/com/android/settings/vpn2/AppDialogFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.vpn2;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageInfo;
@@ -31,7 +32,6 @@
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.net.VpnConfig;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -57,7 +57,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_VPN_APP_CONFIG;
+ return SettingsEnums.DIALOG_VPN_APP_CONFIG;
}
public interface Listener {
diff --git a/src/com/android/settings/vpn2/AppManagementFragment.java b/src/com/android/settings/vpn2/AppManagementFragment.java
index 6a80a54..1571216 100644
--- a/src/com/android/settings/vpn2/AppManagementFragment.java
+++ b/src/com/android/settings/vpn2/AppManagementFragment.java
@@ -20,6 +20,7 @@
import android.annotation.NonNull;
import android.app.AppOpsManager;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
@@ -40,7 +41,6 @@
import androidx.fragment.app.DialogFragment;
import androidx.preference.Preference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.net.VpnConfig;
import com.android.internal.util.ArrayUtils;
import com.android.settings.R;
@@ -173,7 +173,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.VPN;
+ return SettingsEnums.VPN;
}
private boolean onForgetVpnClick() {
@@ -335,7 +335,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_VPN_CANNOT_CONNECT;
+ return SettingsEnums.DIALOG_VPN_CANNOT_CONNECT;
}
public static void show(AppManagementFragment parent, String vpnLabel) {
diff --git a/src/com/android/settings/vpn2/ConfigDialogFragment.java b/src/com/android/settings/vpn2/ConfigDialogFragment.java
index 5714515..ec927ae 100644
--- a/src/com/android/settings/vpn2/ConfigDialogFragment.java
+++ b/src/com/android/settings/vpn2/ConfigDialogFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.vpn2;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.net.ConnectivityManager;
@@ -33,7 +34,6 @@
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.net.LegacyVpnInfo;
import com.android.internal.net.VpnProfile;
import com.android.settings.R;
@@ -61,7 +61,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_LEGACY_VPN_CONFIG;
+ return SettingsEnums.DIALOG_LEGACY_VPN_CONFIG;
}
public static void show(VpnSettings parent, VpnProfile profile, boolean edit, boolean exists) {
diff --git a/src/com/android/settings/vpn2/ConfirmLockdownFragment.java b/src/com/android/settings/vpn2/ConfirmLockdownFragment.java
index 08f3752..1e8074c 100644
--- a/src/com/android/settings/vpn2/ConfirmLockdownFragment.java
+++ b/src/com/android/settings/vpn2/ConfirmLockdownFragment.java
@@ -16,13 +16,13 @@
package com.android.settings.vpn2;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -36,7 +36,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.DIALOG_VPN_REPLACE_EXISTING;
+ return SettingsEnums.DIALOG_VPN_REPLACE_EXISTING;
}
private static final String ARG_REPLACING = "replacing";
diff --git a/src/com/android/settings/vpn2/VpnSettings.java b/src/com/android/settings/vpn2/VpnSettings.java
index ed36da8..874a9b9 100644
--- a/src/com/android/settings/vpn2/VpnSettings.java
+++ b/src/com/android/settings/vpn2/VpnSettings.java
@@ -22,6 +22,7 @@
import android.annotation.WorkerThread;
import android.app.Activity;
import android.app.AppOpsManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
@@ -54,7 +55,6 @@
import androidx.preference.PreferenceGroup;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.net.LegacyVpnInfo;
import com.android.internal.net.VpnConfig;
import com.android.internal.net.VpnProfile;
@@ -114,7 +114,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.VPN;
+ return SettingsEnums.VPN;
}
@Override
diff --git a/src/com/android/settings/wallpaper/WallpaperSuggestionActivity.java b/src/com/android/settings/wallpaper/WallpaperSuggestionActivity.java
index c047357..50819e2 100644
--- a/src/com/android/settings/wallpaper/WallpaperSuggestionActivity.java
+++ b/src/com/android/settings/wallpaper/WallpaperSuggestionActivity.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.WallpaperManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
@@ -25,7 +26,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
@@ -54,7 +54,7 @@
new SubSettingLauncher(this)
.setDestination(WallpaperTypeSettings.class.getName())
.setTitleRes(R.string.wallpaper_suggestion_title)
- .setSourceMetricsCategory(MetricsProto.MetricsEvent.DASHBOARD_SUMMARY)
+ .setSourceMetricsCategory(SettingsEnums.DASHBOARD_SUMMARY)
.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT)
.launch();
}
diff --git a/src/com/android/settings/wallpaper/WallpaperTypeSettings.java b/src/com/android/settings/wallpaper/WallpaperTypeSettings.java
index 1ea0b74..0e0f8df 100644
--- a/src/com/android/settings/wallpaper/WallpaperTypeSettings.java
+++ b/src/com/android/settings/wallpaper/WallpaperTypeSettings.java
@@ -16,12 +16,12 @@
package com.android.settings.wallpaper;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -37,7 +37,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.WALLPAPER_TYPE;
+ return SettingsEnums.WALLPAPER_TYPE;
}
@Override
diff --git a/src/com/android/settings/webview/WebViewAppPicker.java b/src/com/android/settings/webview/WebViewAppPicker.java
index 72d7918..b1dfd14 100644
--- a/src/com/android/settings/webview/WebViewAppPicker.java
+++ b/src/com/android/settings/webview/WebViewAppPicker.java
@@ -19,6 +19,7 @@
import static android.provider.Settings.ACTION_WEBVIEW_SETTINGS;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -30,7 +31,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.defaultapps.DefaultAppPickerFragment;
import com.android.settingslib.applications.DefaultAppInfo;
@@ -114,7 +114,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.WEBVIEW_IMPLEMENTATION;
+ return SettingsEnums.WEBVIEW_IMPLEMENTATION;
}
private static class WebViewAppInfo extends DefaultAppInfo {
diff --git a/src/com/android/settings/wfd/WifiDisplaySettings.java b/src/com/android/settings/wfd/WifiDisplaySettings.java
index 0bd2a1e..2698bf4 100755
--- a/src/com/android/settings/wfd/WifiDisplaySettings.java
+++ b/src/com/android/settings/wfd/WifiDisplaySettings.java
@@ -16,6 +16,7 @@
package com.android.settings.wfd;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
@@ -61,7 +62,6 @@
import androidx.preference.SwitchPreference;
import com.android.internal.app.MediaRouteDialogPresenter;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.dashboard.SummaryLoader;
@@ -127,7 +127,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.WFD_WIFI_DISPLAY;
+ return SettingsEnums.WFD_WIFI_DISPLAY;
}
@Override
diff --git a/src/com/android/settings/widget/EntityHeaderController.java b/src/com/android/settings/widget/EntityHeaderController.java
index 056f6b4..c110107 100644
--- a/src/com/android/settings/widget/EntityHeaderController.java
+++ b/src/com/android/settings/widget/EntityHeaderController.java
@@ -16,8 +16,6 @@
package com.android.settings.widget;
-import static com.android.internal.logging.nano.MetricsProto.MetricsEvent.ACTION_OPEN_APP_NOTIFICATION_SETTING;
-
import android.annotation.IdRes;
import android.annotation.UserIdInt;
import android.app.ActionBar;
@@ -359,7 +357,7 @@
button.setOnClickListener(v -> {
FeatureFactory.getFactory(mAppContext).getMetricsFeatureProvider()
.action(SettingsEnums.PAGE_UNKNOWN,
- ACTION_OPEN_APP_NOTIFICATION_SETTING,
+ SettingsEnums.ACTION_OPEN_APP_NOTIFICATION_SETTING,
mMetricsCategory,
null, 0);
mFragment.startActivity(mAppNotifPrefIntent);
diff --git a/src/com/android/settings/widget/RadioButtonPickerFragment.java b/src/com/android/settings/widget/RadioButtonPickerFragment.java
index 50c1b58..591cd21 100644
--- a/src/com/android/settings/widget/RadioButtonPickerFragment.java
+++ b/src/com/android/settings/widget/RadioButtonPickerFragment.java
@@ -27,7 +27,6 @@
import android.view.View;
import android.view.ViewGroup;
-import android.widget.Toast;
import androidx.annotation.LayoutRes;
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
@@ -40,10 +39,11 @@
import com.android.settings.core.PreferenceXmlParserUtils.MetadataFlag;
import com.android.settingslib.widget.CandidateInfo;
+import org.xmlpull.v1.XmlPullParserException;
+
import java.io.IOException;
import java.util.List;
import java.util.Map;
-import org.xmlpull.v1.XmlPullParserException;
public abstract class RadioButtonPickerFragment extends InstrumentedPreferenceFragment implements
RadioButtonPreference.OnClickListener {
diff --git a/src/com/android/settings/wifi/AddNetworkFragment.java b/src/com/android/settings/wifi/AddNetworkFragment.java
index cd8f76e..e4d0fb1 100644
--- a/src/com/android/settings/wifi/AddNetworkFragment.java
+++ b/src/com/android/settings/wifi/AddNetworkFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.wifi;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
@@ -27,7 +28,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.wifi.dpp.WifiDppUtils;
@@ -52,7 +52,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.SETTINGS_WIFI_ADD_NETWORK;
+ return SettingsEnums.SETTINGS_WIFI_ADD_NETWORK;
}
@Override
diff --git a/src/com/android/settings/wifi/ButtonPreference.java b/src/com/android/settings/wifi/ButtonPreference.java
index 62e8caf..9a0abf6 100644
--- a/src/com/android/settings/wifi/ButtonPreference.java
+++ b/src/com/android/settings/wifi/ButtonPreference.java
@@ -24,13 +24,13 @@
import android.view.View;
import android.widget.ImageButton;
-import com.android.settings.R;
-
-import androidx.annotation.VisibleForTesting;
import androidx.annotation.DrawableRes;
+import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import androidx.preference.PreferenceViewHolder;
+import com.android.settings.R;
+
/**
* This preference provides one button layout with Settings style.
* It looks like below
diff --git a/src/com/android/settings/wifi/ChangeWifiStateDetails.java b/src/com/android/settings/wifi/ChangeWifiStateDetails.java
index 63d1745..9841615 100644
--- a/src/com/android/settings/wifi/ChangeWifiStateDetails.java
+++ b/src/com/android/settings/wifi/ChangeWifiStateDetails.java
@@ -17,6 +17,7 @@
package com.android.settings.wifi;
import android.app.AppOpsManager;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.os.Bundle;
@@ -25,7 +26,6 @@
import androidx.preference.Preference.OnPreferenceChangeListener;
import androidx.preference.SwitchPreference;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.applications.AppInfoWithHeader;
import com.android.settings.applications.AppStateAppOpsBridge.PermissionState;
@@ -69,7 +69,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CONFIGURE_WIFI;
+ return SettingsEnums.CONFIGURE_WIFI;
}
@Override
@@ -93,8 +93,8 @@
}
protected void logSpecialPermissionChange(boolean newState, String packageName) {
- int logCategory = newState ? MetricsEvent.APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_ALLOW
- : MetricsEvent.APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_DENY;
+ int logCategory = newState ? SettingsEnums.APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_ALLOW
+ : SettingsEnums.APP_SPECIAL_PERMISSION_SETTINGS_CHANGE_DENY;
FeatureFactory.getFactory(getContext()).getMetricsFeatureProvider().action(getContext(),
logCategory, packageName);
}
diff --git a/src/com/android/settings/wifi/ConfigureWifiSettings.java b/src/com/android/settings/wifi/ConfigureWifiSettings.java
index 8df4a41..89c1575 100644
--- a/src/com/android/settings/wifi/ConfigureWifiSettings.java
+++ b/src/com/android/settings/wifi/ConfigureWifiSettings.java
@@ -17,6 +17,7 @@
import static android.content.Context.WIFI_SERVICE;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
@@ -24,7 +25,6 @@
import android.net.wifi.WifiManager;
import android.provider.SearchIndexableResource;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -50,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.CONFIGURE_WIFI;
+ return SettingsEnums.CONFIGURE_WIFI;
}
@Override
diff --git a/src/com/android/settings/wifi/NetworkRequestDialogFragment.java b/src/com/android/settings/wifi/NetworkRequestDialogFragment.java
index 06e36e5..0ed8544 100644
--- a/src/com/android/settings/wifi/NetworkRequestDialogFragment.java
+++ b/src/com/android/settings/wifi/NetworkRequestDialogFragment.java
@@ -17,32 +17,31 @@
package com.android.settings.wifi;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
-import android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback;
import android.net.wifi.WifiManager.NetworkRequestMatchCallback;
+import android.net.wifi.WifiManager.NetworkRequestUserSelectionCallback;
+import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
import android.widget.BaseAdapter;
+import android.widget.ProgressBar;
+import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
import androidx.preference.internal.PreferenceImageView;
-import android.os.Bundle;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ArrayAdapter;
-import android.widget.ProgressBar;
-import android.widget.TextView;
-
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settings.wifi.NetworkRequestErrorDialogFragment.ERROR_DIALOG_TYPE;
@@ -255,7 +254,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.WIFI_SCANNING_NEEDED_DIALOG;
+ return SettingsEnums.WIFI_SCANNING_NEEDED_DIALOG;
}
private class AccessPointAdapter extends ArrayAdapter<AccessPoint> {
diff --git a/src/com/android/settings/wifi/NetworkRequestErrorDialogFragment.java b/src/com/android/settings/wifi/NetworkRequestErrorDialogFragment.java
index 762b467..261d313 100644
--- a/src/com/android/settings/wifi/NetworkRequestErrorDialogFragment.java
+++ b/src/com/android/settings/wifi/NetworkRequestErrorDialogFragment.java
@@ -17,13 +17,13 @@
package com.android.settings.wifi;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -75,7 +75,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.WIFI_SCANNING_NEEDED_DIALOG;
+ return SettingsEnums.WIFI_SCANNING_NEEDED_DIALOG;
}
protected void startScanningDialog() {
diff --git a/src/com/android/settings/wifi/WifiAPITest.java b/src/com/android/settings/wifi/WifiAPITest.java
index c0b90f9..87499f5 100644
--- a/src/com/android/settings/wifi/WifiAPITest.java
+++ b/src/com/android/settings/wifi/WifiAPITest.java
@@ -18,6 +18,7 @@
import static android.content.Context.WIFI_SERVICE;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.net.wifi.WifiManager;
import android.os.Bundle;
@@ -28,7 +29,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -87,7 +87,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TESTING;
+ return SettingsEnums.TESTING;
}
//============================
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
index ad483b5..b0d09e4 100644
--- a/src/com/android/settings/wifi/WifiConfigController.java
+++ b/src/com/android/settings/wifi/WifiConfigController.java
@@ -251,6 +251,8 @@
com.android.settings.core.FeatureFlags.WIFI_MAC_RANDOMIZATION)) {
View privacySettingsLayout = mView.findViewById(R.id.privacy_settings_fields);
privacySettingsLayout.setVisibility(View.VISIBLE);
+ // Set default value
+ mPrivacySettingsSpinner.setSelection(WifiConfiguration.RANDOMIZATION_PERSISTENT);
}
mHiddenSettingsSpinner.setOnItemSelectedListener(this);
mHiddenWarningView = mView.findViewById(R.id.hidden_settings_warning);
diff --git a/src/com/android/settings/wifi/WifiConnectionPreferenceController.java b/src/com/android/settings/wifi/WifiConnectionPreferenceController.java
index b73bce9..33eaceb 100644
--- a/src/com/android/settings/wifi/WifiConnectionPreferenceController.java
+++ b/src/com/android/settings/wifi/WifiConnectionPreferenceController.java
@@ -19,6 +19,9 @@
import android.content.Context;
import android.os.Bundle;
+import androidx.preference.PreferenceGroup;
+import androidx.preference.PreferenceScreen;
+
import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.wifi.details.WifiNetworkDetailsFragment;
@@ -29,9 +32,6 @@
import com.android.settingslib.wifi.WifiTracker;
import com.android.settingslib.wifi.WifiTrackerFactory;
-import androidx.preference.PreferenceGroup;
-import androidx.preference.PreferenceScreen;
-
/**
* This places a preference into a PreferenceGroup owned by some parent
* controller class when there is a wifi connection present.
diff --git a/src/com/android/settings/wifi/WifiDialog.java b/src/com/android/settings/wifi/WifiDialog.java
index 0bee671..9420c4c 100644
--- a/src/com/android/settings/wifi/WifiDialog.java
+++ b/src/com/android/settings/wifi/WifiDialog.java
@@ -27,7 +27,6 @@
import com.android.settings.R;
import com.android.settings.wifi.dpp.WifiDppUtils;
-
import com.android.settingslib.RestrictedLockUtils;
import com.android.settingslib.RestrictedLockUtilsInternal;
import com.android.settingslib.wifi.AccessPoint;
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index 60480c2..536ea61 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -16,6 +16,7 @@
package com.android.settings.wifi;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -32,7 +33,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.widget.SwitchWidgetController;
import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
@@ -209,10 +209,10 @@
}
if (isChecked) {
- mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_WIFI_ON);
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_WIFI_ON);
} else {
// Log if user was connected at the time of switching off.
- mMetricsFeatureProvider.action(mContext, MetricsEvent.ACTION_WIFI_OFF,
+ mMetricsFeatureProvider.action(mContext, SettingsEnums.ACTION_WIFI_OFF,
mConnected.get());
}
if (!mWifiManager.setWifiEnabled(isChecked)) {
diff --git a/src/com/android/settings/wifi/WifiInfo.java b/src/com/android/settings/wifi/WifiInfo.java
index 3f57376..a131f18 100644
--- a/src/com/android/settings/wifi/WifiInfo.java
+++ b/src/com/android/settings/wifi/WifiInfo.java
@@ -16,9 +16,9 @@
package com.android.settings.wifi;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
@@ -36,6 +36,6 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.TESTING;
+ return SettingsEnums.TESTING;
}
}
diff --git a/src/com/android/settings/wifi/WifiScanModeActivity.java b/src/com/android/settings/wifi/WifiScanModeActivity.java
index a9be6a3..934e972 100644
--- a/src/com/android/settings/wifi/WifiScanModeActivity.java
+++ b/src/com/android/settings/wifi/WifiScanModeActivity.java
@@ -17,6 +17,7 @@
package com.android.settings.wifi;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -29,7 +30,6 @@
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.FragmentActivity;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
@@ -126,7 +126,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.DIALOG_WIFI_SCAN_MODE;
+ return SettingsEnums.DIALOG_WIFI_SCAN_MODE;
}
@Override
diff --git a/src/com/android/settings/wifi/WifiScanningRequiredFragment.java b/src/com/android/settings/wifi/WifiScanningRequiredFragment.java
index fd279cc..fa9b21a 100644
--- a/src/com/android/settings/wifi/WifiScanningRequiredFragment.java
+++ b/src/com/android/settings/wifi/WifiScanningRequiredFragment.java
@@ -17,6 +17,7 @@
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.ActivityNotFoundException;
import android.content.ContentResolver;
import android.content.Context;
@@ -31,7 +32,6 @@
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.core.instrumentation.InstrumentedDialogFragment;
import com.android.settingslib.HelpUtils;
@@ -60,7 +60,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.WIFI_SCANNING_NEEDED_DIALOG;
+ return SettingsEnums.WIFI_SCANNING_NEEDED_DIALOG;
}
@Override
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index eddae06..3a0040c 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -22,6 +22,7 @@
import android.annotation.NonNull;
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
@@ -52,7 +53,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.LinkifyUtils;
import com.android.settings.R;
import com.android.settings.RestrictedSettingsFragment;
@@ -446,7 +446,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.WIFI;
+ return SettingsEnums.WIFI;
}
@Override
@@ -563,7 +563,10 @@
* networks, or Passpoint provided networks.
*/
WifiConfiguration config = mSelectedAccessPoint.getConfig();
- if ((mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
+ if (mSelectedAccessPoint.isOsuProvider()) {
+ mSelectedAccessPoint.startOsuProvisioning();
+ mClickedConnect = true;
+ } else if ((mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE) ||
(mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_OWE)) {
mSelectedAccessPoint.generateOpenNetworkConfig();
connect(mSelectedAccessPoint.getConfig(), mSelectedAccessPoint.isSaved());
@@ -654,9 +657,9 @@
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case WIFI_DIALOG_ID:
- return MetricsEvent.DIALOG_WIFI_AP_EDIT;
+ return SettingsEnums.DIALOG_WIFI_AP_EDIT;
case WRITE_NFC_DIALOG_ID:
- return MetricsEvent.DIALOG_WIFI_WRITE_NFC;
+ return SettingsEnums.DIALOG_WIFI_WRITE_NFC;
default:
return 0;
}
@@ -1086,7 +1089,7 @@
}
/* package */ void forget() {
- mMetricsFeatureProvider.action(getActivity(), MetricsEvent.ACTION_WIFI_FORGET);
+ mMetricsFeatureProvider.action(getActivity(), SettingsEnums.ACTION_WIFI_FORGET);
if (!mSelectedAccessPoint.isSaved()) {
if (mSelectedAccessPoint.getNetworkInfo() != null &&
mSelectedAccessPoint.getNetworkInfo().getState() != State.DISCONNECTED) {
@@ -1112,7 +1115,7 @@
protected void connect(final WifiConfiguration config, boolean isSavedNetwork) {
// Log subtype if configuration is a saved network.
- mMetricsFeatureProvider.action(getContext(), MetricsEvent.ACTION_WIFI_CONNECT,
+ mMetricsFeatureProvider.action(getContext(), SettingsEnums.ACTION_WIFI_CONNECT,
isSavedNetwork);
mWifiManager.connect(config, mConnectListener);
mClickedConnect = true;
@@ -1120,7 +1123,7 @@
protected void connect(final int networkId, boolean isSavedNetwork) {
// Log subtype if configuration is a saved network.
- mMetricsFeatureProvider.action(getActivity(), MetricsEvent.ACTION_WIFI_CONNECT,
+ mMetricsFeatureProvider.action(getActivity(), SettingsEnums.ACTION_WIFI_CONNECT,
isSavedNetwork);
mWifiManager.connect(networkId, mConnectListener);
}
diff --git a/src/com/android/settings/wifi/calling/WifiCallingSettings.java b/src/com/android/settings/wifi/calling/WifiCallingSettings.java
index ac84783..b02d6c6 100644
--- a/src/com/android/settings/wifi/calling/WifiCallingSettings.java
+++ b/src/com/android/settings/wifi/calling/WifiCallingSettings.java
@@ -16,6 +16,7 @@
package com.android.settings.wifi.calling;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
@@ -29,7 +30,6 @@
import androidx.fragment.app.FragmentPagerAdapter;
import com.android.ims.ImsManager;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.core.InstrumentedFragment;
import com.android.settings.search.actionbar.SearchMenuController;
@@ -55,7 +55,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.WIFI_CALLING;
+ return SettingsEnums.WIFI_CALLING;
}
@Override
@@ -147,7 +147,7 @@
}
private void updateSubList() {
- mSil = SubscriptionManager.from(getActivity()).getActiveSubscriptionInfoList();
+ mSil = SubscriptionManager.from(getActivity()).getActiveSubscriptionInfoList(true);
// Only config Wfc if it's enabled by platform.
if (mSil == null) {
diff --git a/src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java b/src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java
index 0de5c77..40cc0dc 100644
--- a/src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java
+++ b/src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java
@@ -17,6 +17,7 @@
package com.android.settings.wifi.calling;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@@ -44,7 +45,6 @@
import com.android.ims.ImsConfig;
import com.android.ims.ImsManager;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.telephony.Phone;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
@@ -212,7 +212,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.WIFI_CALLING_FOR_SUB;
+ return SettingsEnums.WIFI_CALLING_FOR_SUB;
}
@Override
diff --git a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
index 4387459..a49ce40 100644
--- a/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
+++ b/src/com/android/settings/wifi/details/WifiDetailPreferenceController.java
@@ -21,6 +21,7 @@
import android.app.Activity;
import android.app.KeyguardManager;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -53,17 +54,15 @@
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.Utils;
import com.android.settings.core.FeatureFlags;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.widget.EntityHeaderController;
-import com.android.settings.wifi.dpp.WifiDppConfiguratorActivity;
-import com.android.settings.wifi.dpp.WifiDppUtils;
import com.android.settings.wifi.WifiDialog;
import com.android.settings.wifi.WifiDialog.WifiDialogListener;
import com.android.settings.wifi.WifiUtils;
+import com.android.settings.wifi.dpp.WifiDppUtils;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.core.lifecycle.Lifecycle;
@@ -551,7 +550,7 @@
}
}
mMetricsFeatureProvider.action(
- mFragment.getActivity(), MetricsProto.MetricsEvent.ACTION_WIFI_FORGET);
+ mFragment.getActivity(), SettingsEnums.ACTION_WIFI_FORGET);
mFragment.getActivity().finish();
}
@@ -593,7 +592,7 @@
*/
private void signIntoNetwork() {
mMetricsFeatureProvider.action(
- mFragment.getActivity(), MetricsProto.MetricsEvent.ACTION_WIFI_SIGNIN);
+ mFragment.getActivity(), SettingsEnums.ACTION_WIFI_SIGNIN);
mConnectivityManager.startCaptivePortalApp(mNetwork);
}
diff --git a/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java b/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
index 9814486..2f45526 100644
--- a/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
+++ b/src/com/android/settings/wifi/details/WifiNetworkDetailsFragment.java
@@ -19,6 +19,7 @@
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
@@ -30,8 +31,6 @@
import android.view.MenuInflater;
import android.view.MenuItem;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.wifi.WifiConfigUiBase;
@@ -67,7 +66,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.WIFI_NETWORK_DETAILS;
+ return SettingsEnums.WIFI_NETWORK_DETAILS;
}
@Override
@@ -83,7 +82,7 @@
@Override
public int getDialogMetricsCategory(int dialogId) {
if (dialogId == WIFI_DIALOG_ID) {
- return MetricsEvent.DIALOG_WIFI_AP_EDIT;
+ return SettingsEnums.DIALOG_WIFI_AP_EDIT;
}
return 0;
}
diff --git a/src/com/android/settings/wifi/details/WifiPrivacyPreferenceController.java b/src/com/android/settings/wifi/details/WifiPrivacyPreferenceController.java
index 9f81431..18be542 100644
--- a/src/com/android/settings/wifi/details/WifiPrivacyPreferenceController.java
+++ b/src/com/android/settings/wifi/details/WifiPrivacyPreferenceController.java
@@ -69,6 +69,9 @@
if (mWifiConfiguration != null) {
mWifiConfiguration.macRandomizationSetting = Integer.parseInt((String) newValue);
mWifiManager.updateNetwork(mWifiConfiguration);
+ // To activate changing, we need reconnect network. WiFi will auto connect to current
+ // network after disconnect().
+ mWifiManager.disconnect();
}
updateSummary((DropDownPreference) preference, Integer.parseInt((String) newValue));
return true;
diff --git a/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java b/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
index df20caa..7e6e806 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppAddDeviceFragment.java
@@ -18,6 +18,7 @@
import android.app.ActionBar;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.net.wifi.WifiManager;
import android.os.Bundle;
@@ -28,11 +29,11 @@
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
-import android.widget.ProgressBar;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
+import java.util.concurrent.Executor;
+
/**
* After getting Wi-Fi network information and(or) QR code, this fragment config a device to connect
* to the Wi-Fi network.
@@ -82,7 +83,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_CONFIGURATOR;
+ return SettingsEnums.SETTINGS_WIFI_DPP_CONFIGURATOR;
}
@Override
@@ -148,9 +149,8 @@
final int networkId =
((WifiDppConfiguratorActivity) getActivity()).getWifiNetworkConfig().getNetworkId();
final WifiManager wifiManager = getContext().getSystemService(WifiManager.class);
-
wifiManager.startEasyConnectAsConfiguratorInitiator(qrCode, networkId,
- WifiManager.EASY_CONNECT_NETWORK_ROLE_STA, /* handler */ null,
+ WifiManager.EASY_CONNECT_NETWORK_ROLE_STA, getContext().getMainExecutor(),
new EasyConnectStatusCallback());
}
diff --git a/src/com/android/settings/wifi/dpp/WifiDppChooseSavedWifiNetworkFragment.java b/src/com/android/settings/wifi/dpp/WifiDppChooseSavedWifiNetworkFragment.java
index 5694ad6..b396512 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppChooseSavedWifiNetworkFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppChooseSavedWifiNetworkFragment.java
@@ -18,6 +18,7 @@
import android.app.ActionBar;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
@@ -28,7 +29,6 @@
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
/**
@@ -44,7 +44,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_CONFIGURATOR;
+ return SettingsEnums.SETTINGS_WIFI_DPP_CONFIGURATOR;
}
@Override
diff --git a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
index 51777c5..d9daf5d 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppConfiguratorActivity.java
@@ -18,6 +18,7 @@
import android.app.ActionBar;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
@@ -27,9 +28,8 @@
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.settings.core.InstrumentedActivity;
import com.android.settings.R;
+import com.android.settings.core.InstrumentedActivity;
/**
* To provision "other" device with specified Wi-Fi network.
@@ -83,7 +83,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_CONFIGURATOR;
+ return SettingsEnums.SETTINGS_WIFI_DPP_CONFIGURATOR;
}
@Override
diff --git a/src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java b/src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java
index 66f75fa..3dea7a0 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppEnrolleeActivity.java
@@ -16,25 +16,26 @@
package com.android.settings.wifi.dpp;
-import android.content.Context;
-import android.net.wifi.WifiConfiguration;
-import android.provider.Settings;
import android.app.ActionBar;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
+import android.content.Context;
import android.content.Intent;
+import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Bundle;
+import android.provider.Settings;
import android.util.Log;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.settings.core.InstrumentedActivity;
import com.android.settings.R;
+import com.android.settings.core.InstrumentedActivity;
import java.util.List;
+import java.util.concurrent.Executor;
/**
* To provision "this" device with specified Wi-Fi network.
@@ -89,7 +90,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_ENROLLEE;
+ return SettingsEnums.SETTINGS_WIFI_DPP_ENROLLEE;
}
@Override
@@ -148,7 +149,7 @@
@Override
public void onScanWifiDppSuccess(WifiQrCode wifiQrCode) {
final WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
- wifiManager.startEasyConnectAsEnrolleeInitiator(wifiQrCode.getQrCode(), /* handler */ null,
+ wifiManager.startEasyConnectAsEnrolleeInitiator(wifiQrCode.getQrCode(), getMainExecutor(),
new EasyConnectStatusCallback());
}
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeBaseFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeBaseFragment.java
index 4ac5850..cd0db62 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeBaseFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeBaseFragment.java
@@ -22,7 +22,6 @@
import android.widget.TextView;
import com.android.settings.core.InstrumentedFragment;
-import com.android.settings.R;
/**
* There are below 4 fragments for Wi-Fi DPP UI flow, to reduce redundant code of UI components,
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeGeneratorFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeGeneratorFragment.java
index f4bbcc1..f2ca24e 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeGeneratorFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeGeneratorFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.wifi.dpp;
import android.app.ActionBar;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Bundle;
@@ -29,7 +30,6 @@
import android.view.ViewGroup;
import android.widget.ImageView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.wifi.qrcode.QrCodeGenerator;
@@ -47,7 +47,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_CONFIGURATOR;
+ return SettingsEnums.SETTINGS_WIFI_DPP_CONFIGURATOR;
}
// Container Activity must implement this interface
diff --git a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
index 21534dc..7beeeb2 100644
--- a/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiDppQrCodeScannerFragment.java
@@ -17,9 +17,8 @@
package com.android.settings.wifi.dpp;
import android.app.ActionBar;
-import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
-import android.content.Intent;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.SurfaceTexture;
@@ -37,7 +36,6 @@
import android.view.ViewGroup;
import android.widget.TextView;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.wifi.qrcode.QrCamera;
import com.android.settings.wifi.qrcode.QrDecorateView;
@@ -92,9 +90,9 @@
@Override
public int getMetricsCategory() {
if (mIsConfiguratorMode) {
- return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_CONFIGURATOR;
+ return SettingsEnums.SETTINGS_WIFI_DPP_CONFIGURATOR;
} else {
- return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_ENROLLEE;
+ return SettingsEnums.SETTINGS_WIFI_DPP_ENROLLEE;
}
}
diff --git a/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java b/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
index 3117a10..7ea4906 100644
--- a/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
+++ b/src/com/android/settings/wifi/dpp/WifiNetworkListFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.wifi.dpp;
import android.app.Activity;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.NetworkInfo.DetailedState;
@@ -27,10 +28,13 @@
import android.view.View;
import android.widget.Toast;
-import com.android.internal.logging.nano.MetricsProto;
+import androidx.annotation.VisibleForTesting;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+
import com.android.settings.R;
-import com.android.settings.core.SubSettingLauncher;
import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.core.SubSettingLauncher;
import com.android.settings.wifi.AddNetworkFragment;
import com.android.settingslib.wifi.AccessPoint;
import com.android.settingslib.wifi.AccessPointPreference;
@@ -39,10 +43,6 @@
import java.util.List;
-import androidx.annotation.VisibleForTesting;
-import androidx.preference.Preference;
-import androidx.preference.PreferenceCategory;
-
public class WifiNetworkListFragment extends SettingsPreferenceFragment implements
WifiTracker.WifiListener, AccessPoint.AccessPointListener {
private static final String TAG = "WifiNetworkListFragment";
@@ -74,7 +74,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.SETTINGS_WIFI_DPP_CONFIGURATOR;
+ return SettingsEnums.SETTINGS_WIFI_DPP_CONFIGURATOR;
}
@Override
diff --git a/src/com/android/settings/wifi/dpp/WifiQrCode.java b/src/com/android/settings/wifi/dpp/WifiQrCode.java
index b60289f..5ccb81e 100644
--- a/src/com/android/settings/wifi/dpp/WifiQrCode.java
+++ b/src/com/android/settings/wifi/dpp/WifiQrCode.java
@@ -16,7 +16,6 @@
package com.android.settings.wifi.dpp;
-import android.content.Intent;
import android.net.wifi.WifiConfiguration;
import android.text.TextUtils;
diff --git a/src/com/android/settings/wifi/p2p/WifiP2pSettings.java b/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
index bfdcb21..d1500e7 100644
--- a/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
+++ b/src/com/android/settings/wifi/p2p/WifiP2pSettings.java
@@ -18,6 +18,7 @@
import android.app.Activity;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
@@ -50,7 +51,6 @@
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -165,7 +165,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.WIFI_P2P;
+ return SettingsEnums.WIFI_P2P;
}
@Override
@@ -507,13 +507,13 @@
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case DIALOG_DISCONNECT:
- return MetricsEvent.DIALOG_WIFI_P2P_DISCONNECT;
+ return SettingsEnums.DIALOG_WIFI_P2P_DISCONNECT;
case DIALOG_CANCEL_CONNECT:
- return MetricsEvent.DIALOG_WIFI_P2P_CANCEL_CONNECT;
+ return SettingsEnums.DIALOG_WIFI_P2P_CANCEL_CONNECT;
case DIALOG_RENAME:
- return MetricsEvent.DIALOG_WIFI_P2P_RENAME;
+ return SettingsEnums.DIALOG_WIFI_P2P_RENAME;
case DIALOG_DELETE_GROUP:
- return MetricsEvent.DIALOG_WIFI_P2P_DELETE_GROUP;
+ return SettingsEnums.DIALOG_WIFI_P2P_DELETE_GROUP;
}
return 0;
}
diff --git a/src/com/android/settings/wifi/qrcode/QrCamera.java b/src/com/android/settings/wifi/qrcode/QrCamera.java
index af366bc..45de6b5 100644
--- a/src/com/android/settings/wifi/qrcode/QrCamera.java
+++ b/src/com/android/settings/wifi/qrcode/QrCamera.java
@@ -24,7 +24,6 @@
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Parameters;
-import android.hardware.Camera.PreviewCallback;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Message;
@@ -33,6 +32,9 @@
import android.util.Size;
import android.view.Surface;
import android.view.WindowManager;
+
+import androidx.annotation.VisibleForTesting;
+
import com.google.zxing.BarcodeFormat;
import com.google.zxing.BinaryBitmap;
import com.google.zxing.DecodeHintType;
@@ -40,6 +42,7 @@
import com.google.zxing.ReaderException;
import com.google.zxing.Result;
import com.google.zxing.common.HybridBinarizer;
+
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
@@ -48,8 +51,6 @@
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
-import androidx.annotation.VisibleForTesting;
-
/**
* Manage the camera for the QR scanner and help the decoder to get the image inside the scanning
* frame. Caller prepares a {@link SurfaceTexture} then call {@link #start(SurfaceTexture)} to
diff --git a/src/com/android/settings/wifi/qrcode/QrDecorateView.java b/src/com/android/settings/wifi/qrcode/QrDecorateView.java
index 6952a63..2be1eab 100644
--- a/src/com/android/settings/wifi/qrcode/QrDecorateView.java
+++ b/src/com/android/settings/wifi/qrcode/QrDecorateView.java
@@ -19,12 +19,9 @@
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.graphics.Color;
import android.graphics.Paint;
-import android.graphics.Point;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
-import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.TypedValue;
diff --git a/src/com/android/settings/wifi/qrcode/QrPreviewLayout.java b/src/com/android/settings/wifi/qrcode/QrPreviewLayout.java
index 56566ae..ad17146 100644
--- a/src/com/android/settings/wifi/qrcode/QrPreviewLayout.java
+++ b/src/com/android/settings/wifi/qrcode/QrPreviewLayout.java
@@ -18,7 +18,6 @@
import android.content.Context;
import android.util.AttributeSet;
-import android.util.Log;
import android.widget.FrameLayout;
/**
diff --git a/src/com/android/settings/wifi/savedaccesspoints/SavedAccessPointsWifiSettings.java b/src/com/android/settings/wifi/savedaccesspoints/SavedAccessPointsWifiSettings.java
index 8f14ec2..7b2574f 100644
--- a/src/com/android/settings/wifi/savedaccesspoints/SavedAccessPointsWifiSettings.java
+++ b/src/com/android/settings/wifi/savedaccesspoints/SavedAccessPointsWifiSettings.java
@@ -18,14 +18,13 @@
import android.annotation.Nullable;
import android.app.Dialog;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.util.Log;
-import com.android.internal.logging.nano.MetricsProto;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.wifi.WifiConfigUiBase;
@@ -51,7 +50,7 @@
@Override
public int getMetricsCategory() {
- return MetricsEvent.WIFI_SAVED_ACCESS_POINTS;
+ return SettingsEnums.WIFI_SAVED_ACCESS_POINTS;
}
@Override
@@ -123,7 +122,7 @@
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
case WifiSettings.WIFI_DIALOG_ID:
- return MetricsProto.MetricsEvent.DIALOG_WIFI_SAVED_AP_EDIT;
+ return SettingsEnums.DIALOG_WIFI_SAVED_AP_EDIT;
default:
return 0;
}
diff --git a/src/com/android/settings/wifi/slice/WifiSlice.java b/src/com/android/settings/wifi/slice/WifiSlice.java
index 35bb89f..1c79c1d 100644
--- a/src/com/android/settings/wifi/slice/WifiSlice.java
+++ b/src/com/android/settings/wifi/slice/WifiSlice.java
@@ -23,6 +23,7 @@
import android.annotation.ColorInt;
import android.app.PendingIntent;
+import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -38,7 +39,6 @@
import androidx.slice.builders.ListBuilder;
import androidx.slice.builders.SliceAction;
-import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.settings.R;
import com.android.settings.SubSettings;
import com.android.settings.Utils;
@@ -174,7 +174,7 @@
.setTitleRes(R.string.pref_title_network_details)
.setDestination(WifiNetworkDetailsFragment.class.getName())
.setArguments(extras)
- .setSourceMetricsCategory(MetricsEvent.WIFI)
+ .setSourceMetricsCategory(SettingsEnums.WIFI)
.toIntent();
} else {
intent = new Intent(mContext, WifiDialogActivity.class);
@@ -204,7 +204,7 @@
final Uri contentUri = new Uri.Builder().appendPath(KEY_WIFI).build();
final Intent intent = SliceBuilderUtils.buildSearchResultPageIntent(mContext,
WifiSettings.class.getName(), KEY_WIFI, screenTitle,
- MetricsEvent.DIALOG_WIFI_AP_EDIT)
+ SettingsEnums.DIALOG_WIFI_AP_EDIT)
.setClassName(mContext.getPackageName(), SubSettings.class.getName())
.setData(contentUri);
diff --git a/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceController.java b/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceController.java
index c0a3fa7..eb6a123 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceController.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherSSIDPreferenceController.java
@@ -18,7 +18,6 @@
import android.content.Context;
import android.net.wifi.WifiConfiguration;
-import android.util.Log;
import androidx.annotation.VisibleForTesting;
import androidx.preference.EditTextPreference;
diff --git a/src/com/android/settings/wifi/tether/WifiTetherSettings.java b/src/com/android/settings/wifi/tether/WifiTetherSettings.java
index 5f23f0c..aecc053 100644
--- a/src/com/android/settings/wifi/tether/WifiTetherSettings.java
+++ b/src/com/android/settings/wifi/tether/WifiTetherSettings.java
@@ -19,6 +19,7 @@
import static android.net.ConnectivityManager.ACTION_TETHER_STATE_CHANGED;
import static android.net.wifi.WifiManager.WIFI_AP_STATE_CHANGED_ACTION;
+import android.app.settings.SettingsEnums;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -32,7 +33,6 @@
import androidx.annotation.VisibleForTesting;
-import com.android.internal.logging.nano.MetricsProto;
import com.android.settings.R;
import com.android.settings.SettingsActivity;
import com.android.settings.dashboard.RestrictedDashboardFragment;
@@ -87,7 +87,7 @@
@Override
public int getMetricsCategory() {
- return MetricsProto.MetricsEvent.WIFI_TETHER_SETTINGS;
+ return SettingsEnums.WIFI_TETHER_SETTINGS;
}
@Override
diff --git a/tests/robotests/res/values-mcc999/config.xml b/tests/robotests/res/values-mcc999/config.xml
index 59028d3..101a6b8 100644
--- a/tests/robotests/res/values-mcc999/config.xml
+++ b/tests/robotests/res/values-mcc999/config.xml
@@ -88,7 +88,4 @@
<!-- Email address for the homepage contextual cards feedback -->
<string name="config_contextual_card_feedback_email" translatable="false">test@test.test</string>
-
- <!-- Max allowed value for screen timeout, in milliseconds -->
- <integer name="max_lock_after_timeout_ms">1700000</integer>
</resources>
diff --git a/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceControllerTest.java
index d1cb63e..4347637 100644
--- a/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/datausage/DataUsageSummaryPreferenceControllerTest.java
@@ -34,11 +34,11 @@
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkTemplate;
-import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import androidx.fragment.app.FragmentActivity;
+import androidx.preference.PreferenceFragmentCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.android.internal.logging.nano.MetricsProto;
@@ -92,7 +92,7 @@
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
private EntityHeaderController mHeaderController;
@Mock
- private DataUsageSummary mDataUsageSummary;
+ private PreferenceFragmentCompat mPreferenceFragment;
@Mock
private TelephonyManager mTelephonyManager;
@Mock
@@ -104,6 +104,7 @@
private FragmentActivity mActivity;
private Context mContext;
private DataUsageSummaryPreferenceController mController;
+ private int mDefaultSubscriptionId;
@Before
public void setUp() {
@@ -125,6 +126,7 @@
.thenReturn(mConnectivityManager);
when(mTelephonyManager.getSimState()).thenReturn(TelephonyManager.SIM_STATE_READY);
when(mConnectivityManager.isNetworkSupported(TYPE_WIFI)).thenReturn(false);
+ mDefaultSubscriptionId = 1234;
mController = new DataUsageSummaryPreferenceController(
mDataUsageController,
mDataInfoController,
@@ -133,7 +135,7 @@
R.string.cell_data_template,
true,
null,
- mActivity, null, null, null);
+ mActivity, null, null, null, mDefaultSubscriptionId);
}
@After
@@ -355,11 +357,7 @@
R.string.cell_data_template,
true,
mSubscriptionManager,
- mActivity, null, null, null);
-
- final SubscriptionInfo subInfo = new SubscriptionInfo(0, "123456", 0, "name", "carrier",
- 0, 0, "number", 0, null, "123", "456", "ZX", false, null, null);
- when(mSubscriptionManager.getDefaultDataSubscriptionInfo()).thenReturn(subInfo);
+ mActivity, null, null, null, mDefaultSubscriptionId);
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
}
@@ -373,7 +371,7 @@
R.string.cell_data_template,
true,
mSubscriptionManager,
- mActivity, null, null, null);
+ mActivity, null, null, null, mDefaultSubscriptionId);
when(mTelephonyManager.getSimState()).thenReturn(TelephonyManager.SIM_STATE_ABSENT);
when(mConnectivityManager.isNetworkSupported(TYPE_WIFI)).thenReturn(false);
@@ -390,7 +388,7 @@
R.string.cell_data_template,
true,
mSubscriptionManager,
- mActivity, null, null, null);
+ mActivity, null, null, null, mDefaultSubscriptionId);
when(mTelephonyManager.getSimState()).thenReturn(TelephonyManager.SIM_STATE_ABSENT);
when(mConnectivityManager.isNetworkSupported(TYPE_WIFI)).thenReturn(true);
@@ -409,9 +407,10 @@
R.string.cell_data_template,
true,
mSubscriptionManager,
- mActivity, mLifecycle, mHeaderController, mDataUsageSummary);
+ mActivity, mLifecycle, mHeaderController, mPreferenceFragment,
+ mDefaultSubscriptionId);
- when(mDataUsageSummary.getListView()).thenReturn(recyclerView);
+ when(mPreferenceFragment.getListView()).thenReturn(recyclerView);
mController.onStart();
diff --git a/tests/robotests/src/com/android/settings/development/AllowBackgroundActivityStartsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/AllowBackgroundActivityStartsPreferenceControllerTest.java
index 41a3b60..8e95aa1 100644
--- a/tests/robotests/src/com/android/settings/development/AllowBackgroundActivityStartsPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/AllowBackgroundActivityStartsPreferenceControllerTest.java
@@ -24,6 +24,9 @@
import android.content.Context;
import android.provider.Settings;
+import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreference;
+
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -32,9 +35,6 @@
import org.robolectric.RobolectricTestRunner;
import org.robolectric.RuntimeEnvironment;
-import androidx.preference.PreferenceScreen;
-import androidx.preference.SwitchPreference;
-
@RunWith(RobolectricTestRunner.class)
public class AllowBackgroundActivityStartsPreferenceControllerTest {
@@ -52,7 +52,7 @@
mContext = RuntimeEnvironment.application;
mController = new AllowBackgroundActivityStartsPreferenceController(mContext);
when(mPreferenceScreen.findPreference(mController.getPreferenceKey()))
- .thenReturn(mPreference);
+ .thenReturn(mPreference);
mController.displayPreference(mPreferenceScreen);
}
@@ -98,11 +98,7 @@
public void onDeveloperOptionsSwitchDisabled_shouldDisablePreference() {
mController.onDeveloperOptionsSwitchDisabled();
- final int mode = Settings.Global.getInt(mContext.getContentResolver(),
- Settings.Global.BACKGROUND_ACTIVITY_STARTS_ENABLED, 1 /* default */);
-
- assertThat(mode).isEqualTo(0);
- verify(mPreference).setChecked(false);
+ verify(mPreference).setChecked(true);
verify(mPreference).setEnabled(false);
}
}
diff --git a/tests/robotests/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceControllerTest.java
new file mode 100644
index 0000000..b7aadc3
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/development/gup/GupEnableForAllAppsPreferenceControllerTest.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright 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.settings.development.gup;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.DISABLED_DEPENDENT_SETTING;
+import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_ALL_APPS;
+import static com.android.settings.development.gup.GupEnableForAllAppsPreferenceController.GUP_DEFAULT;
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreference;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class GupEnableForAllAppsPreferenceControllerTest {
+ @Mock
+ private PreferenceScreen mScreen;
+ @Mock
+ private SwitchPreference mPreference;
+
+ private Context mContext;
+ private ContentResolver mResolver;
+ private GupEnableForAllAppsPreferenceController mController;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mContext = RuntimeEnvironment.application;
+ mResolver = mContext.getContentResolver();
+ mController = new GupEnableForAllAppsPreferenceController(mContext, "testKey");
+ when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
+ }
+
+ @Test
+ public void getAvailability_developmentSettingsEnabled_available() {
+ Settings.Global.putInt(mResolver, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 1);
+
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+ }
+
+ @Test
+ public void getAvailability_developmentSettingsDisabled_disabledDependentSetting() {
+ Settings.Global.putInt(mResolver, Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0);
+
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(DISABLED_DEPENDENT_SETTING);
+ }
+
+ @Test
+ public void displayPreference_shouldAddSwitchPreference() {
+ Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
+ mController.displayPreference(mScreen);
+
+ verify(mPreference).setChecked(false);
+ }
+
+ @Test
+ public void onPreferenceChange_check_shouldUpdateSettingsGlobal() {
+ Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT);
+ mController.displayPreference(mScreen);
+ mController.onPreferenceChange(mPreference, true);
+
+ assertThat(Settings.Global.getInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT))
+ .isEqualTo(GUP_ALL_APPS);
+ }
+
+ @Test
+ public void onPreferenceChange_uncheck_shouldUpdateSettingsGlobal() {
+ Settings.Global.putInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_ALL_APPS);
+ mController.displayPreference(mScreen);
+ mController.onPreferenceChange(mPreference, false);
+
+ assertThat(Settings.Global.getInt(mResolver, Settings.Global.GUP_DEV_ALL_APPS, GUP_DEFAULT))
+ .isEqualTo(GUP_DEFAULT);
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
index d090097..023135d 100644
--- a/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
@@ -21,6 +21,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
@@ -140,7 +141,7 @@
@Test
public void getSummary_cannotGetActiveSubscriptionInfo_shouldShowUnknown() {
- when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(null);
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true))).thenReturn(null);
CharSequence primaryNumber = mController.getSummary();
@@ -157,7 +158,7 @@
public void copy_shouldCopyPhoneNumberToClipboard() {
final List<SubscriptionInfo> list = new ArrayList<>();
list.add(mSubscriptionInfo);
- when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(list);
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true))).thenReturn(list);
final String phoneNumber = "1111111111";
doReturn(phoneNumber).when(mController).getFormattedPhoneNumber(mSubscriptionInfo);
diff --git a/tests/robotests/src/com/android/settings/display/TimeoutListPreferenceTest.java b/tests/robotests/src/com/android/settings/display/TimeoutListPreferenceTest.java
index 7b67f0f..55fcdac 100644
--- a/tests/robotests/src/com/android/settings/display/TimeoutListPreferenceTest.java
+++ b/tests/robotests/src/com/android/settings/display/TimeoutListPreferenceTest.java
@@ -17,11 +17,11 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.Mockito.mock;
import static org.robolectric.RuntimeEnvironment.application;
import android.util.AttributeSet;
-import com.android.settings.R;
import com.android.settings.testutils.shadow.ShadowUserManager;
import com.android.settingslib.RestrictedLockUtils;
@@ -69,23 +69,4 @@
// should set to largest allowed value, which is 5 minute
assertThat(mPreference.getValue()).isEqualTo("300000");
}
-
- @Test
- @Config(qualifiers = "mcc999")
- public void newInstance_hasLowTimeoutConfig_shouldRemoveLongTimeouts() {
- final AttributeSet attributeSet = Robolectric.buildAttributeSet().build();
- final TimeoutListPreference pref = new TimeoutListPreference(application, attributeSet);
- final long maxTimeout = application.getResources().getInteger(
- R.integer.max_lock_after_timeout_ms);
- pref.setEntries(R.array.screen_timeout_entries);
- pref.setEntryValues(R.array.screen_timeout_values);
-
- pref.updateInitialValues();
-
- final CharSequence[] values = pref.getEntryValues();
- for (CharSequence value : values) {
- long timeout = Long.parseLong(value.toString());
- assertThat(timeout).isAtMost(maxTimeout);
- }
- }
}
diff --git a/tests/robotests/src/com/android/settings/gestures/TapScreenGesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/gestures/TapScreenGesturePreferenceControllerTest.java
new file mode 100644
index 0000000..c09e4eb
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/gestures/TapScreenGesturePreferenceControllerTest.java
@@ -0,0 +1,94 @@
+/*
+ * 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.settings.gestures;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.UNSUPPORTED_ON_DEVICE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+
+import com.android.internal.hardware.AmbientDisplayConfiguration;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Answers;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+
+@RunWith(RobolectricTestRunner.class)
+public class TapScreenGesturePreferenceControllerTest {
+
+ private static final String KEY_WAKE_LOCK_SCREEN = "gesture_tap_screen";
+
+ @Mock
+ private Context mContext;
+ @Mock
+ private AmbientDisplayConfiguration mAmbientDisplayConfiguration;
+
+ private TapScreenGesturePreferenceController mController;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mController = new TapScreenGesturePreferenceController(mContext, KEY_WAKE_LOCK_SCREEN);
+ mController.setConfig(mAmbientDisplayConfiguration);
+ }
+
+ @Test
+ public void testIsChecked_configIsSet_shouldReturnTrue() {
+ // Set the setting to be enabled.
+ when(mAmbientDisplayConfiguration.tapGestureEnabled(anyInt())).thenReturn(true);
+ assertThat(mController.isChecked()).isTrue();
+ }
+
+ @Test
+ public void testIsChecked_configIsNotSet_shouldReturnFalse() {
+ // Set the setting to be disabled.
+ when(mAmbientDisplayConfiguration.tapGestureEnabled(anyInt())).thenReturn(false);
+ assertThat(mController.isChecked()).isFalse();
+ }
+
+ @Test
+ public void getAvailabilityStatus_gestureNotSupported_UNSUPPORTED_ON_DEVICE() {
+ when(mAmbientDisplayConfiguration.tapSensorAvailable()).thenReturn(false);
+ final int availabilityStatus = mController.getAvailabilityStatus();
+
+ assertThat(availabilityStatus).isEqualTo(UNSUPPORTED_ON_DEVICE);
+ }
+
+ @Test
+ public void getAvailabilityStatus_gestureSupported_AVAILABLE() {
+ when(mAmbientDisplayConfiguration.tapSensorAvailable()).thenReturn(true);
+ final int availabilityStatus = mController.getAvailabilityStatus();
+
+ assertThat(availabilityStatus).isEqualTo(AVAILABLE);
+ }
+
+ @Test
+ public void isSliceable() {
+ final TapScreenGesturePreferenceController controller =
+ new TapScreenGesturePreferenceController(mContext, KEY_WAKE_LOCK_SCREEN);
+ assertThat(controller.isSliceable()).isTrue();
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
index 29472f5..447931e 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkActivityTest.java
@@ -20,6 +20,7 @@
import static com.google.common.truth.Truth.assertThat;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
@@ -108,7 +109,8 @@
@Test
public void updateBottomNavigationView_oneSubscription_shouldBeGone() {
mSubscriptionInfos.add(mSubscriptionInfo);
- doReturn(mSubscriptionInfos).when(mSubscriptionManager).getActiveSubscriptionInfoList();
+ doReturn(mSubscriptionInfos).when(mSubscriptionManager).getActiveSubscriptionInfoList(
+ eq(true));
mMobileNetworkActivity.updateBottomNavigationView();
@@ -120,7 +122,8 @@
final Menu menu = new ContextMenuBuilder(mContext);
mSubscriptionInfos.add(mSubscriptionInfo);
mSubscriptionInfos.add(mSubscriptionInfo);
- doReturn(mSubscriptionInfos).when(mSubscriptionManager).getActiveSubscriptionInfoList();
+ doReturn(mSubscriptionInfos).when(mSubscriptionManager).getActiveSubscriptionInfoList(
+ eq(true));
doReturn(menu).when(mBottomNavigationView).getMenu();
mMobileNetworkActivity.updateBottomNavigationView();
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkSettingsTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkSettingsTest.java
new file mode 100644
index 0000000..0240bd8
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkSettingsTest.java
@@ -0,0 +1,113 @@
+/*
+ * 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.settings.network.telephony;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.app.usage.NetworkStatsManager;
+import android.content.Context;
+import android.net.NetworkPolicyManager;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.telephony.TelephonyManager;
+
+import com.android.settings.core.FeatureFlags;
+import com.android.settings.datausage.DataUsageSummaryPreferenceController;
+import com.android.settings.development.featureflags.FeatureFlagPersistent;
+import com.android.settings.testutils.shadow.ShadowEntityHeaderController;
+import com.android.settings.widget.EntityHeaderController;
+import com.android.settingslib.core.AbstractPreferenceController;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+import java.util.List;
+
+import androidx.fragment.app.FragmentActivity;
+
+@RunWith(RobolectricTestRunner.class)
+@Config(shadows = ShadowEntityHeaderController.class)
+public class MobileNetworkSettingsTest {
+ @Mock
+ private TelephonyManager mTelephonyManager;
+ @Mock
+ private NetworkStatsManager mNetworkStatsManager;
+ @Mock
+ private NetworkPolicyManager mNetworkPolicyManager;
+ @Mock
+ private FragmentActivity mActivity;
+
+ private Context mContext;
+ private MobileNetworkSettings mFragment;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ mContext = spy(RuntimeEnvironment.application);
+ when(mContext.getSystemService(Context.TELEPHONY_SERVICE)).thenReturn(mTelephonyManager);
+ when(mTelephonyManager.createForSubscriptionId(anyInt())).thenReturn(mTelephonyManager);
+ when(mContext.getSystemService(NetworkStatsManager.class)).thenReturn(mNetworkStatsManager);
+ ShadowEntityHeaderController.setUseMock(mock(EntityHeaderController.class));
+
+ mFragment = spy(new MobileNetworkSettings());
+ final Bundle args = new Bundle();
+ final int subscriptionId = 1234;
+ args.putInt(Settings.EXTRA_SUB_ID, subscriptionId);
+ mFragment.setArguments(args);
+ when(mFragment.getActivity()).thenReturn(mActivity);
+ when(mActivity.getSystemService(NetworkPolicyManager.class)).thenReturn(
+ mNetworkPolicyManager);
+ }
+
+ @Test
+ public void onAttach_noCrash() {
+ mFragment.onAttach(mContext);
+ }
+
+ @Test
+ public void createPreferenceControllers_noV2Flag_noDataUsageSummaryController() {
+ final List<AbstractPreferenceController> controllers =
+ mFragment.createPreferenceControllers(mContext);
+ assertThat(controllers.stream().filter(
+ c -> c.getClass().equals(DataUsageSummaryPreferenceController.class))
+ .count())
+ .isEqualTo(0);
+ }
+
+ @Test
+ public void createPreferenceControllers_v2Flag_createsDataUsageSummaryController() {
+ FeatureFlagPersistent.setEnabled(mContext, FeatureFlags.NETWORK_INTERNET_V2, true);
+
+ final List<AbstractPreferenceController> controllers =
+ mFragment.createPreferenceControllers(mContext);
+ assertThat(controllers.stream().filter(
+ c -> c.getClass().equals(DataUsageSummaryPreferenceController.class))
+ .count())
+ .isEqualTo(1);
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
index 7ba1eb9..34e680e 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/MobileNetworkUtilsTest.java
@@ -20,6 +20,7 @@
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
@@ -104,7 +105,7 @@
when(mSubscriptionInfo1.getSubscriptionId()).thenReturn(SUB_ID_1);
when(mSubscriptionInfo2.getSubscriptionId()).thenReturn(SUB_ID_2);
- when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true))).thenReturn(
Arrays.asList(mSubscriptionInfo1, mSubscriptionInfo2));
}
diff --git a/tests/robotests/src/com/android/settings/privacy/PermissionBarChartPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/privacy/PermissionBarChartPreferenceControllerTest.java
new file mode 100644
index 0000000..119ac7d
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/privacy/PermissionBarChartPreferenceControllerTest.java
@@ -0,0 +1,113 @@
+/*
+ * 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.settings.privacy;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE_UNSEARCHABLE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.permission.RuntimePermissionUsageInfo;
+
+import androidx.preference.PreferenceScreen;
+
+import com.android.settingslib.widget.BarChartInfo;
+import com.android.settingslib.widget.BarChartPreference;
+import com.android.settingslib.widget.BarViewInfo;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@RunWith(RobolectricTestRunner.class)
+public class PermissionBarChartPreferenceControllerTest {
+
+ @Mock
+ private PreferenceScreen mScreen;
+
+ private PermissionBarChartPreferenceController mController;
+ private BarChartPreference mPreference;
+
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+ Context Context = RuntimeEnvironment.application;
+ mController = new PermissionBarChartPreferenceController(Context, "test_key");
+ mPreference = spy(new BarChartPreference(Context));
+ when(mScreen.findPreference(mController.getPreferenceKey()))
+ .thenReturn((BarChartPreference) mPreference);
+ }
+
+ @Test
+ public void getAvailabilityStatus_shouldReturnAvailableUnsearchable() {
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE_UNSEARCHABLE);
+ }
+
+ @Test
+ public void displayPreference_shouldInitializeBarChart() {
+ mController.displayPreference(mScreen);
+
+ verify(mPreference).initializeBarChart(any(BarChartInfo.class));
+ }
+
+ @Test
+ public void onPermissionUsageResult_differentPermissionResultSet_shouldSetBarViewInfos() {
+ final List<RuntimePermissionUsageInfo> infos1 = new ArrayList<>();
+ final RuntimePermissionUsageInfo info1 =
+ new RuntimePermissionUsageInfo("permission 1", 10);
+ infos1.add(info1);
+ mController.displayPreference(mScreen);
+ mController.onPermissionUsageResult(infos1);
+
+ verify(mPreference).setBarViewInfos(any(BarViewInfo[].class));
+
+ final List<RuntimePermissionUsageInfo> infos2 = new ArrayList<>();
+ final RuntimePermissionUsageInfo info2 =
+ new RuntimePermissionUsageInfo("permission 2", 20);
+ infos2.add(info2);
+ mController.onPermissionUsageResult(infos2);
+
+ verify(mPreference, times(2)).setBarViewInfos(any(BarViewInfo[].class));
+ }
+
+ @Test
+ public void onPermissionUsageResult_samePermissionResultSet_shouldNotSetBarViewInfos() {
+ final List<RuntimePermissionUsageInfo> mInfos = new ArrayList<>();
+ final RuntimePermissionUsageInfo info1 =
+ new RuntimePermissionUsageInfo("permission 1", 10);
+ mInfos.add(info1);
+ mController.displayPreference(mScreen);
+ mController.onPermissionUsageResult(mInfos);
+
+ mController.onPermissionUsageResult(mInfos);
+
+ verify(mPreference, times(1)).setBarViewInfos(any(BarViewInfo[].class));
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/security/SimLockPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/security/SimLockPreferenceControllerTest.java
index 07d8ac5..0ae33a0 100644
--- a/tests/robotests/src/com/android/settings/security/SimLockPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/security/SimLockPreferenceControllerTest.java
@@ -21,6 +21,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -141,7 +142,7 @@
SubscriptionInfo info = mock(SubscriptionInfo.class);
subscriptionInfoList.add(info);
when(mTelephonyManager.hasIccCard(anyInt())).thenReturn(true);
- when(mSubscriptionManager.getActiveSubscriptionInfoList())
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true)))
.thenReturn(subscriptionInfoList);
}
@@ -150,7 +151,7 @@
SubscriptionInfo info = mock(SubscriptionInfo.class);
subscriptionInfoList.add(info);
when(mTelephonyManager.getSimState(anyInt())).thenReturn(SIM_STATE_READY);
- when(mSubscriptionManager.getActiveSubscriptionInfoList())
+ when(mSubscriptionManager.getActiveSubscriptionInfoList(eq(true)))
.thenReturn(subscriptionInfoList);
}
}