Merge "Add UI to Settings > Location for Managed Profile Location Control"
diff --git a/res/layout/preference_importance_slider.xml b/res/layout/preference_importance_slider.xml
new file mode 100644
index 0000000..737254b
--- /dev/null
+++ b/res/layout/preference_importance_slider.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?android:attr/listPreferredItemHeight"
+ android:gravity="center_vertical"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:orientation="vertical"
+ android:clickable="false"
+ android:focusable="false"
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip">
+
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="@android:style/TextAppearance.Material.Subhead"
+ android:textColor="?android:attr/textColorPrimary"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal" />
+
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignStart="@android:id/title"
+ android:textAlignment="viewStart"
+ android:textAppearance="@android:style/TextAppearance.Material.Body1"
+ android:textColor="?android:attr/textColorSecondary"
+ android:maxLines="10"
+ android:minLines="2" />
+
+ <FrameLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="6dp">
+
+ <ImageView
+ android:id="@+id/low_importance"
+ android:src="@android:drawable/ic_menu_close_clear_cancel"
+ android:layout_gravity="center_vertical|start"
+ android:layout_width="24dp"
+ android:layout_height="24dp" />
+
+ <SeekBar
+ android:id="@*android:id/seekbar"
+ android:layout_marginStart="24dp"
+ android:layout_marginEnd="24dp"
+ android:layout_gravity="center_vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:focusable="true"/>
+
+ <ImageView
+ android:id="@+id/max_importance"
+ android:src="@android:drawable/ic_popup_reminder"
+ android:layout_gravity="center_vertical|end"
+ android:layout_width="24dp"
+ android:layout_height="24dp" />
+
+ </FrameLayout>
+
+</LinearLayout>
diff --git a/res/layout/preference_volume_slider.xml b/res/layout/preference_volume_slider.xml
index 878a710..d279eb6 100644
--- a/res/layout/preference_volume_slider.xml
+++ b/res/layout/preference_volume_slider.xml
@@ -20,7 +20,8 @@
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
- android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:clickable="false" >
<LinearLayout
android:layout_width="match_parent"
diff --git a/res/layout/radio_info.xml b/res/layout/radio_info.xml
index a288224..16bf0f6 100644
--- a/res/layout/radio_info.xml
+++ b/res/layout/radio_info.xml
@@ -51,13 +51,13 @@
/>
<LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_ping_ipaddr" style="@style/info_label" />
- <TextView android:id="@+id/pingIpAddr" style="@style/info_value" />
+ <TextView android:text="@string/radio_info_ping_hostname_v4" style="@style/info_label" />
+ <TextView android:id="@+id/pingHostnameV4" style="@style/info_value" />
</LinearLayout>
<LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_ping_hostname" style="@style/info_label" />
- <TextView android:id="@+id/pingHostname" style="@style/info_value" />
+ <TextView android:text="@string/radio_info_ping_hostname_v6" style="@style/info_label" />
+ <TextView android:id="@+id/pingHostnameV6" style="@style/info_value" />
</LinearLayout>
<LinearLayout style="@style/entry_layout">
@@ -71,6 +71,14 @@
<TextView android:id="@+id/dbm" style="@style/info_value" />
</LinearLayout>
+ <!-- CellInfoListRate -->
+ <Button android:id="@+id/cell_info_list_rate"
+ android:textSize="14sp"
+ android:layout_marginTop="8dip"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ />
+
<!-- Location -->
<LinearLayout style="@style/entry_layout">
<TextView android:text="@string/radio_info_signal_location_label" style="@style/info_label" />
@@ -88,6 +96,8 @@
<LinearLayout style="@style/entry_layout">
<TextView android:text="@string/radio_info_cellinfo_label"
style="@style/info_label" />
+ </LinearLayout>
+ <LinearLayout style="@style/entry_layout">
<TextView android:id="@+id/cellinfo" style="@style/info_value" />
</LinearLayout>
@@ -140,7 +150,6 @@
<TextView android:id="@+id/call" style="@style/info_value" />
</LinearLayout>
-
<!-- Radio Resets -->
<LinearLayout style="@style/entry_layout">
<TextView android:text="@string/radio_info_radio_resets_label" style="@style/info_label" />
@@ -210,15 +219,7 @@
android:layout_height="wrap_content"
/>
- <!-- CellInfoListRate -->
- <Button android:id="@+id/cell_info_list_rate"
- android:textSize="14sp"
- android:layout_marginTop="8dip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- />
-
- <!-- IMS registration required -->
+ <!-- IMS registration required -->
<Button android:id="@+id/ims_reg_required"
android:textSize="14sp"
android:layout_marginTop="8dip"
diff --git a/res/layout/wifi_status_test.xml b/res/layout/wifi_status_test.xml
index 2bdfbfc..aac3207 100644
--- a/res/layout/wifi_status_test.xml
+++ b/res/layout/wifi_status_test.xml
@@ -111,11 +111,6 @@
/>
<LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_ping_ipaddr" style="@style/info_label" />
- <TextView android:id="@+id/pingIpAddr" style="@style/info_value" />
- </LinearLayout>
-
- <LinearLayout style="@style/entry_layout">
<TextView android:text="@string/radio_info_ping_hostname" style="@style/info_label" />
<TextView android:id="@+id/pingHostname" style="@style/info_value" />
</LinearLayout>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index b3e2655..f04892e 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -880,237 +880,6 @@
<item>-1</item>
</integer-array>
- <!-- Titles for logd limit size selection preference. [CHAR LIMIT=14] -->
- <string-array name="select_logd_size_titles">
- <item>64K</item>
- <item>256K</item>
- <item>1M</item>
- <item>4M</item>
- <item>16M</item>
- </string-array>
-
- <!-- Titles for logd limit size lowram selection preference. [CHAR LIMIT=14] -->
- <string-array name="select_logd_size_lowram_titles">
- <item>64K</item>
- <item>256K</item>
- <item>1M</item>
- </string-array>
-
- <!-- Values for logd limit size selection preference. -->
- <string-array name="select_logd_size_values" translatable="false" >
- <item>65536</item>
- <item>262144</item>
- <item>1048576</item>
- <item>4194304</item>
- <item>16777216</item>
- </string-array>
-
- <!-- Summaries for logd limit size selection preference. [CHAR LIMIT=30]-->
- <string-array name="select_logd_size_summaries" >
- <item>64K per log buffer</item>
- <item>256K per log buffer</item>
- <item>1M per log buffer</item>
- <item>4M per log buffer</item>
- <item>16M per log buffer</item>
- </string-array>
-
- <!-- Titles for HDCP checking preference. [CHAR LIMIT=35] -->
- <string-array name="hdcp_checking_titles">
- <item>Never check</item>
- <item>Check for DRM content only</item>
- <item>Always check</item>
- </string-array>
-
- <!-- Values for HDCP checking preference. -->
- <string-array name="hdcp_checking_values" translatable="false" >
- <item>never</item>
- <item>drm-only</item>
- <item>always</item>
- </string-array>
-
- <!-- Summaries for HDCP checking preference. [CHAR LIMIT=100]-->
- <string-array name="hdcp_checking_summaries" >
- <item>Never use HDCP checking</item>
- <item>Use HDCP checking for DRM content only</item>
- <item>Always use HDCP checking</item>
- </string-array>
-
- <!-- Titles for window animation scale preference. [CHAR LIMIT=35] -->
- <string-array name="window_animation_scale_entries">
- <item>Animation off</item>
- <item>Animation scale .5x</item>
- <item>Animation scale 1x</item>
- <item>Animation scale 1.5x</item>
- <item>Animation scale 2x</item>
- <item>Animation scale 5x</item>
- <item>Animation scale 10x</item>
- </string-array>
-
- <!-- Values for window animation scale preference. -->
- <string-array name="window_animation_scale_values" translatable="false" >
- <item>0</item>
- <item>.5</item>
- <item>1</item>
- <item>1.5</item>
- <item>2</item>
- <item>5</item>
- <item>10</item>
- </string-array>
-
- <!-- Titles for transition animation scale preference. [CHAR LIMIT=35] -->
- <string-array name="transition_animation_scale_entries">
- <item>Animation off</item>
- <item>Animation scale .5x</item>
- <item>Animation scale 1x</item>
- <item>Animation scale 1.5x</item>
- <item>Animation scale 2x</item>
- <item>Animation scale 5x</item>
- <item>Animation scale 10x</item>
- </string-array>
-
- <!-- Values for transition animation scale preference. -->
- <string-array name="transition_animation_scale_values" translatable="false" >
- <item>0</item>
- <item>.5</item>
- <item>1</item>
- <item>1.5</item>
- <item>2</item>
- <item>5</item>
- <item>10</item>
- </string-array>
-
- <!-- Titles for animator duration scale preference. [CHAR LIMIT=35] -->
- <string-array name="animator_duration_scale_entries">
- <item>Animation off</item>
- <item>Animation scale .5x</item>
- <item>Animation scale 1x</item>
- <item>Animation scale 1.5x</item>
- <item>Animation scale 2x</item>
- <item>Animation scale 5x</item>
- <item>Animation scale 10x</item>
- </string-array>
-
- <!-- Values for animator duration scale preference. -->
- <string-array name="animator_duration_scale_values" translatable="false" >
- <item>0</item>
- <item>.5</item>
- <item>1</item>
- <item>1.5</item>
- <item>2</item>
- <item>5</item>
- <item>10</item>
- </string-array>
-
- <!-- Titles for overlay display devices preference. [CHAR LIMIT=35] -->
- <string-array name="overlay_display_devices_entries">
- <item>None</item>
- <item>480p</item>
- <item>480p (secure)</item>
- <item>720p</item>
- <item>720p (secure)</item>
- <item>1080p</item>
- <item>1080p (secure)</item>
- <item>4K</item>
- <item>4K (secure)</item>
- <item>4K (upscaled)</item>
- <item>4K (upscaled, secure)</item>
- <item>720p, 1080p (dual screen)</item>
- </string-array>
-
- <!-- Values for overlay display devices preference. -->
- <string-array name="overlay_display_devices_values" translatable="false" >
- <item></item>
- <item>720x480/142</item>
- <item>720x480/142,secure</item>
- <item>1280x720/213</item>
- <item>1280x720/213,secure</item>
- <item>1920x1080/320</item>
- <item>1920x1080/320,secure</item>
- <item>3840x2160/320</item>
- <item>3840x2160/320,secure</item>
- <item>1920x1080/320|3840x2160/640</item>
- <item>1920x1080/320|3840x2160/640,secure</item>
- <item>1280x720/213;1920x1080/320</item>
- </string-array>
-
- <!-- Titles for OpenGL traces preference. [CHAR LIMIT=35] -->
- <string-array name="enable_opengl_traces_entries">
- <item>None</item>
- <item>Logcat</item>
- <item>Systrace (Graphics)</item>
- <item>Call stack on glGetError</item>
- </string-array>
-
- <!-- Values for OpenGL traces preference. -->
- <string-array name="enable_opengl_traces_values" translatable="false" >
- <item>0</item>
- <item>1</item>
- <item>systrace</item>
- <item>error</item>
- </string-array>
-
- <!-- Titles for non-rectangular clipping preference. [CHAR LIMIT=35] -->
- <string-array name="show_non_rect_clip_entries">
- <item>Off</item>
- <item>Draw non-rectangular clip region in blue</item>
- <item>Highlight tested drawing commands in green</item>
- </string-array>
-
- <!-- Values for non-rectangular clipping preference. -->
- <string-array name="show_non_rect_clip_values" translatable="false" >
- <item>hide</item>
- <item>region</item>
- <item>highlight</item>
- </string-array>
-
- <!-- Titles for frame time tracking preference. [CHAR LIMIT=35] -->
- <string-array name="track_frame_time_entries">
- <item>Off</item>
- <item>On screen as bars</item>
- <item>In adb shell dumpsys gfxinfo</item>
- </string-array>
-
- <!-- Values for frame time tracking preference. -->
- <string-array name="track_frame_time_values" translatable="false" >
- <item>false</item>
- <item>visual_bars</item>
- <item>true</item>
- </string-array>
-
- <!-- Titles for debug overdraw preference. [CHAR LIMIT=50] -->
- <string-array name="debug_hw_overdraw_entries">
- <item>Off</item>
- <item>Show overdraw areas</item>
- <item>Show areas for Deuteranomaly</item>
- </string-array>
-
- <!-- Values for debug overdraw preference. -->
- <string-array name="debug_hw_overdraw_values" translatable="false" >
- <item>false</item>
- <item>show</item>
- <item>show_deuteranomaly</item>
- </string-array>
-
- <!-- Titles for app process limit preference. [CHAR LIMIT=35] -->
- <string-array name="app_process_limit_entries">
- <item>Standard limit</item>
- <item>No background processes</item>
- <item>At most 1 process</item>
- <item>At most 2 processes</item>
- <item>At most 3 processes</item>
- <item>At most 4 processes</item>
- </string-array>
-
- <!-- Values for app process limit preference. -->
- <string-array name="app_process_limit_values" translatable="false" >
- <item>-1</item>
- <item>0</item>
- <item>1</item>
- <item>2</item>
- <item>3</item>
- <item>4</item>
- </string-array>
-
<!-- Match this with the constants in VpnProfile. --> <skip />
<!-- Short names for each VPN type, not really translatable. [CHAR LIMIT=20] -->
<string-array name="vpn_types" translatable="false">
@@ -1213,24 +982,6 @@
<item>13</item>
</string-array>
- <!-- Display color space adjustment modes for developers -->
- <string-array name="simulate_color_space_entries" translatable="false">
- <item>@string/daltonizer_mode_disabled</item>
- <item>@string/daltonizer_mode_monochromacy</item>
- <item>@string/daltonizer_mode_deuteranomaly</item>
- <item>@string/daltonizer_mode_protanomaly</item>
- <item>@string/daltonizer_mode_tritanomaly</item>
- </string-array>
-
- <!-- Values for display color space adjustment modes for developers -->
- <string-array name="simulate_color_space_values" translatable="false">
- <item>-1</item>
- <item>0</item>
- <item>2</item>
- <item>1</item>
- <item>3</item>
- </string-array>
-
<!-- Battery saver mode: allowable trigger threshold levels. -->
<integer-array name="battery_saver_trigger_values" translatable="false" >
<item>0</item>
@@ -1274,56 +1025,4 @@
<item>Red</item>
</string-array>
- <!-- USB configuration names for Developer Settings.
- This can be overridden by devices with additional USB configurations. -->
- <string-array name="usb_configuration_titles">
- <item>@string/usb_use_charging_only</item>
- <item>MTP (Media Transfer Protocol)</item>
- <item>PTP (Picture Transfer Protocol)</item>
- <item>RNDIS (USB Ethernet)</item>
- <item>Audio Source</item>
- <item>MIDI</item>
- </string-array>
-
- <!-- USB configuration values for Developer Settings.
- These are lists of USB functions passed to the USB Manager to change USB configuraton.
- This can be overridden by devices with additional USB configurations.
- Do not translate. -->
- <string-array name="usb_configuration_values" translatable="false">
- <!-- Do not translate. -->
- <item>none</item>
- <!-- Do not translate. -->
- <item>mtp</item>
- <!-- Do not translate. -->
- <item>ptp</item>
- <!-- Do not translate. -->
- <item>rndis</item>
- <!-- Do not translate. -->
- <item>audio_source</item>
- <!-- Do not translate. -->
- <item>midi</item>
- </string-array>
-
- <!-- Possible values for user theme in Display Settings.
- Do not translate. -->
- <string-array name="night_mode_entries" translatable="false">
- <!-- Do not translate. -->
- <item>@string/night_mode_no</item>
- <!-- Do not translate. -->
- <item>@string/night_mode_yes</item>
- <!-- Do not translate. -->
- <item>@string/night_mode_auto</item>
- </string-array>
-
- <!-- These values should match up with the MODE_NIGHT constants in UiModeManager.
- Do not translate. -->
- <string-array name="night_mode_values" translatable="false">
- <!-- Do not translate. -->
- <item>1</item>
- <!-- Do not translate. -->
- <item>2</item>
- <!-- Do not translate. -->
- <item>0</item>
- </string-array>
-
</resources>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 67b5eaa..cd7a710 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -403,7 +403,7 @@
<string name="radio_info_data_attempts_label">Data attempts:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_gprs_service_label">GPRS service:</string>
+ <string name="radio_info_gprs_service_label">Data Technology:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radio_info_roaming_label">Roaming:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
@@ -421,7 +421,7 @@
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radio_info_ppp_received_label">PPP received:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_gsm_service_label">GSM service:</string>
+ <string name="radio_info_gsm_service_label">Voice Technology:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radio_info_signal_strength_label">Signal strength:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
@@ -441,9 +441,9 @@
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radio_info_set_perferred_label">Set preferred network type:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_ping_ipaddr">Ping IpAddr:</string>
+ <string name="radio_info_ping_hostname_v4">Ping Hostname(www.google.com) IPv4:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_ping_hostname">Ping Hostname(www.google.com):</string>
+ <string name="radio_info_ping_hostname_v6">Ping Hostname(www.google.com) IPv6:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radio_info_http_client_test">HTTP Client test:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
@@ -1486,6 +1486,8 @@
<string name="wifi_menu_scan">Scan</string>
<!-- Menu option to Wi-Fi advanced settings -->
<string name="wifi_menu_advanced">Advanced</string>
+ <!-- Menu option to Wi-Fi configure settings -->
+ <string name="wifi_menu_configure">Configure</string>
<!-- Menu option to connect to a Wi-Fi network -->
<string name="wifi_menu_connect">Connect to network</string>
<!-- Menu option to remember a temporary Wi-Fi network -->
@@ -1656,6 +1658,8 @@
<string name="wifi_saved_access_points_titlebar">Saved networks</string>
<!-- Wi-Fi settings screen, advanced, settings section. This is a header shown above advanced wifi settings. [CHAR LIMIT=30] -->
<string name="wifi_advanced_titlebar">Advanced Wi\u2011Fi</string>
+ <!-- Wi-Fi settings screen, configure, settings section. This is a header shown above configure wifi settings. [CHAR LIMIT=30] -->
+ <string name="wifi_configure_titlebar">Configure Wi\u2011Fi</string>
<!-- Wi-Fi settings screen, setting title for setting the band [CHAR LIMIT=50]-->
<string name="wifi_setting_frequency_band_title">Wi\u2011Fi frequency band</string>
<!-- Wi-Fi settings screen, setting summary for setting the wifi frequency band [CHAR LIMIT=50]-->
@@ -1998,33 +2002,6 @@
<string name="auto_brightness_title">Adaptive brightness</string>
<!-- Sound & display settings screen, setting option summary to enable adaptive brightness [CHAR LIMIT=100] -->
<string name="auto_brightness_summary">Optimize brightness level for available light</string>
- <!-- Sound & display settings screen, setting option name to change the user interface theme [CHAR LIMIT=30] -->
- <string name="night_mode_title">Night mode</string>
- <!-- Sound & display settings screen, setting option summary to change the user interface theme [CHAR LIMIT=100] -->
- <string name="night_mode_summary">%s</string>
- <!-- Sound & display settings screen, theme setting value to prefer a light-colored user interface [CHAR LIMIT=30] -->
- <string name="night_mode_no">Disabled</string>
- <!-- Sound & display settings screen, theme setting value to prefer a dark-colored user interface [CHAR LIMIT=30] -->
- <string name="night_mode_yes">Always on</string>
- <!-- Sound & display settings screen, theme setting value to automatically switch between a light- or dark-colored user interface [CHAR LIMIT=30] -->
- <string name="night_mode_auto">Automatic</string>
-
- <!-- Developer settings screen, convert userdata to file encryption option name -->
- <string name="convert_to_file_encryption">Convert to file encryption</string>
- <!-- Developer settings screen, convert userdata to file encryption summary when option is available -->
- <string name="convert_to_file_encryption_enabled">Convert\u2026</string>
- <!-- Developer settings screen, convert userdata to file encryption summary when option is already done -->
- <string name="convert_to_file_encryption_done">Already file encrypted</string>
- <!-- Title used on dialog with final prompt for converting to file encryption -->
- <string name="title_convert_fbe">Converting to file based encryption</string>
- <!-- Warning displayed on dialog with final prompt for converting to file encryption -->
- <string name="convert_to_fbe_warning">
- Convert data partition to file based encryption.\n
- !!Warning!! This will erase all your data.\n
- This feature is alpha, and may not work correctly.\n
- Press \'Wipe and convert\u2026\' to continue.</string>
- <!-- Button on dialog that triggers convertion to file encryption -->
- <string name="button_convert_fbe">Wipe and convert\u2026</string>
<!-- Sound & display settings screen, setting option name to change screen timeout -->
<string name="screen_timeout">Sleep</string>
@@ -3323,10 +3300,6 @@
<!-- Services settings screen, setting option summary for the user to go to the screen to app storage use -->
<string name="storageuse_settings_summary">View storage used by apps</string>
- <!-- Services settings screen, setting option name for the user to go to the screen to view running services -->
- <string name="runningservices_settings_title">Running services</string>
- <!-- Services settings screen, setting option summary for the user to go to the screen to view running services -->
- <string name="runningservices_settings_summary">View and control currently running services</string>
<!-- Label for a service item when it is restarting -->
<string name="service_restarting">Restarting</string>
<!-- Label for a process item representing a background process -->
@@ -3589,140 +3562,6 @@
<!-- Summary for built-in keyboard settings -->
<string name="builtin_keyboard_settings_summary">Physical keyboard settings</string>
- <!-- Development Settings. the title for the item to take the user to Development settings. Development settings are settings meant for application developers. -->
- <string name="development_settings_title">Developer options</string>
- <!-- Development Settings summary. The summary of the item to take the user to Development settings. Development settings are settings meant for application developers. -->
- <string name="development_settings_summary">Set options for app development</string>
- <!-- Setting checkbox title for Whether to enable USB debugging support on the phone. -->
- <!-- Error message for users that aren't allowed to modify developer options [CHAR LIMIT=none] -->
- <string name="development_settings_not_available">Developer options are not available for this user</string>
- <!-- Error message for users that aren't allowed to modify VPN settings [CHAR LIMIT=none] -->
- <string name="vpn_settings_not_available">VPN settings are not available for this user</string>
- <!-- Error message for users that aren't allowed to modify Tethering settings [CHAR LIMIT=none] -->
- <string name="tethering_settings_not_available">Tethering settings are not available for this user</string>
- <!-- Error message for users that aren't allowed to modify Access Point Names settings [CHAR LIMIT=none] -->
- <string name="apn_settings_not_available">Access Point Name settings are not available for this user</string>
- <string name="enable_adb">USB debugging</string>
- <!-- Setting checkbox summary for Whether to enable USB debugging support on the phone -->
- <string name="enable_adb_summary">Debug mode when USB is connected</string>
- <!-- Setting title to revoke secure USB debugging authorizations -->
- <string name="clear_adb_keys">Revoke USB debugging authorizations</string>
- <!-- [CHAR LIMIT=NONE] Setting checkbox title for Whether to include bug report item in power menu. -->
- <string name="bugreport_in_power">Bug report shortcut</string>
- <!-- [CHAR LIMIT=NONE] Setting checkbox summary for Whether to include bug report item in power -->
- <string name="bugreport_in_power_summary">Show a button in the power menu for taking a bug report</string>
- <!-- Setting Checkbox title whether to keep the screen on when plugged in to a power source -->
- <string name="keep_screen_on">Stay awake</string>
- <!-- setting Checkbox summary whether to keep the screen on when plugged in -->
- <string name="keep_screen_on_summary">Screen will never sleep while charging</string>
- <!-- Setting Checkbox title whether to enable bluetooth HCI snoop log -->
- <string name="bt_hci_snoop_log">Enable Bluetooth HCI snoop log</string>
- <!-- setting Checkbox summary whether to capture all bluetooth HCI packets in a file -->
- <string name="bt_hci_snoop_log_summary">Capture all bluetooth HCI packets in a file</string>
- <!-- setting Checkbox title whether to enable OEM unlock [CHAR_LIMIT=35] -->
- <string name="oem_unlock_enable">OEM unlocking</string>
- <!-- setting Checkbox summary whether to enable OEM unlock [CHAR_LIMIT=50] -->
- <string name="oem_unlock_enable_summary">Allow the bootloader to be unlocked</string>
- <!-- Confirmation dialog title to ensure user wishes to enable OEM unlock and disable theft protection features -->
- <string name="confirm_enable_oem_unlock_title">Allow OEM unlocking?</string>
- <!-- Warning dialog message to confirm user wishes to enable OEM unlock and disable theft protection features -->
- <string name="confirm_enable_oem_unlock_text">WARNING: Device protection features will not work on this device while this setting is turned on.</string>
-
- <!-- UI debug setting: limit size of Android logger buffers -->
- <string name="select_logd_size_title">Logger buffer sizes</string>
- <!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
- <string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
-
- <!-- UI debug setting: select current app to mock location [CHAR LIMIT=50] -->
- <string name="mock_location_app">Select mock location app</string>
- <!-- UI debug setting: no mock location app has been set [CHAR LIMIT=50] -->
- <string name="mock_location_app_not_set">No mock location app set</string>
- <!-- UI debug setting: mock location app has been set [CHAR LIMIT=50] -->
- <string name="mock_location_app_set">Mock location app: <xliff:g id="app_name">%1$s</xliff:g></string>
-
- <!-- Setting Checkbox title whether to enable view attribute inspection -->
- <string name="debug_view_attributes">Enable view attribute inspection</string>
- <!-- Title of warning dialog about the implications of enabling USB debugging -->
-
- <!-- Preference category for networking debugging development settings. [CHAR LIMIT=50] -->
- <string name="debug_networking_category">Networking</string>
-
- <!-- Setting Checkbox title whether to show options for wireless display certification -->
- <string name="wifi_display_certification">Wireless display certification</string>
- <!-- Setting Checkbox title whether to enable WiFi Verbose Logging. [CHAR LIMIT=40] -->
- <string name="wifi_verbose_logging">Enable Wi\u2011Fi Verbose Logging</string>
- <!-- Setting Checkbox title whether to enable WiFi Aggressive Handover. [CHAR LIMIT=40] -->
- <string name="wifi_aggressive_handover">Aggressive Wi\u2011Fi to Cellular handover</string>
- <!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
- <string name="wifi_allow_scan_with_traffic">Always allow Wi\u2011Fi Roam Scans</string>
- <!-- Setting Checkbox title whether to enable WiFi Scanning in the presence of traffic. [CHAR LIMIT=80] -->
- <string name="legacy_dhcp_client">Use legacy DHCP client</string>
- <!-- Setting Checkbox title whether to always keep cellular data active. [CHAR LIMIT=80] -->
- <string name="mobile_data_always_on">Cellular data always active</string>
-
- <!-- setting Checkbox summary whether to show options for wireless display certification -->
- <string name="wifi_display_certification_summary">Show options for wireless display certification</string>
- <!-- Setting Checkbox summary whether to enable Wifi verbose Logging [CHAR LIMIT=80] -->
- <string name="wifi_verbose_logging_summary">Increase Wi\u2011Fi logging level, show per SSID RSSI in Wi\u2011Fi Picker</string>
- <!-- Setting Checkbox summary whether to enable Wifi aggressive handover [CHAR LIMIT=130] -->
- <string name="wifi_aggressive_handover_summary">When enabled, Wi\u2011Fi will be more aggressive in handing over the data connection to Cellular, when Wi\u2011Fi signal is low</string>
- <!-- Setting Checkbox summary whether to always allow WiFi Roam Scans [CHAR LIMIT=130] -->
- <string name="wifi_allow_scan_with_traffic_summary">Allow/Disallow Wi\u2011Fi Roam Scans based on the amount of data traffic present at the interface</string>
- <!-- UI debug setting: limit size of Android logger buffers -->
- <string name="select_logd_size_title">Logger buffer sizes</string>
- <!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
- <string name="select_logd_size_dialog_title">Select Logger sizes per log buffer</string>
- <!-- UI debug setting: select USB configuration -->
- <string name="select_usb_configuration_title">Select USB Configuration</string>
- <!-- UI debug setting: limit size of Android logger buffers [CHAR LIMIT=59] -->
- <string name="select_usb_configuration_dialog_title">Select USB Configuration</string>
- <!-- Setting Checkbox title whether to allow mock locations -->
- <string name="allow_mock_location">Allow mock locations</string>
- <!-- setting Checkbox summary whether to allow mock locations -->
- <string name="allow_mock_location_summary">Allow mock locations</string>
- <!-- Setting Checkbox title whether to enable view attribute inspection -->
- <string name="debug_view_attributes">Enable view attribute inspection</string>
- <!-- Title of warning dialog about the implications of enabling USB debugging -->
- <!-- Setting Checkbox summary whether to use DHCP client from Lollipop (Android 5.0) [CHAR LIMIT=130] -->
- <string name="legacy_dhcp_client_summary">Use the DHCP client from Lollipop instead of the new Android DHCP client.</string>
- <string name="mobile_data_always_on_summary">Always keep mobile data active, even when Wi\u2011Fi is active (for fast network switching).</string>
- <string name="adb_warning_title">Allow USB debugging?</string>
- <!-- Warning text to user about the implications of enabling USB debugging -->
- <string name="adb_warning_message">USB debugging is intended for development purposes only. Use it to copy data between your computer and your device, install apps on your device without notification, and read log data.</string>
- <!-- Message of dialog confirming that user wants to revoke access to adb from all computers they have authorized -->
- <string name="adb_keys_warning_message">Revoke access to USB debugging from all computers you\u2019ve previously authorized?</string>
- <!-- Title of warning dialog about the implications of enabling developer settings -->
- <string name="dev_settings_warning_title">Allow development settings?</string>
- <!-- Warning text to user about the implications of enabling USB debugging -->
- <string name="dev_settings_warning_message">These settings are intended for development use only. They can cause your device and the applications on it to break or misbehave.</string>
- <!-- Title of checkbox setting to perform package verification on apps installed over USB/ADT/ADB [CHAR LIMIT=32] -->
- <string name="verify_apps_over_usb_title">Verify apps over USB</string>
- <!-- Summary of checkbox setting to perform package verification on apps installed over USB/ADT/ADB [CHAR LIMIT=NONE] -->
- <string name="verify_apps_over_usb_summary">Check apps installed via ADB/ADT for harmful behavior.</string>
-
- <!-- Title of checkbox setting that protects external storage. [CHAR LIMIT=32] -->
- <string name="enforce_read_external_title" product="nosdcard">Protect USB storage</string>
- <!-- Summary of checkbox setting that protects external storage. [CHAR LIMIT=64] -->
- <string name="enforce_read_external_summary" product="nosdcard">Apps must request permission to read USB storage</string>
- <!-- Title of dialog confirming that user wants to protect external storage. [CHAR LIMIT=32] -->
- <string name="enforce_read_external_confirm_title" product="nosdcard">Protect USB storage?</string>
- <!-- Message of dialog confirming that user wants to protect external storage. [CHAR LIMIT=NONE] -->
- <string name="enforce_read_external_confirm_message" product="nosdcard">When USB storage is protected, apps must request permission to read data from external storage.\n\nSome apps may not work until updated by their developers.</string>
-
- <!-- Title of checkbox setting that protects external storage. [CHAR LIMIT=32] -->
- <string name="enforce_read_external_title" product="default">Protect SD card</string>
- <!-- Summary of checkbox setting that protects external storage. [CHAR LIMIT=64] -->
- <string name="enforce_read_external_summary" product="default">Apps must request permission to read SD card</string>
- <!-- Title of dialog confirming that user wants to protect external storage. [CHAR LIMIT=32] -->
- <string name="enforce_read_external_confirm_title" product="default">Protect SD card?</string>
- <!-- Message of dialog confirming that user wants to protect external storage. [CHAR LIMIT=NONE] -->
- <string name="enforce_read_external_confirm_message" product="default">When SD card is protected, apps must request permission to read data from external storage.\n\nSome apps may not work until updated by their developers.</string>
-
- <!-- Title of checkbox setting that enables the terminal app. [CHAR LIMIT=32] -->
- <string name="enable_terminal_title">Local terminal</string>
- <!-- Summary of checkbox setting that enables the terminal app. [CHAR LIMIT=64] -->
- <string name="enable_terminal_summary">Enable terminal app that offers local shell access</string>
-
<!-- Title for the screen that lets the user choose a gadget to add to the home screen
(or other screens that can host gadgets). Note to translators: we're still determining
the final name for Gadgets/Widgets, so please translate both for now. -->
@@ -3826,10 +3665,6 @@
<string name="accessibility_display_inversion_preference_title">Color inversion</string>
<!-- Subtitle for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] -->
<string name="accessibility_display_inversion_preference_subtitle">(Experimental) May affect performance</string>
- <!-- Title for the accessibility preference to configure display color space correction. [CHAR LIMIT=NONE] -->
- <string name="accessibility_display_daltonizer_preference_title">Color correction</string>
- <!-- Subtitle for the accessibility preference to configure display color space correction. [CHAR LIMIT=NONE] -->
- <string name="accessibility_display_daltonizer_preference_subtitle">This feature is experimental and may affect performance.</string>
<!-- Title for accessibility preference for configuring feature that performs click action soon after mouse/trackpad pointer stops moving. [CHAR LIMIT=NONE] -->
<string name="accessibility_autoclick_preference_title">Click after pointer stops moving</string>
<!-- Title for accessibility preference for configuring amount of time that has to pass after pointer stops moving before click action can be performed (if automatic click after pointer stops moving feature is enabled). [CHAR LIMIT=NONE] -->
@@ -3839,19 +3674,6 @@
<string name="enable_quick_setting">Show in Quick Settings</string>
<!-- Title for the preference to configure the type of color space correction to apply. [CHAR LIMIT=NONE] -->
<string name="daltonizer_type">Correction mode</string>
- <!-- Summary shown for color space correction preference when its value is overridden by another preference [CHAR LIMIT=35] -->
- <string name="daltonizer_type_overridden">Overridden by <xliff:g id="title" example="Simulate color space">%1$s</xliff:g></string>
-
- <!-- Label for disabling color space adjustment [CHAR LIMIT=45] -->
- <string name="daltonizer_mode_disabled">Disabled</string>
- <!-- Label for converting display colors to grayscale, which simulates monochromacy (complete color blindness). [CHAR LIMIT=45] -->
- <string name="daltonizer_mode_monochromacy">Monochromacy</string>
- <!-- Label for deuteranomaly (red-green color blindness) [CHAR LIMIT=45] -->
- <string name="daltonizer_mode_deuteranomaly">Deuteranomaly (red-green)</string>
- <!-- Label for protanomaly (red-green color blindness) [CHAR LIMIT=45] -->
- <string name="daltonizer_mode_protanomaly">Protanomaly (red-green)</string>
- <!-- Label for tritanomaly (blue-yellow color blindness) [CHAR LIMIT=45] -->
- <string name="daltonizer_mode_tritanomaly">Tritanomaly (blue-yellow)</string>
<!-- Subtitle for the accessibility preference to configure feature that performs click action soon after mouse/trackpad pointer stops moving, in case delay before click is extremely short. Placeholder will be set to the number of milliseconds to which the delay amounts. [CHAR LIMIT=NONE] -->
<plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay">
@@ -4591,20 +4413,6 @@
<!-- Default summary text of the "Configure backup account" setting [CHAR LIMIT=80]-->
<string name="backup_configure_account_default_summary">No account is currently storing backed up data</string>
- <!-- Local (desktop) backup password menu title [CHAR LIMIT=25] -->
- <string name="local_backup_password_title">Desktop backup password</string>
- <!-- Summary text of the "local backup password" setting when the user has not supplied a password -->
- <string name="local_backup_password_summary_none">Desktop full backups aren\u2019t currently protected</string>
- <!-- Summary text of the "local backup password" setting when the user has already supplied a password -->
- <string name="local_backup_password_summary_change">Touch to change or remove the password for desktop full backups</string>
-
- <!-- Toast message shown when the user successfully sets a new local backup password [CHAR LIMIT=80] -->
- <string name="local_backup_password_toast_success">New backup password set</string>
- <!-- Toast message shown when setting a new local backup password fails due to the user not correctly typing the password again for confirmation [CHAR LIMIT=80] -->
- <string name="local_backup_password_toast_confirmation_mismatch">New password and confirmation don\u2019t match</string>
- <!-- Toast message shown when setting a new local backup password fails due to the user not supplying the correct existing password. The phrasing here is deliberately quite general. [CHAR LIMIT=80] -->
- <string name="local_backup_password_toast_validation_failure">Failure setting backup password</string>
-
<!-- Dialog title for confirmation to erase backup data from server -->
<string name="backup_erase_dialog_title"></string>
<!-- Dialog title for confirmation to erase backup data from server -->
@@ -4903,168 +4711,6 @@
<!-- action to select all [CHAR LIMIT=30] -->
<string name="select_all">Select all</string>
- <!-- HDCP checking title, used for debug purposes only. [CHAR LIMIT=25] -->
- <string name="hdcp_checking_title">HDCP checking</string>
- <!-- HDCP checking dialog title, used for debug purposes only. [CHAR LIMIT=25] -->
- <string name="hdcp_checking_dialog_title">Set HDCP checking behavior</string>
-
- <!-- Preference category for app debugging development settings. [CHAR LIMIT=50] -->
- <string name="debug_debugging_category">Debugging</string>
-
- <!-- UI debug setting: select current app to debug [CHAR LIMIT=50] -->
- <string name="debug_app">Select debug app</string>
- <!-- UI debug setting: no debug app has been set [CHAR LIMIT=50] -->
- <string name="debug_app_not_set">No debug application set</string>
- <!-- UI debug setting: debug app has been set [CHAR LIMIT=50] -->
- <string name="debug_app_set">Debugging application: <xliff:g id="app_name">%1$s</xliff:g></string>
-
- <!-- UI debug setting: title for app picker dialog [CHAR LIMIT=50] -->
- <string name="select_application">Select application</string>
- <!-- UI debug setting: label for app picker to select no applicatiojn [CHAR LIMIT=50] -->
- <string name="no_application">Nothing</string>
-
- <!-- UI debug setting: wait for debugger to attach to debugging process? [CHAR LIMIT=50] -->
- <string name="wait_for_debugger">Wait for debugger</string>
- <!-- UI debug setting: wait for debugger to attach to debugging process summary [CHAR LIMIT=500] -->
- <string name="wait_for_debugger_summary">Debugged application waits for debugger to
- attach before executing</string>
-
- <!-- Preference category for input debugging development settings. [CHAR LIMIT=25] -->
- <string name="debug_input_category">Input</string>
-
- <!-- Preference category for drawing debugging development settings. [CHAR LIMIT=25] -->
- <string name="debug_drawing_category">Drawing</string>
-
- <!-- Preference category for hardware accelerated drawing debugging development settings. [CHAR LIMIT=50] -->
- <string name="debug_hw_drawing_category">Hardware accelerated rendering</string>
-
- <!-- Preference category for media development settings. [CHAR LIMIT=50] -->
- <string name="media_category">Media</string>
-
- <!-- Preference category for monitoring debugging development settings. [CHAR LIMIT=25] -->
- <string name="debug_monitoring_category">Monitoring</string>
-
- <!-- UI debug setting: always enable strict mode? [CHAR LIMIT=25] -->
- <string name="strict_mode">Strict mode enabled</string>
- <!-- UI debug setting: show strict mode summary [CHAR LIMIT=50] -->
- <string name="strict_mode_summary">Flash screen when apps do long operations
- on main thread</string>
-
- <!-- UI debug setting: show pointer location? [CHAR LIMIT=25] -->
- <string name="pointer_location">Pointer location</string>
- <!-- UI debug setting: show pointer location summary [CHAR LIMIT=50] -->
- <string name="pointer_location_summary">Screen overlay showing current touch data</string>
-
- <!-- UI debug setting: show touches? [CHAR LIMIT=25] -->
- <string name="show_touches">Show touches</string>
- <!-- UI debug setting: show touches location summary [CHAR LIMIT=50] -->
- <string name="show_touches_summary">Show visual feedback for touches</string>
-
- <!-- UI debug setting: show where surface updates happen? [CHAR LIMIT=25] -->
- <string name="show_screen_updates">Show surface updates</string>
- <!-- UI debug setting: show surface updates summary [CHAR LIMIT=50] -->
- <string name="show_screen_updates_summary">Flash entire window surfaces when they update</string>
-
- <!-- UI debug setting: show where window updates happen with GPU rendering? [CHAR LIMIT=25] -->
- <string name="show_hw_screen_updates">Show GPU view updates</string>
- <!-- UI debug setting: show GPU rendering screen updates summary [CHAR LIMIT=50] -->
- <string name="show_hw_screen_updates_summary">Flash views inside windows when drawn with the GPU</string>
-
- <!-- UI debug setting: show when hardware layers get updated [CHAR LIMIT=25] -->
- <string name="show_hw_layers_updates">Show hardware layers updates</string>
- <!-- UI debug setting: show hardware layers updates summary [CHAR LIMIT=50] -->
- <string name="show_hw_layers_updates_summary">Flash hardware layers green when they update</string>
-
- <!-- UI debug setting: show the amount of overdraw in apps using the GPU [CHAR LIMIT=25] -->
- <string name="debug_hw_overdraw">Debug GPU overdraw</string>
-
- <!-- UI debug setting: disable use of overlays? [CHAR LIMIT=25] -->
- <string name="disable_overlays">Disable HW overlays</string>
- <!-- UI debug setting: disable use of overlays summary [CHAR LIMIT=50] -->
- <string name="disable_overlays_summary">Always use GPU for screen compositing</string>
-
- <!-- UI debug setting: simulate color space anomalies. [CHAR LIMIT=25] -->
- <string name="simulate_color_space">Simulate color space</string>
-
- <!-- UI debug setting: enable various types of OpenGL traces [CHAR LIMIT=25] -->
- <string name="enable_opengl_traces_title">Enable OpenGL traces</string>
-
- <!-- UI debug setting: disable USB audio routing title [CHAR LIMIT=32] -->
- <string name="usb_audio_disable_routing">Disable USB audio routing</string>
- <!-- UI debug setting: disable USB audio routing summary [CHAR LIMIT=50] -->
- <string name="usb_audio_disable_routing_summary">Disable automatic routing to USB audio peripherals</string>
-
- <!-- UI debug setting: show layout bounds information [CHAR LIMIT=25] -->
- <string name="debug_layout">Show layout bounds</string>
- <!-- UI debug setting: show layout bounds information summary [CHAR LIMIT=50] -->
- <string name="debug_layout_summary">Show clip bounds, margins, etc.</string>
-
- <!-- UI debug setting: force right to left layout [CHAR LIMIT=37] -->
- <string name="force_rtl_layout_all_locales">Force RTL layout direction</string>
- <!-- UI debug setting: force right to left layout summary [CHAR LIMIT=100] -->
- <string name="force_rtl_layout_all_locales_summary">Force screen layout direction to RTL for all locales</string>
-
- <!-- UI debug setting: show how CPU is being used? [CHAR LIMIT=25] -->
- <string name="show_cpu_usage">Show CPU usage</string>
- <!-- UI debug setting: show cpu usage summary [CHAR LIMIT=50] -->
- <string name="show_cpu_usage_summary">Screen overlay showing current CPU usage</string>
-
- <!-- UI debug setting: force hardware acceleration to render apps [CHAR LIMIT=25] -->
- <string name="force_hw_ui">Force GPU rendering</string>
- <!-- UI debug setting: force hardware acceleration summary [CHAR LIMIT=50] -->
- <string name="force_hw_ui_summary">Force use of GPU for 2d drawing</string>
-
- <!-- UI debug setting: force anti-aliasing to render apps [CHAR LIMIT=25] -->
- <string name="force_msaa">Force 4x MSAA</string>
- <!-- UI debug setting: force anti-aliasing summary [CHAR LIMIT=50] -->
- <string name="force_msaa_summary">Enable 4x MSAA in OpenGL ES 2.0 apps</string>
-
- <!-- UI debug setting: show when non-rectangular clip operations are used [CHAR LIMIT=100] -->
- <string name="show_non_rect_clip">Debug non-rectangular clip operations</string>
-
- <!-- UI debug setting: profile time taken by hardware acceleration to render apps [CHAR LIMIT=25] -->
- <string name="track_frame_time">Profile GPU rendering</string>
-
- <!-- UI debug setting: scaling factor for window animations [CHAR LIMIT=25] -->
- <string name="window_animation_scale_title">Window animation scale</string>
-
- <!-- UI debug setting: scaling factor for transition animations [CHAR LIMIT=25] -->
- <string name="transition_animation_scale_title">Transition animation scale</string>
-
- <!-- UI debug setting: scaling factor for all Animator-based animations [CHAR LIMIT=25] -->
- <string name="animator_duration_scale_title">Animator duration scale</string>
-
- <!-- UI debug setting: simulate secondary display devices using overlays [CHAR LIMIT=25] -->
- <string name="overlay_display_devices_title">Simulate secondary displays</string>
-
- <!-- Preference category for application debugging development settings. [CHAR LIMIT=25] -->
- <string name="debug_applications_category">Apps</string>
-
- <!-- UI debug setting: immediately destroy activities? [CHAR LIMIT=25] -->
- <string name="immediately_destroy_activities">Don\u2019t keep activities</string>
- <!-- UI debug setting: immediately destroy activities summary [CHAR LIMIT=50] -->
- <string name="immediately_destroy_activities_summary">Destroy every activity as soon as
- the user leaves it</string>
-
- <!-- UI debug setting: limit number of running background processes [CHAR LIMIT=25] -->
- <string name="app_process_limit_title">Background process limit</string>
-
- <!-- UI debug setting: show all ANRs? [CHAR LIMIT=25] -->
- <string name="show_all_anrs">Show all ANRs</string>
- <!-- UI debug setting: show all ANRs summary [CHAR LIMIT=50] -->
- <string name="show_all_anrs_summary">Show App Not Responding dialog
- for background apps</string>
-
- <!-- UI debug setting: force allow apps on external storage [CHAR LIMIT=50] -->
- <string name="force_allow_on_external">Force allow apps on external</string>
- <!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
- <string name="force_allow_on_external_summary">Makes any app elligible to be written to external storage, regardless of manifest values</string>
-
- <!-- UI debug setting: force all activites to be resizable for multiwindow [CHAR LIMIT=50] -->
- <string name="force_resizable_activities">Force activities to be resizable</string>
- <!-- UI debug setting: force allow on external summary [CHAR LIMIT=150] -->
- <string name="force_resizable_activities_summary">Makes all activities resizable for multi-window, regardless of manifest values.</string>
-
<!-- Activity title for network data usage summary. [CHAR LIMIT=25] -->
<string name="data_usage_summary_title">Data usage</string>
<!-- Activity title for Appk data usage summary. [CHAR LIMIT=25] -->
@@ -6122,6 +5768,9 @@
<!-- [CHAR LIMIT=20] Notification settings: App notifications dialog dismiss button caption -->
<string name="app_notifications_dialog_done">Done</string>
+ <!-- [CHAR LIMIT=150] App notification settings: App notifications Importance title -->
+ <string name="app_notification_importance_title">Importance</string>
+
<!-- [CHAR LIMIT=40] Zen mode settings: Rule name option and edit dialog title -->
<string name="zen_mode_rule_name">Rule name</string>
@@ -6776,13 +6425,6 @@
usb_use_file_transfer, use_use_photo_transfer, and usb_use_MIDI -->
<string name="usb_use">Use USB for</string>
- <!-- Settings item title for inactive apps [CHAR LIMIT=35] -->
- <string name="inactive_apps_title">Inactive apps</string>
- <!-- Settings item summary for inactive app [CHAR LIMIT=100] -->
- <string name="inactive_app_inactive_summary">Inactive. Touch to toggle.</string>
- <!-- Settings item summary for active app [CHAR LIMIT=100] -->
- <string name="inactive_app_active_summary">Active. Touch to toggle.</string>
-
<!-- Title for the "context" preference to determine whether assist can access the data currently displayed on-screen [CHAR LIMIT=40] -->
<string name="assist_access_context_title">Use text from screen</string>
@@ -6862,6 +6504,12 @@
<!-- Zen mode access settings - summary for warning dialog when enabling access [CHAR LIMIT=NONE] -->
<string name="zen_access_warning_dialog_summary">The app will be able to turn on/off Do Not Disturb and make changes to related settings.</string>
+ <!-- Zen mode access settings - title for warning dialog when revoking access [CHAR LIMIT=NONE] -->
+ <string name="zen_access_revoke_warning_dialog_title">Revoke access to Do Not Disturb for <xliff:g id="app" example="Tasker">%1$s</xliff:g>?</string>
+
+ <!-- Zen mode access settings - summary for warning dialog when revoking access [CHAR LIMIT=NONE] -->
+ <string name="zen_access_revoke_warning_dialog_summary">All Do Not Disturb rules created by this app will be removed.</string>
+
<!-- Ignore battery optimizations on label [CHAR LIMIT=30] -->
<string name="ignore_optimizations_on">Don\u2019t optimize</string>
@@ -6957,26 +6605,6 @@
<!-- Description of setting that controls gesture to open camera by double tapping the power button [CHAR LIMIT=NONE] -->
<string name="camera_double_tap_power_gesture_desc">Quickly open camera without unlocking your screen</string>
- <!-- Name of each color mode for the display. [CHAR LIMIT=40] -->
- <string-array name="color_mode_names">
- <item>Vibrant (default)</item>
- <item>Natural</item>
- <item>Standard</item>
- </string-array>
-
- <!-- Description of each color mode for the display. [CHAR LIMIT=NONE] -->
- <string-array name="color_mode_descriptions">
- <item>Enhanced colors</item>
- <item>Natural colors as seen by the eye</item>
- <item>Colors optimized for digital content</item>
- </string-array>
-
- <!-- Name of feature to change color setting for the display [CHAR LIMIT=60] -->
- <string name="picture_color_mode">Picture color mode</string>
-
- <!-- Description of feature to change color setting for the display [CHAR LIMIT=NONE] -->
- <string name="picture_color_mode_desc">Use sRGB</string>
-
<!-- Title of setting that controls display scale (e.g. density). [CHAR LIMIT=40] -->
<string name="force_density_preference_title">Display scale</string>
<!-- Keywords for setting that controls display scale (e.g. density). [CHAR LIMIT=NONE] -->
diff --git a/res/xml/topic_notification_settings.xml b/res/xml/topic_notification_settings.xml
index 6826070..174c273 100644
--- a/res/xml/topic_notification_settings.xml
+++ b/res/xml/topic_notification_settings.xml
@@ -18,6 +18,13 @@
android:title="@string/topic_notifications_title"
android:key="topic_notification_settings">
+ <!-- Importance -->
+ <com.android.settings.notification.ImportanceSeekBarPreference
+ android:key="importance"
+ android:title="@string/app_notification_importance_title"
+ android:order="1"
+ android:persistent="false" />
+
<!-- Bypass DND -->
<SwitchPreference
android:key="bypass_dnd"
diff --git a/res/xml/wifi_advanced_settings.xml b/res/xml/wifi_advanced_settings.xml
index ed6cfbd..8d9a6cd 100644
--- a/res/xml/wifi_advanced_settings.xml
+++ b/res/xml/wifi_advanced_settings.xml
@@ -17,35 +17,6 @@
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/wifi_advanced_titlebar">
- <!-- android:dependency="enable_wifi" -->
- <SwitchPreference
- android:key="notify_open_networks"
- android:title="@string/wifi_notify_open_networks"
- android:summary="@string/wifi_notify_open_networks_summary"
- android:persistent="false" />
-
- <ListPreference
- android:key="sleep_policy"
- android:title="@string/wifi_setting_sleep_policy_title"
- android:persistent="false"
- android:entries="@array/wifi_sleep_policy_entries"
- android:entryValues="@array/wifi_sleep_policy_values" />
-
- <com.android.settings.AppListSwitchPreference
- android:key="wifi_assistant"
- android:title="@string/wifi_automatically_connect_title"
- android:summary="@string/wifi_automatically_connect_summary"
- android:dialogTitle="@string/wifi_select_assistant_dialog_title"
- android:persistent="false" />
-
- <ListPreference
- android:key="frequency_band"
- android:title="@string/wifi_setting_frequency_band_title"
- android:summary="@string/wifi_setting_frequency_band_summary"
- android:persistent="false"
- android:entries="@array/wifi_frequency_band_entries"
- android:entryValues="@array/wifi_frequency_band_values" />
-
<Preference
android:key="install_credentials"
android:title="@string/wifi_install_credentials"
@@ -66,14 +37,4 @@
android:title="@string/wifi_menu_wps_pin"
android:persistent="false" />
- <Preference
- android:key="mac_address"
- android:title="@string/wifi_advanced_mac_address_title"
- android:layout="@layout/wifi_advance_layout" />
-
- <Preference
- android:key="current_ip_address"
- android:title="@string/wifi_advanced_ip_address_title"
- android:layout="@layout/wifi_advance_layout" />
-
-</PreferenceScreen>
+</PreferenceScreen>
diff --git a/res/xml/wifi_configure_settings.xml b/res/xml/wifi_configure_settings.xml
new file mode 100644
index 0000000..15e524a
--- /dev/null
+++ b/res/xml/wifi_configure_settings.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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"
+ android:title="@string/wifi_configure_titlebar">
+
+ <Preference
+ android:key="saved_networks"
+ android:title="@string/wifi_saved_access_points_label"
+ android:fragment="com.android.settings.wifi.SavedAccessPointsWifiSettings" />
+
+ <!-- android:dependency="enable_wifi" -->
+ <SwitchPreference
+ android:key="notify_open_networks"
+ android:title="@string/wifi_notify_open_networks"
+ android:summary="@string/wifi_notify_open_networks_summary"
+ android:persistent="false" />
+
+ <ListPreference
+ android:key="sleep_policy"
+ android:title="@string/wifi_setting_sleep_policy_title"
+ android:persistent="false"
+ android:entries="@array/wifi_sleep_policy_entries"
+ android:entryValues="@array/wifi_sleep_policy_values" />
+
+ <com.android.settings.AppListSwitchPreference
+ android:key="wifi_assistant"
+ android:title="@string/wifi_automatically_connect_title"
+ android:summary="@string/wifi_automatically_connect_summary"
+ android:dialogTitle="@string/wifi_select_assistant_dialog_title"
+ android:persistent="false" />
+
+ <ListPreference
+ android:key="frequency_band"
+ android:title="@string/wifi_setting_frequency_band_title"
+ android:summary="@string/wifi_setting_frequency_band_summary"
+ android:persistent="false"
+ android:entries="@array/wifi_frequency_band_entries"
+ android:entryValues="@array/wifi_frequency_band_values" />
+
+ <Preference
+ android:key="mac_address"
+ android:title="@string/wifi_advanced_mac_address_title"
+ android:layout="@layout/wifi_advance_layout" />
+
+ <Preference
+ android:key="current_ip_address"
+ android:title="@string/wifi_advanced_ip_address_title"
+ android:layout="@layout/wifi_advance_layout" />
+
+</PreferenceScreen>
diff --git a/src/com/android/settings/DevelopmentSettings.java b/src/com/android/settings/DevelopmentSettings.java
index c25d2d3..9bccbcf 100644
--- a/src/com/android/settings/DevelopmentSettings.java
+++ b/src/com/android/settings/DevelopmentSettings.java
@@ -66,7 +66,7 @@
import android.support.v7.preference.PreferenceScreen;
import android.text.TextUtils;
import android.util.Log;
-import android.view.HardwareRenderer;
+import android.view.ThreadedRenderer;
import android.view.IWindowManager;
import android.view.LayoutInflater;
import android.view.View;
@@ -1023,7 +1023,7 @@
}
private void updateTrackFrameTimeOptions() {
- String value = SystemProperties.get(HardwareRenderer.PROFILE_PROPERTY);
+ String value = SystemProperties.get(ThreadedRenderer.PROFILE_PROPERTY);
if (value == null) {
value = "";
}
@@ -1041,7 +1041,7 @@
}
private void writeTrackFrameTimeOptions(Object newValue) {
- SystemProperties.set(HardwareRenderer.PROFILE_PROPERTY,
+ SystemProperties.set(ThreadedRenderer.PROFILE_PROPERTY,
newValue == null ? "" : newValue.toString());
pokeSystemProperties();
updateTrackFrameTimeOptions();
@@ -1049,7 +1049,7 @@
private void updateShowNonRectClipOptions() {
String value = SystemProperties.get(
- HardwareRenderer.DEBUG_SHOW_NON_RECTANGULAR_CLIP_PROPERTY);
+ ThreadedRenderer.DEBUG_SHOW_NON_RECTANGULAR_CLIP_PROPERTY);
if (value == null) {
value = "hide";
}
@@ -1067,7 +1067,7 @@
}
private void writeShowNonRectClipOptions(Object newValue) {
- SystemProperties.set(HardwareRenderer.DEBUG_SHOW_NON_RECTANGULAR_CLIP_PROPERTY,
+ SystemProperties.set(ThreadedRenderer.DEBUG_SHOW_NON_RECTANGULAR_CLIP_PROPERTY,
newValue == null ? "" : newValue.toString());
pokeSystemProperties();
updateShowNonRectClipOptions();
@@ -1075,28 +1075,28 @@
private void updateShowHwScreenUpdatesOptions() {
updateSwitchPreference(mShowHwScreenUpdates,
- SystemProperties.getBoolean(HardwareRenderer.DEBUG_DIRTY_REGIONS_PROPERTY, false));
+ SystemProperties.getBoolean(ThreadedRenderer.DEBUG_DIRTY_REGIONS_PROPERTY, false));
}
private void writeShowHwScreenUpdatesOptions() {
- SystemProperties.set(HardwareRenderer.DEBUG_DIRTY_REGIONS_PROPERTY,
+ SystemProperties.set(ThreadedRenderer.DEBUG_DIRTY_REGIONS_PROPERTY,
mShowHwScreenUpdates.isChecked() ? "true" : null);
pokeSystemProperties();
}
private void updateShowHwLayersUpdatesOptions() {
updateSwitchPreference(mShowHwLayersUpdates, SystemProperties.getBoolean(
- HardwareRenderer.DEBUG_SHOW_LAYERS_UPDATES_PROPERTY, false));
+ ThreadedRenderer.DEBUG_SHOW_LAYERS_UPDATES_PROPERTY, false));
}
private void writeShowHwLayersUpdatesOptions() {
- SystemProperties.set(HardwareRenderer.DEBUG_SHOW_LAYERS_UPDATES_PROPERTY,
+ SystemProperties.set(ThreadedRenderer.DEBUG_SHOW_LAYERS_UPDATES_PROPERTY,
mShowHwLayersUpdates.isChecked() ? "true" : null);
pokeSystemProperties();
}
private void updateDebugHwOverdrawOptions() {
- String value = SystemProperties.get(HardwareRenderer.DEBUG_OVERDRAW_PROPERTY);
+ String value = SystemProperties.get(ThreadedRenderer.DEBUG_OVERDRAW_PROPERTY);
if (value == null) {
value = "";
}
@@ -1114,7 +1114,7 @@
}
private void writeDebugHwOverdrawOptions(Object newValue) {
- SystemProperties.set(HardwareRenderer.DEBUG_OVERDRAW_PROPERTY,
+ SystemProperties.set(ThreadedRenderer.DEBUG_OVERDRAW_PROPERTY,
newValue == null ? "" : newValue.toString());
pokeSystemProperties();
updateDebugHwOverdrawOptions();
diff --git a/src/com/android/settings/InstrumentedFragment.java b/src/com/android/settings/InstrumentedFragment.java
index 80e1131..44fd110 100644
--- a/src/com/android/settings/InstrumentedFragment.java
+++ b/src/com/android/settings/InstrumentedFragment.java
@@ -31,6 +31,7 @@
public static final int ACCESSIBILITY_TOGGLE_AUTOCLICK = UNDECLARED + 1;
public static final int SOUND = UNDECLARED + 2;
public static final int CONFIGURE_NOTIFICATION = UNDECLARED + 3;
+ public static final int CONFIGURE_WIFI = UNDECLARED + 4;
/**
* Declare the view of this category.
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index 2f10bb5..7ed70c7 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -22,6 +22,7 @@
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
+import android.graphics.Typeface;
import android.net.TrafficStats;
import android.net.Uri;
import android.os.AsyncResult;
@@ -30,11 +31,24 @@
import android.os.Message;
import android.os.SystemProperties;
import android.telephony.CellInfo;
+import android.telephony.CellInfoCdma;
+import android.telephony.CellInfoGsm;
+import android.telephony.CellInfoLte;
+import android.telephony.CellInfoWcdma;
+import android.telephony.CellIdentityCdma;
+import android.telephony.CellIdentityGsm;
+import android.telephony.CellIdentityLte;
+import android.telephony.CellIdentityWcdma;
import android.telephony.CellLocation;
+import android.telephony.CellSignalStrengthCdma;
+import android.telephony.CellSignalStrengthGsm;
+import android.telephony.CellSignalStrengthLte;
+import android.telephony.CellSignalStrengthWcdma;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.NeighboringCellInfo;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
+import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaCellLocation;
import android.telephony.gsm.GsmCellLocation;
@@ -57,6 +71,7 @@
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.PhoneStateIntentReceiver;
+import com.android.internal.telephony.RILConstants;
import com.android.internal.telephony.TelephonyProperties;
import java.io.IOException;
@@ -76,7 +91,6 @@
private static final int EVENT_QUERY_PREFERRED_TYPE_DONE = 1000;
private static final int EVENT_SET_PREFERRED_TYPE_DONE = 1001;
- private static final int EVENT_QUERY_NEIGHBORING_CIDS_DONE = 1002;
private static final int EVENT_QUERY_SMSC_DONE = 1005;
private static final int EVENT_UPDATE_SMSC_DONE = 1006;
@@ -112,8 +126,8 @@
private TextView sentSinceReceived;
private TextView sent;
private TextView received;
- private TextView mPingIpAddr;
- private TextView mPingHostname;
+ private TextView mPingHostnameV4;
+ private TextView mPingHostnameV6;
private TextView mHttpClientTest;
private TextView dnsCheckState;
private EditText smsc;
@@ -127,15 +141,21 @@
private Spinner preferredNetworkType;
private TelephonyManager mTelephonyManager;
+ private ImsManager mImsManager = null;
private Phone phone = null;
private PhoneStateIntentReceiver mPhoneStateReceiver;
- private String mPingIpAddrResult;
- private String mPingHostnameResult;
+ private String mPingHostnameResultV4;
+ private String mPingHostnameResultV6;
private String mHttpClientTestResult;
private boolean mMwiValue = false;
private boolean mCfiValue = false;
- private List<CellInfo> mCellInfoValue;
+
+ private List<CellInfo> mCellInfoResult = null;
+ private CellLocation mCellLocationResult = null;
+ private List<NeighboringCellInfo> mNeighboringCellResult = null;
+
+ private int mPreferredNetworkTypeResult;
private PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
@Override
@@ -171,7 +191,8 @@
@Override
public void onCellInfoChanged(List<CellInfo> arrayCi) {
log("onCellInfoChanged: arrayCi=" + arrayCi);
- updateCellInfoTv(arrayCi);
+ mCellInfoResult = arrayCi;
+ updateCellInfo(mCellInfoResult);
}
@Override
@@ -181,7 +202,19 @@
}
};
+ private void updatePreferredNetworkType(int type) {
+ if (type >= mPreferredNetworkLabels.length || type < 0) {
+ log("EVENT_QUERY_PREFERRED_TYPE_DONE: unknown " +
+ "type=" + type);
+ type = mPreferredNetworkLabels.length - 1; //set to Unknown
+ }
+ mPreferredNetworkTypeResult = type;
+
+ preferredNetworkType.setSelection(mPreferredNetworkTypeResult, true);
+ }
+
private Handler mHandler = new Handler() {
+ @Override
public void handleMessage(Message msg) {
AsyncResult ar;
switch (msg.what) {
@@ -201,31 +234,17 @@
case EVENT_QUERY_PREFERRED_TYPE_DONE:
ar= (AsyncResult) msg.obj;
- if (ar.exception == null) {
- int type = ((int[])ar.result)[0];
- if (type >= mPreferredNetworkLabels.length) {
- log("EVENT_QUERY_PREFERRED_TYPE_DONE: unknown " +
- "type=" + type);
- type = mPreferredNetworkLabels.length - 1;
- }
- preferredNetworkType.setSelection(type, true);
+ if (ar.exception == null && ar.result != null) {
+ updatePreferredNetworkType(((int[])ar.result)[0]);
} else {
- preferredNetworkType.setSelection(mPreferredNetworkLabels.length - 1, true);
+ //In case of an exception, we will set this to unknown
+ updatePreferredNetworkType(mPreferredNetworkLabels.length-1);
}
break;
case EVENT_SET_PREFERRED_TYPE_DONE:
ar= (AsyncResult) msg.obj;
if (ar.exception != null) {
- phone.getPreferredNetworkType(
- obtainMessage(EVENT_QUERY_PREFERRED_TYPE_DONE));
- }
- break;
- case EVENT_QUERY_NEIGHBORING_CIDS_DONE:
- ar= (AsyncResult) msg.obj;
- if (ar.exception == null) {
- updateNeighboringCids((ArrayList<NeighboringCellInfo>)ar.result);
- } else {
- mNeighboringCids.setText("unknown");
+ log("Set preferred network type success.");
}
break;
case EVENT_QUERY_SMSC_DONE:
@@ -244,6 +263,7 @@
}
break;
default:
+ super.handleMessage(msg);
break;
}
@@ -256,9 +276,16 @@
setContentView(R.layout.radio_info);
+ log("Started onCreate");
+
mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
phone = PhoneFactory.getDefaultPhone();
+ //TODO: Need to update this if the default phoneId changes?
+ // Better to have an instance per phone?
+ mImsManager = ImsManager.getInstance(getApplicationContext(),
+ SubscriptionManager.getDefaultVoicePhoneId());
+
mDeviceId= (TextView) findViewById(R.id.imei);
number = (TextView) findViewById(R.id.number);
callState = (TextView) findViewById(R.id.call);
@@ -273,6 +300,7 @@
mLocation = (TextView) findViewById(R.id.location);
mNeighboringCids = (TextView) findViewById(R.id.neighboring);
mCellInfo = (TextView) findViewById(R.id.cellinfo);
+ mCellInfo.setTypeface(Typeface.MONOSPACE);
mDcRtInfoTv = (TextView) findViewById(R.id.dcrtinfo);
resets = (TextView) findViewById(R.id.resets);
@@ -284,9 +312,8 @@
received = (TextView) findViewById(R.id.received);
smsc = (EditText) findViewById(R.id.smsc);
dnsCheckState = (TextView) findViewById(R.id.dnsCheckState);
-
- mPingIpAddr = (TextView) findViewById(R.id.pingIpAddr);
- mPingHostname = (TextView) findViewById(R.id.pingHostname);
+ mPingHostnameV4 = (TextView) findViewById(R.id.pingHostnameV4);
+ mPingHostnameV6 = (TextView) findViewById(R.id.pingHostnameV6);
mHttpClientTest = (TextView) findViewById(R.id.httpClientTest);
preferredNetworkType = (Spinner) findViewById(R.id.preferredNetworkType);
@@ -337,28 +364,26 @@
mPhoneStateReceiver.notifyServiceState(EVENT_SERVICE_STATE_CHANGED);
mPhoneStateReceiver.notifyPhoneCallState(EVENT_PHONE_STATE_CHANGED);
+ mPreferredNetworkTypeResult = mPreferredNetworkLabels.length - 1; //Unknown
+
+ //FIXME: Replace with TelephonyManager call
phone.getPreferredNetworkType(
mHandler.obtainMessage(EVENT_QUERY_PREFERRED_TYPE_DONE));
- phone.getNeighboringCids(
- mHandler.obtainMessage(EVENT_QUERY_NEIGHBORING_CIDS_DONE));
- CellLocation.requestLocationUpdate();
-
- // Get current cell info
- mCellInfoValue = mTelephonyManager.getAllCellInfo();
- log("onCreate: mCellInfoValue=" + mCellInfoValue);
+ restoreFromBundle(icicle);
}
@Override
protected void onResume() {
super.onResume();
+ log("Started onResume");
+
updatePhoneState();
updateSignalStrength();
updateMessageWaiting();
updateCallRedirect();
updateServiceState();
- updateLocation(mTelephonyManager.getCellLocation());
updateDataState();
updateDataStats();
updateDataStats2();
@@ -371,7 +396,13 @@
updateProperties();
updateDnsCheckState();
- log("onResume: register phone & data intents");
+ updateNeighboringCids(mNeighboringCellResult);
+ updateLocation(mCellLocationResult);
+ updateCellInfo(mCellInfoResult);
+
+ mPingHostnameV4.setText(mPingHostnameResultV4);
+ mPingHostnameV6.setText(mPingHostnameResultV6);
+ mHttpClientTest.setText(mHttpClientTestResult);
mPhoneStateReceiver.registerIntent();
mTelephonyManager.listen(mPhoneStateListener,
@@ -385,7 +416,7 @@
}
@Override
- public void onPause() {
+ protected void onPause() {
super.onPause();
log("onPause: unregister phone & data intents");
@@ -394,6 +425,30 @@
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
}
+ private void restoreFromBundle(Bundle b) {
+ if( b == null) {
+ return;
+ }
+
+ mPingHostnameResultV4 = b.getString("mPingHostnameResultV4","");
+ mPingHostnameResultV6 = b.getString("mPingHostnameResultV6","");
+ mHttpClientTestResult = b.getString("mHttpClientTestResult","");
+
+ mPingHostnameV4.setText(mPingHostnameResultV4);
+ mPingHostnameV6.setText(mPingHostnameResultV6);
+ mHttpClientTest.setText(mHttpClientTestResult);
+
+ mPreferredNetworkTypeResult = b.getInt("mPreferredNetworkTypeResult", 0);
+ }
+
+ @Override
+ protected void onSaveInstanceState(Bundle outState) {
+ outState.putString("mPingHostnameResultV4", mPingHostnameResultV4);
+ outState.putString("mPingHostnameResultV6", mPingHostnameResultV6);
+ outState.putString("mHttpClientTestResult", mHttpClientTestResult);
+ outState.putInt("mPreferredNetworkTypeResult", mPreferredNetworkTypeResult);
+ }
+
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, MENU_ITEM_SELECT_BAND, 0, R.string.radio_info_band_mode_label)
@@ -436,6 +491,7 @@
}
private boolean isRadioOn() {
+ //FIXME: Replace with a TelephonyManager call
return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
}
@@ -447,11 +503,24 @@
}
private void updateCellInfoListRate() {
- cellInfoListRateButton.setText("CellInfoListRate " + mCellInfoListRateHandler.getRate());
- updateCellInfoTv(mTelephonyManager.getAllCellInfo());
+ int rate = mCellInfoListRateHandler.getRate();
+ String rateStr;
+ switch(rate) {
+ case Integer.MAX_VALUE:
+ rateStr = "Off";
+ break;
+ case 0:
+ rateStr = "Immediate";
+ break;
+ default:
+ rateStr = (new Integer(rate)).toString() + "ms";
+ break;
+ }
+ cellInfoListRateButton.setText("CellInfoListRate "+ rateStr);
}
private void updateDnsCheckState() {
+ //FIXME: Replace with a TelephonyManager call
dnsCheckState.setText(phone.isDnsCheckDisabled() ?
"0.0.0.0 allowed" :"0.0.0.0 not allowed");
}
@@ -521,7 +590,7 @@
}
- private final void updateNeighboringCids(ArrayList<NeighboringCellInfo> cids) {
+ private final void updateNeighboringCids(List<NeighboringCellInfo> cids) {
StringBuilder sb = new StringBuilder();
if (cids != null) {
@@ -538,22 +607,128 @@
mNeighboringCids.setText(sb.toString());
}
- private final void updateCellInfoTv(List<CellInfo> arrayCi) {
- mCellInfoValue = arrayCi;
- StringBuilder value = new StringBuilder();
- if (mCellInfoValue != null) {
- int index = 0;
- for (CellInfo ci : mCellInfoValue) {
- value.append('[');
- value.append(index);
- value.append("]=");
- value.append(ci.toString());
- if (++index < mCellInfoValue.size()) {
- value.append("\n");
+ private final String getCellInfoDisplayString(int i) {
+ return (i != Integer.MAX_VALUE) ? Integer.toString(i) : "";
+ }
+
+ private final String getCellInfoDisplayString(long i) {
+ return (i != Long.MAX_VALUE) ? Long.toString(i) : "";
+ }
+
+ private final String buildCdmaInfoString(CellInfoCdma ci) {
+ CellIdentityCdma cidCdma = ci.getCellIdentity();
+ CellSignalStrengthCdma ssCdma = ci.getCellSignalStrength();
+
+ return String.format("%-3.3s %-5.5s %-5.5s %-5.5s %-6.6s %-6.6s %-6.6s %-6.6s %-5.5s",
+ ci.isRegistered() ? "S " : " ",
+ getCellInfoDisplayString(cidCdma.getSystemId()),
+ getCellInfoDisplayString(cidCdma.getNetworkId()),
+ getCellInfoDisplayString(cidCdma.getBasestationId()),
+ getCellInfoDisplayString(ssCdma.getCdmaDbm()),
+ getCellInfoDisplayString(ssCdma.getCdmaEcio()),
+ getCellInfoDisplayString(ssCdma.getEvdoDbm()),
+ getCellInfoDisplayString(ssCdma.getEvdoEcio()),
+ getCellInfoDisplayString(ssCdma.getEvdoSnr()));
+ }
+
+ private final String buildGsmInfoString(CellInfoGsm ci) {
+ CellIdentityGsm cidGsm = ci.getCellIdentity();
+ CellSignalStrengthGsm ssGsm = ci.getCellSignalStrength();
+
+ return String.format("%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-4.4s %-4.4s\n",
+ ci.isRegistered() ? "S " : " ",
+ getCellInfoDisplayString(cidGsm.getMcc()),
+ getCellInfoDisplayString(cidGsm.getMnc()),
+ getCellInfoDisplayString(cidGsm.getLac()),
+ getCellInfoDisplayString(cidGsm.getCid()),
+ // TODO: Add BSIC support once integrated
+ // getCellInfoDisplayString(cidGsm.getBsic()),
+ " ",
+ getCellInfoDisplayString(ssGsm.getDbm()));
+ }
+
+ private final String buildLteInfoString(CellInfoLte ci) {
+ CellIdentityLte cidLte = ci.getCellIdentity();
+ CellSignalStrengthLte ssLte = ci.getCellSignalStrength();
+
+ return String.format(
+ "%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-4.4s %-4.4s %-2.2s\n",
+ ci.isRegistered() ? "S " : " ",
+ getCellInfoDisplayString(cidLte.getMcc()),
+ getCellInfoDisplayString(cidLte.getMnc()),
+ getCellInfoDisplayString(cidLte.getTac()),
+ getCellInfoDisplayString(cidLte.getCi()),
+ getCellInfoDisplayString(cidLte.getPci()),
+ getCellInfoDisplayString(ssLte.getDbm()),
+ getCellInfoDisplayString(ssLte.getRsrq()),
+ getCellInfoDisplayString(ssLte.getTimingAdvance()));
+ }
+
+ private final String buildWcdmaInfoString(CellInfoWcdma ci) {
+ CellIdentityWcdma cidWcdma = ci.getCellIdentity();
+ CellSignalStrengthWcdma ssWcdma = ci.getCellSignalStrength();
+
+ return String.format("%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-5.5s %-4.4s\n",
+ ci.isRegistered() ? "S " : " ",
+ getCellInfoDisplayString(cidWcdma.getMcc()),
+ getCellInfoDisplayString(cidWcdma.getMnc()),
+ getCellInfoDisplayString(cidWcdma.getLac()),
+ getCellInfoDisplayString(cidWcdma.getCid()),
+ getCellInfoDisplayString(cidWcdma.getPsc()),
+ getCellInfoDisplayString(ssWcdma.getDbm()));
+ }
+
+ private final String buildCellInfoString(List<CellInfo> arrayCi) {
+ String value = new String();
+ StringBuilder cdmaCells = new StringBuilder(),
+ gsmCells = new StringBuilder(),
+ lteCells = new StringBuilder(),
+ wcdmaCells = new StringBuilder();
+
+ if (arrayCi != null) {
+ for (CellInfo ci : arrayCi) {
+
+ if (ci instanceof CellInfoLte) {
+ lteCells.append(buildLteInfoString((CellInfoLte) ci));
+ } else if (ci instanceof CellInfoWcdma) {
+ wcdmaCells.append(buildWcdmaInfoString((CellInfoWcdma) ci));
+ } else if (ci instanceof CellInfoGsm) {
+ gsmCells.append(buildGsmInfoString((CellInfoGsm) ci));
+ } else if (ci instanceof CellInfoCdma) {
+ cdmaCells.append(buildCdmaInfoString((CellInfoCdma) ci));
}
}
+ if (lteCells.length() != 0) {
+ value += String.format(
+ "LTE\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-4.4s %-4.4s %-2.2s\n",
+ "SRV", "MCC", "MNC", "TAC", "CID", "PCI", "RSRP", "RSRQ", "TA");
+ value += lteCells.toString();
+ }
+ if (wcdmaCells.length() != 0) {
+ value += String.format("WCDMA\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-5.5s %-4.4s\n",
+ "SRV", "MCC", "MNC", "LAC", "CID", "PSC", "RSCP");
+ value += wcdmaCells.toString();
+ }
+ if (gsmCells.length() != 0) {
+ value += String.format("GSM\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-4.4s %-4.4s\n",
+ "SRV", "MCC", "MNC", "LAC", "CID", "BSIC", "RSSI");
+ value += gsmCells.toString();
+ }
+ if (cdmaCells.length() != 0) {
+ value += String.format(
+ "CDMA/EVDO\n%-3.3s %-5.5s %-5.5s %-5.5s %-6.6s %-6.6s %-6.6s %-6.6s %-5.5s\n",
+ "SRV", "SID", "NID", "BSID", "C-RSSI", "C-ECIO", "E-RSSI", "E-ECIO", "E-SNR");
+ value += cdmaCells.toString();
+ }
+ } else {
+ value ="unknown";
}
- mCellInfo.setText(value.toString());
+
+ return value.toString();
+ }
+
+ private final void updateCellInfo(List<CellInfo> arrayCi) {
+ mCellInfo.setText(buildCellInfoString(arrayCi));
}
private final void updateDcRtInfoTv(DataConnectionRealTimeInfo dcRtInfo) {
@@ -664,7 +839,7 @@
if (s == null) s = r.getString(R.string.radioInfo_unknown);
mDeviceId.setText(s);
-
+ //FIXME: Replace with a TelephonyManager call
s = phone.getLine1Number();
if (s == null) s = r.getString(R.string.radioInfo_unknown);
number.setText(s);
@@ -705,45 +880,34 @@
}
/**
- * Ping a IP address.
- */
- private final void pingIpAddr() {
- try {
- // This is hardcoded IP addr. This is for testing purposes.
- // We would need to get rid of this before release.
- String ipAddress = "74.125.47.104";
- Process p = Runtime.getRuntime().exec("ping -c 1 " + ipAddress);
- int status = p.waitFor();
- if (status == 0) {
- mPingIpAddrResult = "Pass";
- } else {
- mPingIpAddrResult = "Fail: IP addr not reachable";
- }
- } catch (IOException e) {
- mPingIpAddrResult = "Fail: IOException";
- } catch (InterruptedException e) {
- mPingIpAddrResult = "Fail: InterruptedException";
- }
- }
-
- /**
* Ping a host name
*/
private final void pingHostname() {
try {
- Process p = Runtime.getRuntime().exec("ping -c 1 www.google.com");
- int status = p.waitFor();
- if (status == 0) {
- mPingHostnameResult = "Pass";
- } else {
- mPingHostnameResult = "Fail: Host unreachable";
+ try {
+ Process p4 = Runtime.getRuntime().exec("ping -c 1 www.google.com");
+ int status4 = p4.waitFor();
+ if (status4 == 0) {
+ mPingHostnameResultV4 = "Pass";
+ } else {
+ mPingHostnameResultV4 = String.format("Fail(%d)", status4);
+ }
+ } catch (IOException e) {
+ mPingHostnameResultV4 = "Fail: IOException";
}
- } catch (UnknownHostException e) {
- mPingHostnameResult = "Fail: Unknown Host";
- } catch (IOException e) {
- mPingHostnameResult= "Fail: IOException";
+ try {
+ Process p6 = Runtime.getRuntime().exec("ping6 -c 1 www.google.com");
+ int status6 = p6.waitFor();
+ if (status6 == 0) {
+ mPingHostnameResultV6 = "Pass";
+ } else {
+ mPingHostnameResultV6 = String.format("Fail(%d)", status6);
+ }
+ } catch (IOException e) {
+ mPingHostnameResultV6 = "Fail: IOException";
+ }
} catch (InterruptedException e) {
- mPingHostnameResult = "Fail: InterruptedException";
+ mPingHostnameResultV4 = mPingHostnameResultV6 = "Fail: InterruptedException";
}
}
@@ -771,41 +935,60 @@
}
private void refreshSmsc() {
+ //FIXME: Replace with a TelephonyManager call
phone.getSmscAddress(mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE));
}
+ private final void updateAllCellInfo() {
+
+ mCellInfo.setText("");
+ mNeighboringCids.setText("");
+ mLocation.setText("");
+
+ final Runnable updateAllCellInfoResults = new Runnable() {
+ public void run() {
+ updateNeighboringCids(mNeighboringCellResult);
+ updateLocation(mCellLocationResult);
+ updateCellInfo(mCellInfoResult);
+ }
+ };
+
+ Thread locThread = new Thread() {
+ @Override
+ public void run() {
+ mCellInfoResult = mTelephonyManager.getAllCellInfo();
+ mCellLocationResult = mTelephonyManager.getCellLocation();
+ mNeighboringCellResult = mTelephonyManager.getNeighboringCellInfo();
+
+ mHandler.post(updateAllCellInfoResults);
+ }
+ };
+ locThread.start();
+ }
+
private final void updatePingState() {
- final Handler handler = new Handler();
// Set all to unknown since the threads will take a few secs to update.
- mPingIpAddrResult = getResources().getString(R.string.radioInfo_unknown);
- mPingHostnameResult = getResources().getString(R.string.radioInfo_unknown);
+ mPingHostnameResultV4 = getResources().getString(R.string.radioInfo_unknown);
+ mPingHostnameResultV6 = getResources().getString(R.string.radioInfo_unknown);
mHttpClientTestResult = getResources().getString(R.string.radioInfo_unknown);
- mPingIpAddr.setText(mPingIpAddrResult);
- mPingHostname.setText(mPingHostnameResult);
+ mPingHostnameV4.setText(mPingHostnameResultV4);
+ mPingHostnameV6.setText(mPingHostnameResultV6);
mHttpClientTest.setText(mHttpClientTestResult);
final Runnable updatePingResults = new Runnable() {
public void run() {
- mPingIpAddr.setText(mPingIpAddrResult);
- mPingHostname.setText(mPingHostnameResult);
+ mPingHostnameV4.setText(mPingHostnameResultV4);
+ mPingHostnameV6.setText(mPingHostnameResultV6);
mHttpClientTest.setText(mHttpClientTestResult);
}
};
- Thread ipAddr = new Thread() {
- @Override
- public void run() {
- pingIpAddr();
- handler.post(updatePingResults);
- }
- };
- ipAddr.start();
Thread hostname = new Thread() {
@Override
public void run() {
pingHostname();
- handler.post(updatePingResults);
+ mHandler.post(updatePingResults);
}
};
hostname.start();
@@ -814,7 +997,7 @@
@Override
public void run() {
httpClientTest();
- handler.post(updatePingResults);
+ mHandler.post(updatePingResults);
}
};
httpClient.start();
@@ -910,6 +1093,7 @@
private MenuItem.OnMenuItemClickListener mGetPdpList = new MenuItem.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
+ //FIXME: Replace with a TelephonyManager call
phone.getDataCallList(null);
return true;
}
@@ -929,9 +1113,11 @@
int state = mTelephonyManager.getDataState();
switch (state) {
case TelephonyManager.DATA_CONNECTED:
+ //FIXME: Replace with a TelephonyManager call
phone.setDataEnabled(false);
break;
case TelephonyManager.DATA_DISCONNECTED:
+ //FIXME: Replace with a TelephonyManager call
phone.setDataEnabled(true);
break;
default:
@@ -945,12 +1131,13 @@
OnClickListener mPowerButtonHandler = new OnClickListener() {
public void onClick(View v) {
//log("toggle radio power: currently " + (isRadioOn()?"on":"off"));
+ //FIXME: Replace with a TelephonyManager call
phone.setRadioPower(!isRadioOn());
}
};
class CellInfoListRateHandler implements OnClickListener {
- int rates[] = {Integer.MAX_VALUE, 0, 1000};
+ int rates[] = {Integer.MAX_VALUE, 0, 5000};
int index = 0;
public int getRate() {
@@ -960,11 +1147,13 @@
@Override
public void onClick(View v) {
index += 1;
- if (index >= rates.length) {
- index = 0;
- }
+ index %= rates.length;
+
+ // FIXME: Replace with a TelephonyManager call
phone.setCellInfoListRate(rates[index]);
updateCellInfoListRate();
+
+ updateAllCellInfo();
}
}
CellInfoListRateHandler mCellInfoListRateHandler = new CellInfoListRateHandler();
@@ -1020,12 +1209,12 @@
(isImsVoLteProvisioned() ? "on":"off")));
final boolean newValue = !isImsVoLteProvisioned();
if (phone != null) {
- final ImsManager imsManager = ImsManager.getInstance(phone.getContext(), phone.getSubId());
- if (imsManager != null) {
+ //TODO: Why does this have to be called within the phone's context?
+ if (mImsManager != null) {
QueuedWork.singleThreadExecutor().submit(new Runnable() {
public void run() {
try {
- imsManager.getConfigInterface().setProvisionedValue(
+ mImsManager.getConfigInterface().setProvisionedValue(
ImsConfig.ConfigConstants.VLT_SETTING_ENABLED,
newValue? 1 : 0);
} catch (ImsException e) {
@@ -1041,8 +1230,10 @@
private boolean isImsVoLteProvisioned() {
if (phone != null) {
- ImsManager imsManager = ImsManager.getInstance(phone.getContext(), phone.getSubId());
- return imsManager.isVolteProvisionedOnDevice(phone.getContext());
+ //TODO: Why does this have to be called within the phone's context?
+ if(mImsManager != null ) {
+ return mImsManager.isVolteProvisionedOnDevice(phone.getContext());
+ }
}
return false;
}
@@ -1090,6 +1281,7 @@
OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
public void onClick(View v) {
+ //FIXME: Replace with a TelephonyManager call
phone.disableDnsCheck(!phone.isDnsCheckDisabled());
updateDnsCheckState();
}
@@ -1128,12 +1320,15 @@
}
};
- AdapterView.OnItemSelectedListener
- mPreferredNetworkHandler = new AdapterView.OnItemSelectedListener() {
+ AdapterView.OnItemSelectedListener mPreferredNetworkHandler =
+ new AdapterView.OnItemSelectedListener() {
+
public void onItemSelected(AdapterView parent, View v, int pos, long id) {
- Message msg = mHandler.obtainMessage(EVENT_SET_PREFERRED_TYPE_DONE);
- if (pos>=0 && pos<=(mPreferredNetworkLabels.length - 2)) {
- phone.setPreferredNetworkType(pos, msg);
+ if (mPreferredNetworkTypeResult != pos && pos >= 0
+ && pos <= mPreferredNetworkLabels.length - 2) {
+ mPreferredNetworkTypeResult = pos;
+ Message msg = mHandler.obtainMessage(EVENT_SET_PREFERRED_TYPE_DONE);
+ phone.setPreferredNetworkType(mPreferredNetworkTypeResult, msg);
}
}
@@ -1149,11 +1344,21 @@
"CDMA auto (PRL)",
"CDMA only",
"EvDo only",
- "GSM/CDMA auto (PRL)",
+ "Global auto (PRL)",
"LTE/CDMA auto (PRL)",
- "LTE/GSM auto (PRL)",
- "LTE/GSM/CDMA auto (PRL)",
+ "LTE/UMTS auto (PRL)",
+ "LTE/CDMA/UMTS auto (PRL)",
"LTE only",
+ "LTE/WCDMA",
+ "TD-SCDMA only",
+ "TD-SCDMA/WCDMA",
+ "LTE/TD-SCDMA",
+ "TD-SCDMA/GSM",
+ "TD-SCDMA/UMTS",
+ "LTE/TD-SCDMA/WCDMA",
+ "LTE/TD-SCDMA/UMTS",
+ "TD-SCDMA/CDMA/UMTS",
+ "Global/TD-SCDMA",
"Unknown"};
private void log(String s) {
diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java
index 9050448..4615a99 100644
--- a/src/com/android/settings/ResetNetworkConfirm.java
+++ b/src/com/android/settings/ResetNetworkConfirm.java
@@ -31,6 +31,7 @@
import android.widget.Button;
import android.widget.Toast;
+import com.android.ims.ImsManager;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.telephony.PhoneConstants;
@@ -94,6 +95,8 @@
btManager.getAdapter().factoryReset();
}
+ ImsManager.factoryReset(context);
+
Toast.makeText(context, R.string.reset_network_complete_toast, Toast.LENGTH_SHORT)
.show();
}
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 809a740..f98d2a6 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -32,6 +32,7 @@
import android.content.pm.ResolveInfo;
import android.content.res.Configuration;
import android.nfc.NfcAdapter;
+import android.os.AsyncTask;
import android.os.Bundle;
import android.os.UserHandle;
import android.os.UserManager;
@@ -453,6 +454,7 @@
@Override
protected void onCreate(Bundle savedState) {
super.onCreate(savedState);
+ long startTime = System.currentTimeMillis();
// Should happen before any call to getIntent()
getMetaData();
@@ -506,7 +508,15 @@
if (mIsShowingDashboard) {
// Run the Index update only if we have some space
if (!Utils.isLowStorage(this)) {
- Index.getInstance(getApplicationContext()).update();
+ long indexStartTime = System.currentTimeMillis();
+ AsyncTask.execute(new Runnable() {
+ @Override
+ public void run() {
+ Index.getInstance(getApplicationContext()).update();
+ }
+ });
+ if (DEBUG_TIMING) Log.d(LOG_TAG, "Index.update() took "
+ + (System.currentTimeMillis() - indexStartTime) + " ms");
} else {
Log.w(LOG_TAG, "Cannot update the Indexer as we are running low on storage space!");
}
@@ -621,6 +631,8 @@
}
mHomeActivitiesCount = getHomeActivitiesCount();
+ if (DEBUG_TIMING) Log.d(LOG_TAG, "onCreate took " + (System.currentTimeMillis() - startTime)
+ + " ms");
}
private int getHomeActivitiesCount() {
@@ -725,9 +737,6 @@
@Override
protected void onResume() {
super.onResume();
- if (mIsShowingDashboard) {
- MetricsLogger.visible(this, MetricsLogger.MAIN_SETTINGS);
- }
mDevelopmentPreferencesListener = new SharedPreferences.OnSharedPreferenceChangeListener() {
@Override
@@ -751,9 +760,6 @@
@Override
protected void onPause() {
super.onPause();
- if (mIsShowingDashboard) {
- MetricsLogger.hidden(this, MetricsLogger.MAIN_SETTINGS);
- }
unregisterReceiver(mBatteryInfoReceiver);
mDynamicIndexableContentMonitor.unregister();
}
@@ -955,6 +961,18 @@
}
private void updateTilesList() {
+ // Generally the items that are will be changing from these updates will
+ // not be in the top list of tiles, so run it in the background and the
+ // SettingsDrawerActivity will pick up on the updates automatically.
+ AsyncTask.execute(new Runnable() {
+ @Override
+ public void run() {
+ doUpdateTilesList();
+ }
+ });
+ }
+
+ private void doUpdateTilesList() {
PackageManager pm = getPackageManager();
final UserManager um = UserManager.get(this);
final boolean isAdmin = um.isAdminUser();
@@ -1009,7 +1027,7 @@
if (UserHandle.MU_ENABLED && !isAdmin) {
// When on restricted users, disable all extra categories (but only the settings ones).
- List<DashboardCategory> categories = getDashboardCategories(true);
+ List<DashboardCategory> categories = getDashboardCategories();
for (DashboardCategory category : categories) {
for (DashboardTile tile : category.tiles) {
ComponentName component = tile.intent.getComponent();
@@ -1020,8 +1038,6 @@
}
}
}
-
- updateDrawer();
}
private void setTileEnabled(ComponentName component, boolean enabled, boolean isAdmin,
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java
index 55a2c32..27ab6a2 100644
--- a/src/com/android/settings/WirelessSettings.java
+++ b/src/com/android/settings/WirelessSettings.java
@@ -68,7 +68,6 @@
private static final String KEY_PROXY_SETTINGS = "proxy_settings";
private static final String KEY_MOBILE_NETWORK_SETTINGS = "mobile_network_settings";
private static final String KEY_MANAGE_MOBILE_PLAN = "manage_mobile_plan";
- private static final String KEY_CELL_BROADCAST_SETTINGS = "cell_broadcast_settings";
private static final String KEY_WFC_SETTINGS = "wifi_calling_settings";
public static final String EXIT_ECM_RESULT = "exit_ecm_result";
@@ -327,26 +326,6 @@
p.setEnabled(!TetherSettings
.isProvisioningNeededButUnavailable(getActivity()));
}
-
- // Enable link to CMAS app settings depending on the value in config.xml.
- boolean isCellBroadcastAppLinkEnabled = this.getResources().getBoolean(
- com.android.internal.R.bool.config_cellBroadcastAppLinks);
- try {
- if (isCellBroadcastAppLinkEnabled) {
- if (mPm.getApplicationEnabledSetting("com.android.cellbroadcastreceiver")
- == PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
- isCellBroadcastAppLinkEnabled = false; // CMAS app disabled
- }
- }
- } catch (IllegalArgumentException ignored) {
- isCellBroadcastAppLinkEnabled = false; // CMAS app not installed
- }
- if (!isAdmin || !isCellBroadcastAppLinkEnabled
- || mUm.hasUserRestriction(UserManager.DISALLOW_CONFIG_CELL_BROADCASTS)) {
- PreferenceScreen root = getPreferenceScreen();
- Preference ps = findPreference(KEY_CELL_BROADCAST_SETTINGS);
- if (ps != null) root.removePreference(ps);
- }
}
@Override
@@ -478,23 +457,6 @@
result.add(KEY_TETHER_SETTINGS);
}
- // Enable link to CMAS app settings depending on the value in config.xml.
- boolean isCellBroadcastAppLinkEnabled = context.getResources().getBoolean(
- com.android.internal.R.bool.config_cellBroadcastAppLinks);
- try {
- if (isCellBroadcastAppLinkEnabled) {
- if (pm.getApplicationEnabledSetting("com.android.cellbroadcastreceiver")
- == PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
- isCellBroadcastAppLinkEnabled = false; // CMAS app disabled
- }
- }
- } catch (IllegalArgumentException ignored) {
- isCellBroadcastAppLinkEnabled = false; // CMAS app not installed
- }
- if (isSecondaryUser || !isCellBroadcastAppLinkEnabled) {
- result.add(KEY_CELL_BROADCAST_SETTINGS);
- }
-
return result;
}
};
diff --git a/src/com/android/settings/dashboard/DashboardSummary.java b/src/com/android/settings/dashboard/DashboardSummary.java
index 54a5ff4..64eb356 100644
--- a/src/com/android/settings/dashboard/DashboardSummary.java
+++ b/src/com/android/settings/dashboard/DashboardSummary.java
@@ -16,13 +16,7 @@
package com.android.settings.dashboard;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
@@ -38,11 +32,14 @@
import com.android.settings.Settings;
import com.android.settings.SettingsActivity;
import com.android.settingslib.drawer.DashboardCategory;
+import com.android.settingslib.drawer.SettingsDrawerActivity;
import java.util.List;
-public class DashboardSummary extends InstrumentedFragment {
- public static final boolean DEBUG = true;
+public class DashboardSummary extends InstrumentedFragment
+ implements SettingsDrawerActivity.CategoryListener {
+ public static final boolean DEBUG = false;
+ private static final boolean DEBUG_TIMING = false;
private static final String TAG = "DashboardSummary";
public static final String[] INITIAL_ITEMS = new String[] {
@@ -56,8 +53,6 @@
private static final int MSG_REBUILD_UI = 1;
- private final HomePackageReceiver mHomePackageReceiver = new HomePackageReceiver();
-
private RecyclerView mDashboard;
private DashboardAdapter mAdapter;
private SummaryLoader mSummaryLoader;
@@ -71,11 +66,19 @@
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ long startTime = System.currentTimeMillis();
List<DashboardCategory> categories =
- ((SettingsActivity) getActivity()).getDashboardCategories(true);
- mAdapter = new DashboardAdapter(getContext(), categories);
- mSummaryLoader = new SummaryLoader(getActivity(), mAdapter, categories);
+ ((SettingsActivity) getActivity()).getDashboardCategories();
+ mSummaryLoader = new SummaryLoader(getActivity(), categories);
setHasOptionsMenu(true);
+ if (DEBUG_TIMING) Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime)
+ + " ms");
+ }
+
+ @Override
+ public void onDestroy() {
+ mSummaryLoader.release();
+ super.onDestroy();
}
@Override
@@ -90,14 +93,7 @@
public void onResume() {
super.onResume();
- sendRebuildUI();
-
- final IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
- filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
- filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
- filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
- filter.addDataScheme("package");
- getActivity().registerReceiver(mHomePackageReceiver, filter);
+ ((SettingsDrawerActivity) getActivity()).addCategoryListener(this);
mSummaryLoader.setListening(true);
}
@@ -105,7 +101,7 @@
public void onPause() {
super.onPause();
- getActivity().unregisterReceiver(mHomePackageReceiver);
+ ((SettingsDrawerActivity) getActivity()).remCategoryListener(this);
mSummaryLoader.setListening(false);
}
@@ -123,10 +119,10 @@
mDashboard.setLayoutManager(llm);
mDashboard.setHasFixedSize(true);
- rebuildUI(getContext());
+ rebuildUI();
}
- private void rebuildUI(Context context) {
+ private void rebuildUI() {
if (!isAdded()) {
Log.w(TAG, "Cannot build the DashboardSummary UI yet as the Fragment is not added");
return;
@@ -135,7 +131,7 @@
long start = System.currentTimeMillis();
// TODO: Cache summaries from old categories somehow.
List<DashboardCategory> categories =
- ((SettingsActivity) getActivity()).getDashboardCategories(true);
+ ((SettingsActivity) getActivity()).getDashboardCategories();
boolean showingAll = mAdapter != null && mAdapter.isShowingAll();
mAdapter = new DashboardAdapter(getContext(), categories);
mSummaryLoader.setAdapter(mAdapter);
@@ -146,29 +142,8 @@
Log.d(TAG, "rebuildUI took: " + delta + " ms");
}
- private void sendRebuildUI() {
- if (!mHandler.hasMessages(MSG_REBUILD_UI)) {
- mHandler.sendEmptyMessage(MSG_REBUILD_UI);
- }
+ @Override
+ public void onCategoriesChanged() {
+ rebuildUI();
}
-
- private Handler mHandler = new Handler() {
- @Override
- public void handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_REBUILD_UI: {
- final Context context = getActivity();
- rebuildUI(context);
- } break;
- }
- }
- };
-
- private class HomePackageReceiver extends BroadcastReceiver {
- @Override
- public void onReceive(Context context, Intent intent) {
- rebuildUI(context);
- }
- }
-
}
diff --git a/src/com/android/settings/dashboard/SummaryLoader.java b/src/com/android/settings/dashboard/SummaryLoader.java
index a5481ac..a9dd43a 100644
--- a/src/com/android/settings/dashboard/SummaryLoader.java
+++ b/src/com/android/settings/dashboard/SummaryLoader.java
@@ -16,9 +16,11 @@
package com.android.settings.dashboard;
import android.app.Activity;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageManager;
import android.os.Bundle;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Looper;
+import android.os.Message;
import android.util.ArrayMap;
import android.util.Log;
import com.android.settings.SettingsActivity;
@@ -39,38 +41,48 @@
private final ArrayMap<SummaryProvider, DashboardTile> mSummaryMap = new ArrayMap<>();
private final List<DashboardTile> mTiles = new ArrayList<>();
+ private final Worker mWorker;
+ private final Handler mHandler;
+ private final HandlerThread mWorkerThread;
+
private DashboardAdapter mAdapter;
- public SummaryLoader(Activity activity, DashboardAdapter adapter,
- List<DashboardCategory> categories) {
+ public SummaryLoader(Activity activity, List<DashboardCategory> categories) {
+ mHandler = new Handler();
+ mWorkerThread = new HandlerThread("SummaryLoader");
+ mWorkerThread.start();
+ mWorker = new Worker(mWorkerThread.getLooper());
mActivity = activity;
- mAdapter = adapter;
for (int i = 0; i < categories.size(); i++) {
List<DashboardTile> tiles = categories.get(i).tiles;
for (int j = 0; j < tiles.size(); j++) {
DashboardTile tile = tiles.get(j);
- SummaryProvider provider = getSummaryProvider(tile);
- if (provider != null) {
- mSummaryMap.put(provider, tile);
- }
+ mWorker.obtainMessage(Worker.MSG_GET_PROVIDER, tile).sendToTarget();
}
}
}
+ public void release() {
+ mWorkerThread.quit();
+ }
+
public void setAdapter(DashboardAdapter adapter) {
mAdapter = adapter;
}
- public void setSummary(SummaryProvider provider, CharSequence summary) {
- DashboardTile tile = mSummaryMap.get(provider);
- tile.summary = summary;
- mAdapter.notifyChanged(tile);
+ public void setSummary(SummaryProvider provider, final CharSequence summary) {
+ final DashboardTile tile = mSummaryMap.get(provider);
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ tile.summary = summary;
+ mAdapter.notifyChanged(tile);
+ }
+ });
}
public void setListening(boolean listening) {
- for (SummaryProvider provider : mSummaryMap.keySet()) {
- provider.setListening(listening);
- }
+ mWorker.obtainMessage(Worker.MSG_SET_LISTENING, listening ? 1 : 0, 0).sendToTarget();
}
private SummaryProvider getSummaryProvider(DashboardTile tile) {
@@ -107,14 +119,7 @@
}
private Bundle getMetaData(DashboardTile tile) {
- // TODO: Cache this in TileUtils so this doesn't need to be loaded again.
- try {
- ActivityInfo activityInfo = mActivity.getPackageManager().getActivityInfo(
- tile.intent.getComponent(), PackageManager.GET_META_DATA);
- return activityInfo.metaData;
- } catch (PackageManager.NameNotFoundException e) {
- return null;
- }
+ return tile.metaData;
}
public interface SummaryProvider {
@@ -124,4 +129,34 @@
public interface SummaryProviderFactory {
SummaryProvider createSummaryProvider(Activity activity, SummaryLoader summaryLoader);
}
+
+ private class Worker extends Handler {
+ private static final int MSG_GET_PROVIDER = 1;
+ private static final int MSG_SET_LISTENING = 2;
+
+ public Worker(Looper looper) {
+ super(looper);
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_GET_PROVIDER:
+ DashboardTile tile = (DashboardTile) msg.obj;
+ SummaryProvider provider = getSummaryProvider(tile);
+ if (provider != null) {
+ if (DEBUG) Log.d(TAG, "Creating " + tile);
+ mSummaryMap.put(provider, tile);
+ }
+ break;
+ case MSG_SET_LISTENING:
+ boolean listening = msg.arg1 != 0;
+ if (DEBUG) Log.d(TAG, "Listening " + listening);
+ for (SummaryProvider p : mSummaryMap.keySet()) {
+ p.setListening(listening);
+ }
+ break;
+ }
+ }
+ }
}
diff --git a/src/com/android/settings/nfc/PaymentSettings.java b/src/com/android/settings/nfc/PaymentSettings.java
index 42545b9..985a1e6 100644
--- a/src/com/android/settings/nfc/PaymentSettings.java
+++ b/src/com/android/settings/nfc/PaymentSettings.java
@@ -115,8 +115,10 @@
PaymentBackend paymentBackend = new PaymentBackend(mContext);
paymentBackend.refresh();
PaymentAppInfo app = paymentBackend.getDefaultApp();
- mSummaryLoader.setSummary(this, mContext.getString(R.string.payment_summary,
- app.label));
+ if (app != null) {
+ mSummaryLoader.setSummary(this, mContext.getString(R.string.payment_summary,
+ app.label));
+ }
}
}
}
diff --git a/src/com/android/settings/notification/ImportanceSeekBarPreference.java b/src/com/android/settings/notification/ImportanceSeekBarPreference.java
new file mode 100644
index 0000000..fdba42c
--- /dev/null
+++ b/src/com/android/settings/notification/ImportanceSeekBarPreference.java
@@ -0,0 +1,118 @@
+/**
+ * Copyright (C) 2015 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.notification;
+
+import com.android.settings.R;
+import com.android.settings.SeekBarPreference;
+
+import android.content.Context;
+import android.service.notification.NotificationListenerService;
+import android.support.v7.preference.PreferenceViewHolder;
+import android.util.AttributeSet;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+/**
+ * A slider preference that controls notification importance.
+ **/
+public class ImportanceSeekBarPreference extends SeekBarPreference implements
+ SeekBar.OnSeekBarChangeListener {
+ private static final String TAG = "ImportanceSeekBarPref";
+
+ public static final int IMPORTANCE_PROGRESS_OFFSET = 2;
+ private Callback mCallback;
+ private TextView mSummaryTextView;
+ private String mSummary;
+
+ public ImportanceSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr,
+ int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ setLayoutResource(R.layout.preference_importance_slider);
+ }
+
+ public ImportanceSeekBarPreference(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, 0);
+ }
+
+ public ImportanceSeekBarPreference(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public ImportanceSeekBarPreference(Context context) {
+ this(context, null);
+ }
+
+ public void setCallback(Callback callback) {
+ mCallback = callback;
+ }
+
+ @Override
+ public void onBindViewHolder(PreferenceViewHolder view) {
+ super.onBindViewHolder(view);
+ mSummaryTextView = (TextView) view.findViewById(com.android.internal.R.id.summary);
+ }
+
+ @Override
+ public void setProgress(int progress) {
+ mSummary = getProgressSummary(progress);
+ super.setProgress(progress);
+ }
+
+ @Override
+ public void onProgressChanged(SeekBar seekBar, final int progress, boolean fromTouch) {
+ super.onProgressChanged(seekBar, progress, fromTouch);
+ if (mSummaryTextView != null) {
+ mSummaryTextView.setText(getProgressSummary(progress));
+ }
+ if (fromTouch) {
+ mCallback.onImportanceChanged(progress);
+ }
+ }
+
+ @Override
+ public CharSequence getSummary() {
+ return mSummary;
+ }
+
+ private String getProgressSummary(int progress) {
+ // Map progress 0-4 values to Importance's -2-2.
+ progress = progress - IMPORTANCE_PROGRESS_OFFSET;
+ switch (progress) {
+ case NotificationListenerService.Ranking.IMPORTANCE_NONE:
+ return getContext().getString(
+ com.android.internal.R.string.notification_importance_blocked);
+ case NotificationListenerService.Ranking.IMPORTANCE_LOW:
+ return getContext().getString(
+ com.android.internal.R.string.notification_importance_low);
+ case NotificationListenerService.Ranking.IMPORTANCE_DEFAULT:
+ return getContext().getString(
+ com.android.internal.R.string.notification_importance_default);
+ case NotificationListenerService.Ranking.IMPORTANCE_HIGH:
+ return getContext().getString(
+ com.android.internal.R.string.notification_importance_high);
+ case NotificationListenerService.Ranking.IMPORTANCE_MAX:
+ return getContext().getString(
+ com.android.internal.R.string.notification_importance_max);
+ default:
+ return "";
+ }
+ }
+
+ public interface Callback {
+ void onImportanceChanged(int progress);
+ }
+}
diff --git a/src/com/android/settings/notification/NotificationBackend.java b/src/com/android/settings/notification/NotificationBackend.java
index dcebf8b..4c1f6ea 100644
--- a/src/com/android/settings/notification/NotificationBackend.java
+++ b/src/com/android/settings/notification/NotificationBackend.java
@@ -62,6 +62,7 @@
row.priority = getBypassZenMode(row.pkg, row.uid, row.topic);
row.sensitive = getSensitive(row.pkg, row.uid, row.topic);
row.banned = getNotificationsBanned(row.pkg, row.uid);
+ row.importance = getImportance(row.pkg, row.uid, row.topic);
return row;
}
@@ -128,6 +129,25 @@
}
}
+ public boolean setImportance(String pkg, int uid, Notification.Topic topic, int importance) {
+ try {
+ sINM.setTopicImportance(pkg, uid, topic, importance);
+ return true;
+ } catch (Exception e) {
+ Log.w(TAG, "Error calling NoMan", e);
+ return false;
+ }
+ }
+
+ public int getImportance(String pkg, int uid, Notification.Topic topic) {
+ try {
+ return sINM.getTopicImportance(pkg, uid, topic);
+ } catch (Exception e) {
+ Log.w(TAG, "Error calling NoMan", e);
+ return NotificationListenerService.Ranking.IMPORTANCE_DEFAULT;
+ }
+ }
+
public List<Notification.Topic> getTopics(String pkg, int uid) {
try {
final ParceledListSlice<Notification.Topic> parceledList = sINM.getTopics(pkg, uid);
@@ -156,6 +176,7 @@
public Notification.Topic topic;
public boolean priority;
public boolean sensitive;
+ public int importance;
}
}
diff --git a/src/com/android/settings/notification/SoundSettings.java b/src/com/android/settings/notification/SoundSettings.java
index 9e27528..11517ea 100644
--- a/src/com/android/settings/notification/SoundSettings.java
+++ b/src/com/android/settings/notification/SoundSettings.java
@@ -76,6 +76,7 @@
private static final String KEY_VIBRATE_WHEN_RINGING = "vibrate_when_ringing";
private static final String KEY_WIFI_DISPLAY = "wifi_display";
private static final String KEY_ZEN_MODE = "zen_mode";
+ private static final String KEY_CELL_BROADCAST_SETTINGS = "cell_broadcast_settings";
private static final String[] RESTRICTED_KEYS = {
KEY_MEDIA_VOLUME,
@@ -105,6 +106,7 @@
private ComponentName mSuppressor;
private int mRingerMode = -1;
+ private PackageManager mPm;
private UserManager mUserManager;
private RingtonePreference mRequestPreference;
@@ -117,6 +119,7 @@
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = getActivity();
+ mPm = getPackageManager();
mUserManager = UserManager.get(getContext());
mVoiceCapable = Utils.isVoiceCapable(mContext);
@@ -143,6 +146,24 @@
com.android.internal.R.drawable.ic_audio_ring_notif_mute);
removePreference(KEY_RING_VOLUME);
}
+
+ // Enable link to CMAS app settings depending on the value in config.xml.
+ boolean isCellBroadcastAppLinkEnabled = this.getResources().getBoolean(
+ com.android.internal.R.bool.config_cellBroadcastAppLinks);
+ try {
+ if (isCellBroadcastAppLinkEnabled) {
+ if (mPm.getApplicationEnabledSetting("com.android.cellbroadcastreceiver")
+ == PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
+ isCellBroadcastAppLinkEnabled = false; // CMAS app disabled
+ }
+ }
+ } catch (IllegalArgumentException ignored) {
+ isCellBroadcastAppLinkEnabled = false; // CMAS app not installed
+ }
+ if (!mUserManager.isAdminUser() || !isCellBroadcastAppLinkEnabled
+ || mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CELL_BROADCASTS)) {
+ removePreference(KEY_CELL_BROADCAST_SETTINGS);
+ }
initRingtones();
initVibrateWhenRinging();
updateRingerMode();
@@ -545,7 +566,7 @@
public List<SearchIndexableResource> getXmlResourcesToIndex(
Context context, boolean enabled) {
final SearchIndexableResource sir = new SearchIndexableResource(context);
- sir.xmlResId = R.xml.configure_notification_settings;
+ sir.xmlResId = R.xml.sound_settings;
return Arrays.asList(sir);
}
@@ -559,6 +580,27 @@
rt.add(KEY_WIFI_DISPLAY);
rt.add(KEY_VIBRATE_WHEN_RINGING);
}
+
+ final PackageManager pm = context.getPackageManager();
+ final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE);
+
+ // Enable link to CMAS app settings depending on the value in config.xml.
+ boolean isCellBroadcastAppLinkEnabled = context.getResources().getBoolean(
+ com.android.internal.R.bool.config_cellBroadcastAppLinks);
+ try {
+ if (isCellBroadcastAppLinkEnabled) {
+ if (pm.getApplicationEnabledSetting("com.android.cellbroadcastreceiver")
+ == PackageManager.COMPONENT_ENABLED_STATE_DISABLED) {
+ isCellBroadcastAppLinkEnabled = false; // CMAS app disabled
+ }
+ }
+ } catch (IllegalArgumentException ignored) {
+ isCellBroadcastAppLinkEnabled = false; // CMAS app not installed
+ }
+ if (!um.isAdminUser() || !isCellBroadcastAppLinkEnabled) {
+ rt.add(KEY_CELL_BROADCAST_SETTINGS);
+ }
+
return rt;
}
};
diff --git a/src/com/android/settings/notification/TopicNotificationSettings.java b/src/com/android/settings/notification/TopicNotificationSettings.java
index 48c611e..71196b7 100644
--- a/src/com/android/settings/notification/TopicNotificationSettings.java
+++ b/src/com/android/settings/notification/TopicNotificationSettings.java
@@ -30,14 +30,13 @@
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.os.UserHandle;
import android.provider.Settings;
+import android.service.notification.NotificationListenerService;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.Preference.OnPreferenceChangeListener;
-import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
@@ -50,10 +49,12 @@
protected static final String ARG_PACKAGE_INFO = "arg_info";
private static final String KEY_BYPASS_DND = "bypass_dnd";
private static final String KEY_SENSITIVE = "sensitive";
+ private static final String KEY_IMPORTANCE = "importance";
private final NotificationBackend mBackend = new NotificationBackend();
private Context mContext;
+ private ImportanceSeekBarPreference mImportance;
private SwitchPreference mPriority;
private SwitchPreference mSensitive;
private TopicRow mTopicRow;
@@ -122,11 +123,27 @@
mIsSystemPackage = Utils.isSystemPackage(pm, info);
addPreferencesFromResource(R.xml.topic_notification_settings);
+ mImportance = (ImportanceSeekBarPreference) findPreference(KEY_IMPORTANCE);
mPriority = (SwitchPreference) findPreference(KEY_BYPASS_DND);
mSensitive = (SwitchPreference) findPreference(KEY_SENSITIVE);
mTopicRow = mBackend.loadTopicRow(pm, info.applicationInfo, topic);
+ mImportance.setMax(4);
+ // TODO: stop defaulting to 'normal' in the UI when there are mocks for this scenario.
+ int importance =
+ mTopicRow.importance == NotificationListenerService.Ranking.IMPORTANCE_UNSPECIFIED
+ ? NotificationListenerService.Ranking.IMPORTANCE_DEFAULT
+ : mTopicRow.importance;
+ mImportance.setProgress(
+ importance + ImportanceSeekBarPreference.IMPORTANCE_PROGRESS_OFFSET);
+ mImportance.setCallback(new ImportanceSeekBarPreference.Callback() {
+ @Override
+ public void onImportanceChanged(int progress) {
+ mBackend.setImportance(mTopicRow.pkg, mTopicRow.uid, mTopicRow.topic,
+ progress - ImportanceSeekBarPreference.IMPORTANCE_PROGRESS_OFFSET);
+ }
+ });
mPriority.setChecked(mTopicRow.priority);
mSensitive.setChecked(mTopicRow.sensitive);
@@ -167,6 +184,7 @@
setVisible(mPriority, mIsSystemPackage || !banned);
setVisible(mSensitive, mIsSystemPackage || !banned && lockscreenSecure
&& lockscreenNotificationsEnabled && allowPrivate);
+ setVisible(mImportance, !banned);
}
private void setVisible(Preference p, boolean visible) {
diff --git a/src/com/android/settings/notification/ZenAccessSettings.java b/src/com/android/settings/notification/ZenAccessSettings.java
index 1c85f4d..4cec0b4 100644
--- a/src/com/android/settings/notification/ZenAccessSettings.java
+++ b/src/com/android/settings/notification/ZenAccessSettings.java
@@ -119,15 +119,15 @@
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
final boolean access = (Boolean) newValue;
- if (!access) {
- // disabling access
- setAccess(mContext, pkg, access);
- return true;
+ if (access) {
+ new ScaryWarningDialogFragment()
+ .setPkgInfo(pkg, label)
+ .show(getFragmentManager(), "dialog");
+ } else {
+ new FriendlyWarningDialogFragment()
+ .setPkgInfo(pkg, label)
+ .show(getFragmentManager(), "dialog");
}
- // enabling access: show a scary dialog first
- new ScaryWarningDialogFragment()
- .setPkgInfo(pkg, label)
- .show(getFragmentManager(), "dialog");
return false;
}
});
@@ -149,6 +149,16 @@
});
}
+ private static void deleteRules(final Context context, final String pkg) {
+ AsyncTask.execute(new Runnable() {
+ @Override
+ public void run() {
+ final NotificationManager mgr = context.getSystemService(NotificationManager.class);
+ mgr.removeAutomaticZenRules(pkg);
+ }
+ });
+ }
+
private final class SettingObserver extends ContentObserver {
public SettingObserver() {
super(new Handler(Looper.getMainLooper()));
@@ -160,6 +170,9 @@
}
}
+ /**
+ * Warning dialog when allowing zen access warning about the privileges being granted.
+ */
public static class ScaryWarningDialogFragment extends DialogFragment {
static final String KEY_PKG = "p";
static final String KEY_LABEL = "l";
@@ -202,4 +215,51 @@
.create();
}
}
+
+ /**
+ * Warning dialog when revoking zen access warning that zen rule instances will be deleted.
+ */
+ public static class FriendlyWarningDialogFragment extends DialogFragment {
+ static final String KEY_PKG = "p";
+ static final String KEY_LABEL = "l";
+
+ public FriendlyWarningDialogFragment setPkgInfo(String pkg, CharSequence label) {
+ Bundle args = new Bundle();
+ args.putString(KEY_PKG, pkg);
+ args.putString(KEY_LABEL, TextUtils.isEmpty(label) ? pkg : label.toString());
+ setArguments(args);
+ return this;
+ }
+
+ @Override
+ public Dialog onCreateDialog(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ final Bundle args = getArguments();
+ final String pkg = args.getString(KEY_PKG);
+ final String label = args.getString(KEY_LABEL);
+
+ final String title = getResources().getString(
+ R.string.zen_access_revoke_warning_dialog_title, label);
+ final String summary = getResources()
+ .getString(R.string.zen_access_revoke_warning_dialog_summary);
+ return new AlertDialog.Builder(getContext())
+ .setMessage(summary)
+ .setTitle(title)
+ .setCancelable(true)
+ .setPositiveButton(R.string.okay,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ deleteRules(getContext(), pkg);
+ setAccess(getContext(), pkg, false);
+ }
+ })
+ .setNegativeButton(R.string.cancel,
+ new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ // pass
+ }
+ })
+ .create();
+ }
+ }
}
diff --git a/src/com/android/settings/search/SearchIndexableResources.java b/src/com/android/settings/search/SearchIndexableResources.java
index 376b2eb..6d6ca08 100644
--- a/src/com/android/settings/search/SearchIndexableResources.java
+++ b/src/com/android/settings/search/SearchIndexableResources.java
@@ -155,7 +155,7 @@
sResMap.put(SoundSettings.class.getName(),
new SearchIndexableResource(
Ranking.getRankForClassName(SoundSettings.class.getName()),
- R.xml.sound_settings,
+ NO_DATA_RES_ID,
SoundSettings.class.getName(),
R.drawable.ic_settings_sound));
diff --git a/src/com/android/settings/users/UserDetailsSettings.java b/src/com/android/settings/users/UserDetailsSettings.java
index 0dc87aa..9a81d16 100644
--- a/src/com/android/settings/users/UserDetailsSettings.java
+++ b/src/com/android/settings/users/UserDetailsSettings.java
@@ -145,14 +145,15 @@
List<UserInfo> users = mUserManager.getUsers(true);
for (UserInfo user: users) {
if (user.isGuest()) {
+ UserHandle userHandle = UserHandle.of(user.id);
for (String key : mDefaultGuestRestrictions.keySet()) {
mUserManager.setUserRestriction(
- key, mDefaultGuestRestrictions.getBoolean(key));
+ key, mDefaultGuestRestrictions.getBoolean(key), userHandle);
}
}
}
} else {
- UserHandle userHandle = new UserHandle(mUserInfo.id);
+ UserHandle userHandle = UserHandle.of(mUserInfo.id);
mUserManager.setUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, !enabled,
userHandle);
mUserManager.setUserRestriction(UserManager.DISALLOW_SMS, !enabled, userHandle);
diff --git a/src/com/android/settings/wifi/AdvancedWifiSettings.java b/src/com/android/settings/wifi/AdvancedWifiSettings.java
index aaab0c5..8dfb024 100644
--- a/src/com/android/settings/wifi/AdvancedWifiSettings.java
+++ b/src/com/android/settings/wifi/AdvancedWifiSettings.java
@@ -18,68 +18,25 @@
import android.app.Dialog;
import android.app.DialogFragment;
-import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
-import android.content.IntentFilter;
-import android.net.NetworkScoreManager;
-import android.net.NetworkScorerAppManager;
-import android.net.NetworkScorerAppManager.NetworkScorerAppData;
-import android.net.wifi.WifiInfo;
-import android.net.wifi.WifiManager;
import android.net.wifi.WpsInfo;
import android.os.Bundle;
-import android.os.UserManager;
-import android.provider.Settings;
-import android.provider.Settings.Global;
import android.security.Credentials;
-import android.support.v14.preference.SwitchPreference;
-import android.support.v7.preference.ListPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.Preference.OnPreferenceClickListener;
-import android.text.TextUtils;
-import android.util.Log;
-import android.widget.Toast;
-
import com.android.internal.logging.MetricsLogger;
-import com.android.settings.AppListSwitchPreference;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.Utils;
-import java.util.Collection;
-
-public class AdvancedWifiSettings extends SettingsPreferenceFragment
- implements Preference.OnPreferenceChangeListener {
-
+public class AdvancedWifiSettings extends SettingsPreferenceFragment {
private static final String TAG = "AdvancedWifiSettings";
- private static final String KEY_MAC_ADDRESS = "mac_address";
- private static final String KEY_CURRENT_IP_ADDRESS = "current_ip_address";
- private static final String KEY_FREQUENCY_BAND = "frequency_band";
- private static final String KEY_NOTIFY_OPEN_NETWORKS = "notify_open_networks";
- private static final String KEY_SLEEP_POLICY = "sleep_policy";
+
private static final String KEY_INSTALL_CREDENTIALS = "install_credentials";
- private static final String KEY_WIFI_ASSISTANT = "wifi_assistant";
private static final String KEY_WIFI_DIRECT = "wifi_direct";
private static final String KEY_WPS_PUSH = "wps_push_button";
private static final String KEY_WPS_PIN = "wps_pin_entry";
- private WifiManager mWifiManager;
- private NetworkScoreManager mNetworkScoreManager;
- private AppListSwitchPreference mWifiAssistantPreference;
-
- private IntentFilter mFilter;
- private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- String action = intent.getAction();
- if (action.equals(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION) ||
- action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {
- refreshWifiInfo();
- }
- }
- };
-
@Override
protected int getMetricsCategory() {
return MetricsLogger.WIFI_ADVANCED;
@@ -92,37 +49,13 @@
}
@Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
- mFilter = new IntentFilter();
- mFilter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
- mFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
- mNetworkScoreManager =
- (NetworkScoreManager) getSystemService(Context.NETWORK_SCORE_SERVICE);
- }
-
- @Override
public void onResume() {
super.onResume();
initPreferences();
- getActivity().registerReceiver(mReceiver, mFilter);
- refreshWifiInfo();
- }
-
- @Override
- public void onPause() {
- super.onPause();
- getActivity().unregisterReceiver(mReceiver);
}
private void initPreferences() {
- SwitchPreference notifyOpenNetworks =
- (SwitchPreference) findPreference(KEY_NOTIFY_OPEN_NETWORKS);
- notifyOpenNetworks.setChecked(Settings.Global.getInt(getContentResolver(),
- Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0) == 1);
- notifyOpenNetworks.setEnabled(mWifiManager.isWifiEnabled());
-
+ final Context context = getActivity();
Intent intent = new Intent(Credentials.INSTALL_AS_USER_ACTION);
intent.setClassName("com.android.certinstaller",
"com.android.certinstaller.CertInstallerMain");
@@ -130,16 +63,6 @@
Preference pref = findPreference(KEY_INSTALL_CREDENTIALS);
pref.setIntent(intent);
- final Context context = getActivity();
- mWifiAssistantPreference = (AppListSwitchPreference) findPreference(KEY_WIFI_ASSISTANT);
- Collection<NetworkScorerAppData> scorers =
- NetworkScorerAppManager.getAllValidScorers(context);
- if (UserManager.get(context).isAdminUser() && !scorers.isEmpty()) {
- mWifiAssistantPreference.setOnPreferenceChangeListener(this);
- initWifiAssistantPreference(scorers);
- } else if (mWifiAssistantPreference != null) {
- getPreferenceScreen().removePreference(mWifiAssistantPreference);
- }
Intent wifiDirectIntent = new Intent(context,
com.android.settings.Settings.WifiP2pSettingsActivity.class);
@@ -165,165 +88,6 @@
return true;
}
});
-
- ListPreference frequencyPref = (ListPreference) findPreference(KEY_FREQUENCY_BAND);
-
- if (mWifiManager.isDualBandSupported()) {
- frequencyPref.setOnPreferenceChangeListener(this);
- int value = mWifiManager.getFrequencyBand();
- if (value != -1) {
- frequencyPref.setValue(String.valueOf(value));
- updateFrequencyBandSummary(frequencyPref, value);
- } else {
- Log.e(TAG, "Failed to fetch frequency band");
- }
- } else {
- if (frequencyPref != null) {
- // null if it has already been removed before resume
- getPreferenceScreen().removePreference(frequencyPref);
- }
- }
-
- ListPreference sleepPolicyPref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
- if (sleepPolicyPref != null) {
- if (Utils.isWifiOnly(context)) {
- sleepPolicyPref.setEntries(R.array.wifi_sleep_policy_entries_wifi_only);
- }
- sleepPolicyPref.setOnPreferenceChangeListener(this);
- int value = Settings.Global.getInt(getContentResolver(),
- Settings.Global.WIFI_SLEEP_POLICY,
- Settings.Global.WIFI_SLEEP_POLICY_NEVER);
- String stringValue = String.valueOf(value);
- sleepPolicyPref.setValue(stringValue);
- updateSleepPolicySummary(sleepPolicyPref, stringValue);
- }
- }
-
- private void initWifiAssistantPreference(Collection<NetworkScorerAppData> scorers) {
- int count = scorers.size();
- String[] packageNames = new String[count];
- int i = 0;
- for (NetworkScorerAppData scorer : scorers) {
- packageNames[i] = scorer.mPackageName;
- i++;
- }
- mWifiAssistantPreference.setPackageNames(packageNames,
- mNetworkScoreManager.getActiveScorerPackage());
- }
-
- private void updateSleepPolicySummary(Preference sleepPolicyPref, String value) {
- if (value != null) {
- String[] values = getResources().getStringArray(R.array.wifi_sleep_policy_values);
- final int summaryArrayResId = Utils.isWifiOnly(getActivity()) ?
- R.array.wifi_sleep_policy_entries_wifi_only : R.array.wifi_sleep_policy_entries;
- String[] summaries = getResources().getStringArray(summaryArrayResId);
- for (int i = 0; i < values.length; i++) {
- if (value.equals(values[i])) {
- if (i < summaries.length) {
- sleepPolicyPref.setSummary(summaries[i]);
- return;
- }
- }
- }
- }
-
- sleepPolicyPref.setSummary("");
- Log.e(TAG, "Invalid sleep policy value: " + value);
- }
-
- private void updateFrequencyBandSummary(Preference frequencyBandPref, int index) {
- String[] summaries = getResources().getStringArray(R.array.wifi_frequency_band_entries);
- frequencyBandPref.setSummary(summaries[index]);
- }
-
- @Override
- public boolean onPreferenceTreeClick(Preference preference) {
- String key = preference.getKey();
-
- if (KEY_NOTIFY_OPEN_NETWORKS.equals(key)) {
- Global.putInt(getContentResolver(),
- Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
- ((SwitchPreference) preference).isChecked() ? 1 : 0);
- } else {
- return super.onPreferenceTreeClick(preference);
- }
- return true;
- }
-
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- final Context context = getActivity();
- String key = preference.getKey();
-
- if (KEY_FREQUENCY_BAND.equals(key)) {
- try {
- int value = Integer.parseInt((String) newValue);
- mWifiManager.setFrequencyBand(value, true);
- updateFrequencyBandSummary(preference, value);
- } catch (NumberFormatException e) {
- Toast.makeText(context, R.string.wifi_setting_frequency_band_error,
- Toast.LENGTH_SHORT).show();
- return false;
- }
- } else if (KEY_WIFI_ASSISTANT.equals(key)) {
- NetworkScorerAppData wifiAssistant =
- NetworkScorerAppManager.getScorer(context, (String) newValue);
- if (wifiAssistant == null) {
- mNetworkScoreManager.setActiveScorer(null);
- return true;
- }
-
- Intent intent = new Intent();
- if (wifiAssistant.mConfigurationActivityClassName != null) {
- // App has a custom configuration activity; launch that.
- // This custom activity will be responsible for launching the system
- // dialog.
- intent.setClassName(wifiAssistant.mPackageName,
- wifiAssistant.mConfigurationActivityClassName);
- } else {
- // Fall back on the system dialog.
- intent.setAction(NetworkScoreManager.ACTION_CHANGE_ACTIVE);
- intent.putExtra(NetworkScoreManager.EXTRA_PACKAGE_NAME,
- wifiAssistant.mPackageName);
- }
-
- startActivity(intent);
- // Don't update the preference widget state until the child activity returns.
- // It will be updated in onResume after the activity finishes.
- return false;
- }
-
- if (KEY_SLEEP_POLICY.equals(key)) {
- try {
- String stringValue = (String) newValue;
- Settings.Global.putInt(getContentResolver(), Settings.Global.WIFI_SLEEP_POLICY,
- Integer.parseInt(stringValue));
- updateSleepPolicySummary(preference, stringValue);
- } catch (NumberFormatException e) {
- Toast.makeText(context, R.string.wifi_setting_sleep_policy_error,
- Toast.LENGTH_SHORT).show();
- return false;
- }
- }
-
- return true;
- }
-
- private void refreshWifiInfo() {
- final Context context = getActivity();
- WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
-
- Preference wifiMacAddressPref = findPreference(KEY_MAC_ADDRESS);
- String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
- wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
- : context.getString(R.string.status_unavailable));
- wifiMacAddressPref.setSelectable(false);
-
- Preference wifiIpAddressPref = findPreference(KEY_CURRENT_IP_ADDRESS);
- String ipAddress = Utils.getWifiIpAddresses(context);
- wifiIpAddressPref.setSummary(ipAddress == null ?
- context.getString(R.string.status_unavailable) : ipAddress);
- wifiIpAddressPref.setSelectable(false);
}
/* Wrapper class for the WPS dialog to properly handle life cycle events like rotation. */
diff --git a/src/com/android/settings/wifi/ConfigureWifiSettings.java b/src/com/android/settings/wifi/ConfigureWifiSettings.java
new file mode 100644
index 0000000..54ce036
--- /dev/null
+++ b/src/com/android/settings/wifi/ConfigureWifiSettings.java
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2015 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.wifi;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.net.NetworkScoreManager;
+import android.net.NetworkScorerAppManager;
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.os.UserManager;
+import android.provider.Settings;
+import android.support.v14.preference.SwitchPreference;
+import android.support.v7.preference.ListPreference;
+import android.support.v7.preference.Preference;
+import android.text.TextUtils;
+import android.util.Log;
+import android.widget.Toast;
+import com.android.settings.AppListSwitchPreference;
+import com.android.settings.InstrumentedFragment;
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.Utils;
+
+import java.util.Collection;
+import java.util.List;
+
+public class ConfigureWifiSettings extends SettingsPreferenceFragment
+ implements Preference.OnPreferenceChangeListener {
+ private static final String TAG = "ConfigureWifiSettings";
+
+ private static final String KEY_MAC_ADDRESS = "mac_address";
+ private static final String KEY_SAVED_NETWORKS = "saved_networks";
+ private static final String KEY_CURRENT_IP_ADDRESS = "current_ip_address";
+ private static final String KEY_FREQUENCY_BAND = "frequency_band";
+ private static final String KEY_NOTIFY_OPEN_NETWORKS = "notify_open_networks";
+ private static final String KEY_SLEEP_POLICY = "sleep_policy";
+ private static final String KEY_WIFI_ASSISTANT = "wifi_assistant";
+
+ private WifiManager mWifiManager;
+ private NetworkScoreManager mNetworkScoreManager;
+ private AppListSwitchPreference mWifiAssistantPreference;
+
+ private IntentFilter mFilter;
+
+ @Override
+ public void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ addPreferencesFromResource(R.xml.wifi_configure_settings);
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+ mFilter = new IntentFilter();
+ mFilter.addAction(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION);
+ mFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
+ mNetworkScoreManager =
+ (NetworkScoreManager) getSystemService(Context.NETWORK_SCORE_SERVICE);
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ initPreferences();
+ getActivity().registerReceiver(mReceiver, mFilter);
+ refreshWifiInfo();
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ getActivity().unregisterReceiver(mReceiver);
+ }
+
+ private void initPreferences() {
+ List<WifiConfiguration> configs = mWifiManager.getConfiguredNetworks();
+ if (configs == null || configs.size() == 0) {
+ removePreference(KEY_SAVED_NETWORKS);
+ }
+
+ SwitchPreference notifyOpenNetworks =
+ (SwitchPreference) findPreference(KEY_NOTIFY_OPEN_NETWORKS);
+ notifyOpenNetworks.setChecked(Settings.Global.getInt(getContentResolver(),
+ Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0) == 1);
+ notifyOpenNetworks.setEnabled(mWifiManager.isWifiEnabled());
+
+ final Context context = getActivity();
+ mWifiAssistantPreference = (AppListSwitchPreference) findPreference(KEY_WIFI_ASSISTANT);
+ Collection<NetworkScorerAppManager.NetworkScorerAppData> scorers =
+ NetworkScorerAppManager.getAllValidScorers(context);
+ if (UserManager.get(context).isAdminUser() && !scorers.isEmpty()) {
+ mWifiAssistantPreference.setOnPreferenceChangeListener(this);
+ initWifiAssistantPreference(scorers);
+ } else if (mWifiAssistantPreference != null) {
+ getPreferenceScreen().removePreference(mWifiAssistantPreference);
+ }
+
+ ListPreference frequencyPref = (ListPreference) findPreference(KEY_FREQUENCY_BAND);
+
+ if (mWifiManager.isDualBandSupported()) {
+ frequencyPref.setOnPreferenceChangeListener(this);
+ int value = mWifiManager.getFrequencyBand();
+ if (value != -1) {
+ frequencyPref.setValue(String.valueOf(value));
+ updateFrequencyBandSummary(frequencyPref, value);
+ } else {
+ Log.e(TAG, "Failed to fetch frequency band");
+ }
+ } else {
+ if (frequencyPref != null) {
+ // null if it has already been removed before resume
+ getPreferenceScreen().removePreference(frequencyPref);
+ }
+ }
+
+ ListPreference sleepPolicyPref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
+ if (sleepPolicyPref != null) {
+ if (Utils.isWifiOnly(context)) {
+ sleepPolicyPref.setEntries(R.array.wifi_sleep_policy_entries_wifi_only);
+ }
+ sleepPolicyPref.setOnPreferenceChangeListener(this);
+ int value = Settings.Global.getInt(getContentResolver(),
+ Settings.Global.WIFI_SLEEP_POLICY,
+ Settings.Global.WIFI_SLEEP_POLICY_NEVER);
+ String stringValue = String.valueOf(value);
+ sleepPolicyPref.setValue(stringValue);
+ updateSleepPolicySummary(sleepPolicyPref, stringValue);
+ }
+ }
+
+ private void updateSleepPolicySummary(Preference sleepPolicyPref, String value) {
+ if (value != null) {
+ String[] values = getResources().getStringArray(R.array.wifi_sleep_policy_values);
+ final int summaryArrayResId = Utils.isWifiOnly(getActivity()) ?
+ R.array.wifi_sleep_policy_entries_wifi_only : R.array.wifi_sleep_policy_entries;
+ String[] summaries = getResources().getStringArray(summaryArrayResId);
+ for (int i = 0; i < values.length; i++) {
+ if (value.equals(values[i])) {
+ if (i < summaries.length) {
+ sleepPolicyPref.setSummary(summaries[i]);
+ return;
+ }
+ }
+ }
+ }
+
+ sleepPolicyPref.setSummary("");
+ Log.e(TAG, "Invalid sleep policy value: " + value);
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(Preference preference) {
+ String key = preference.getKey();
+
+ if (KEY_NOTIFY_OPEN_NETWORKS.equals(key)) {
+ Settings.Global.putInt(getContentResolver(),
+ Settings.Global.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
+ ((SwitchPreference) preference).isChecked() ? 1 : 0);
+ } else {
+ return super.onPreferenceTreeClick(preference);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ final Context context = getActivity();
+ String key = preference.getKey();
+
+ if (KEY_FREQUENCY_BAND.equals(key)) {
+ try {
+ int value = Integer.parseInt((String) newValue);
+ mWifiManager.setFrequencyBand(value, true);
+ updateFrequencyBandSummary(preference, value);
+ } catch (NumberFormatException e) {
+ Toast.makeText(context, R.string.wifi_setting_frequency_band_error,
+ Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ } else if (KEY_WIFI_ASSISTANT.equals(key)) {
+ NetworkScorerAppManager.NetworkScorerAppData wifiAssistant =
+ NetworkScorerAppManager.getScorer(context, (String) newValue);
+ if (wifiAssistant == null) {
+ mNetworkScoreManager.setActiveScorer(null);
+ return true;
+ }
+
+ Intent intent = new Intent();
+ if (wifiAssistant.mConfigurationActivityClassName != null) {
+ // App has a custom configuration activity; launch that.
+ // This custom activity will be responsible for launching the system
+ // dialog.
+ intent.setClassName(wifiAssistant.mPackageName,
+ wifiAssistant.mConfigurationActivityClassName);
+ } else {
+ // Fall back on the system dialog.
+ intent.setAction(NetworkScoreManager.ACTION_CHANGE_ACTIVE);
+ intent.putExtra(NetworkScoreManager.EXTRA_PACKAGE_NAME,
+ wifiAssistant.mPackageName);
+ }
+
+ startActivity(intent);
+ // Don't update the preference widget state until the child activity returns.
+ // It will be updated in onResume after the activity finishes.
+ return false;
+ }
+
+ if (KEY_SLEEP_POLICY.equals(key)) {
+ try {
+ String stringValue = (String) newValue;
+ Settings.Global.putInt(getContentResolver(), Settings.Global.WIFI_SLEEP_POLICY,
+ Integer.parseInt(stringValue));
+ updateSleepPolicySummary(preference, stringValue);
+ } catch (NumberFormatException e) {
+ Toast.makeText(context, R.string.wifi_setting_sleep_policy_error,
+ Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private void refreshWifiInfo() {
+ final Context context = getActivity();
+ WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
+
+ Preference wifiMacAddressPref = findPreference(KEY_MAC_ADDRESS);
+ String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
+ wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
+ : context.getString(R.string.status_unavailable));
+ wifiMacAddressPref.setSelectable(false);
+
+ Preference wifiIpAddressPref = findPreference(KEY_CURRENT_IP_ADDRESS);
+ String ipAddress = Utils.getWifiIpAddresses(context);
+ wifiIpAddressPref.setSummary(ipAddress == null ?
+ context.getString(R.string.status_unavailable) : ipAddress);
+ wifiIpAddressPref.setSelectable(false);
+ }
+
+ private void updateFrequencyBandSummary(Preference frequencyBandPref, int index) {
+ String[] summaries = getResources().getStringArray(R.array.wifi_frequency_band_entries);
+ frequencyBandPref.setSummary(summaries[index]);
+ }
+
+ private void initWifiAssistantPreference(
+ Collection<NetworkScorerAppManager.NetworkScorerAppData> scorers) {
+ int count = scorers.size();
+ String[] packageNames = new String[count];
+ int i = 0;
+ for (NetworkScorerAppManager.NetworkScorerAppData scorer : scorers) {
+ packageNames[i] = scorer.mPackageName;
+ i++;
+ }
+ mWifiAssistantPreference.setPackageNames(packageNames,
+ mNetworkScoreManager.getActiveScorerPackage());
+ }
+
+ @Override
+ protected int getMetricsCategory() {
+ return InstrumentedFragment.CONFIGURE_WIFI;
+ }
+
+ private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String action = intent.getAction();
+ if (action.equals(WifiManager.LINK_CONFIGURATION_CHANGED_ACTION) ||
+ action.equals(WifiManager.NETWORK_STATE_CHANGED_ACTION)) {
+ refreshWifiInfo();
+ }
+ }
+ };
+}
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 74d3e51..87f72f5 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -32,7 +32,7 @@
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
-import android.content.res.TypedArray;
+import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.State;
@@ -47,9 +47,11 @@
import android.os.UserHandle;
import android.provider.Settings;
import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceViewHolder;
import android.text.Spannable;
import android.text.style.TextAppearanceSpan;
import android.util.Log;
+import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Gravity;
@@ -99,14 +101,13 @@
/* package */ static final int MENU_ID_WPS_PBC = Menu.FIRST;
private static final int MENU_ID_WPS_PIN = Menu.FIRST + 1;
- private static final int MENU_ID_SAVED_NETWORK = Menu.FIRST + 2;
- /* package */ static final int MENU_ID_ADD_NETWORK = Menu.FIRST + 3;
private static final int MENU_ID_ADVANCED = Menu.FIRST + 4;
private static final int MENU_ID_SCAN = Menu.FIRST + 5;
private static final int MENU_ID_CONNECT = Menu.FIRST + 6;
private static final int MENU_ID_FORGET = Menu.FIRST + 7;
private static final int MENU_ID_MODIFY = Menu.FIRST + 8;
private static final int MENU_ID_WRITE_NFC = Menu.FIRST + 9;
+ private static final int MENU_ID_CONFIGURE = Menu.FIRST + 10;
public static final int WIFI_DIALOG_ID = 1;
/* package */ static final int WPS_PBC_DIALOG_ID = 2;
@@ -118,8 +119,6 @@
private static final String SAVE_DIALOG_ACCESS_POINT_STATE = "wifi_ap_state";
private static final String SAVED_WIFI_NFC_DIALOG_STATE = "wifi_nfc_dlg_state";
- private static boolean savedNetworksExist;
-
protected WifiManager mWifiManager;
private WifiManager.ActionListener mConnectListener;
private WifiManager.ActionListener mSaveListener;
@@ -157,6 +156,7 @@
private HandlerThread mBgThread;
private UserBadgeCache mUserBadgeCache;
+ private Preference mAddPreference;
/* End of "used in Wifi Setup context" */
@@ -177,6 +177,14 @@
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
addPreferencesFromResource(R.xml.wifi_settings);
+ mAddPreference = new Preference(getContext());
+ Drawable ic_add = getContext().getDrawable(R.drawable.ic_menu_add).mutate();
+ TypedValue tv = new TypedValue();
+ getContext().getTheme().resolveAttribute(android.R.attr.colorAccent, tv, true);
+ ic_add.setTint(getContext().getColor(tv.resourceId));
+ mAddPreference.setIcon(ic_add);
+ mAddPreference.setTitle(R.string.wifi_add_network);
+
mUserBadgeCache = new UserBadgeCache(getPackageManager());
mBgThread = new HandlerThread(TAG, Process.THREAD_PRIORITY_BACKGROUND);
@@ -343,24 +351,14 @@
*/
void addOptionsMenuItems(Menu menu) {
final boolean wifiIsEnabled = mWifiTracker.isWifiEnabled();
- TypedArray ta = getActivity().getTheme().obtainStyledAttributes(
- new int[] {R.attr.ic_menu_add, R.attr.ic_wps});
- menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
- .setIcon(ta.getDrawable(0))
- .setEnabled(wifiIsEnabled)
- .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
- if (savedNetworksExist) {
- menu.add(Menu.NONE, MENU_ID_SAVED_NETWORK, 0, R.string.wifi_saved_access_points_label)
- .setIcon(ta.getDrawable(0))
- .setEnabled(wifiIsEnabled)
- .setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
- }
menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.menu_stats_refresh)
.setEnabled(wifiIsEnabled)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.wifi_menu_advanced)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_NEVER);
- ta.recycle();
+ menu.add(Menu.NONE, MENU_ID_CONFIGURE, 0, R.string.wifi_menu_configure)
+ .setIcon(R.drawable.ic_settings_24dp)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
@Override
@@ -419,22 +417,6 @@
MetricsLogger.action(getActivity(), MetricsLogger.ACTION_WIFI_FORCE_SCAN);
mWifiTracker.forceScan();
return true;
- case MENU_ID_ADD_NETWORK:
- if (mWifiTracker.isWifiEnabled()) {
- onAddNetworkPressed();
- }
- return true;
- case MENU_ID_SAVED_NETWORK:
- if (getActivity() instanceof SettingsActivity) {
- ((SettingsActivity) getActivity()).startPreferencePanel(
- SavedAccessPointsWifiSettings.class.getCanonicalName(), null,
- R.string.wifi_saved_access_points_titlebar, null, this, 0);
- } else {
- startFragment(this, SavedAccessPointsWifiSettings.class.getCanonicalName(),
- R.string.wifi_saved_access_points_titlebar,
- -1 /* Do not request a result */, null);
- }
- return true;
case MENU_ID_ADVANCED:
if (getActivity() instanceof SettingsActivity) {
((SettingsActivity) getActivity()).startPreferencePanel(
@@ -446,6 +428,18 @@
null);
}
return true;
+ case MENU_ID_CONFIGURE:
+ if (getActivity() instanceof SettingsActivity) {
+ ((SettingsActivity) getActivity()).startPreferencePanel(
+ ConfigureWifiSettings.class.getCanonicalName(), null,
+ R.string.wifi_configure_titlebar, null, this, 0);
+ } else {
+ startFragment(this, ConfigureWifiSettings.class.getCanonicalName(),
+ R.string.wifi_configure_titlebar, -1 /* Do not request a results */,
+ null);
+ }
+ return true;
+
}
return super.onOptionsItemSelected(item);
}
@@ -530,16 +524,14 @@
if (mSelectedAccessPoint.getSecurity() == AccessPoint.SECURITY_NONE &&
!mSelectedAccessPoint.isSaved() && !mSelectedAccessPoint.isActive()) {
mSelectedAccessPoint.generateOpenNetworkConfig();
- if (!savedNetworksExist) {
- savedNetworksExist = true;
- getActivity().invalidateOptionsMenu();
- }
connect(mSelectedAccessPoint.getConfig());
- } else if (mSelectedAccessPoint.isSaved()){
+ } else if (mSelectedAccessPoint.isSaved()) {
showDialog(mSelectedAccessPoint, WifiConfigUiBase.MODE_VIEW);
} else {
showDialog(mSelectedAccessPoint, WifiConfigUiBase.MODE_CONNECT);
}
+ } else if (preference == mAddPreference) {
+ onAddNetworkPressed();
} else {
return super.onPreferenceTreeClick(preference);
}
@@ -678,8 +670,23 @@
}
if (!hasAvailableAccessPoints) {
setProgressBarVisible(true);
- addMessagePreference(R.string.wifi_empty_list_wifi_on);
+ Preference pref = new Preference(getContext()) {
+ @Override
+ public void onBindViewHolder(PreferenceViewHolder holder) {
+ super.onBindViewHolder(holder);
+ // Show a line on each side of add network.
+ holder.setDividerAllowedBelow(true);
+ }
+ };
+ pref.setSelectable(false);
+ pref.setSummary(R.string.wifi_empty_list_wifi_on);
+ pref.setOrder(0);
+ getPreferenceScreen().addPreference(pref);
+ mAddPreference.setOrder(1);
+ getPreferenceScreen().addPreference(mAddPreference);
} else {
+ mAddPreference.setOrder(index++);
+ getPreferenceScreen().addPreference(mAddPreference);
setProgressBarVisible(false);
}
break;
@@ -699,11 +706,6 @@
setProgressBarVisible(false);
break;
}
- // Update "Saved Networks" menu option.
- if (savedNetworksExist != mWifiTracker.doSavedNetworksExist()) {
- savedNetworksExist = !savedNetworksExist;
- getActivity().invalidateOptionsMenu();
- }
}
protected TextView initEmptyView() {
@@ -768,11 +770,6 @@
@Override
public void onWifiStateChanged(int state) {
- Activity activity = getActivity();
- if (activity != null) {
- activity.invalidateOptionsMenu();
- }
-
switch (state) {
case WifiManager.WIFI_STATE_ENABLING:
addMessagePreference(R.string.wifi_starting);
diff --git a/src/com/android/settings/wifi/WifiStatusTest.java b/src/com/android/settings/wifi/WifiStatusTest.java
index 38b3a15..4577496 100644
--- a/src/com/android/settings/wifi/WifiStatusTest.java
+++ b/src/com/android/settings/wifi/WifiStatusTest.java
@@ -148,8 +148,7 @@
mScanList = (TextView) findViewById(R.id.scan_list);
- mPingIpAddr = (TextView) findViewById(R.id.pingIpAddr);
- mPingHostname = (TextView) findViewById(R.id.pingHostname);
+ mPingHostname = (TextView) findViewById(R.id.pingHostnameV4);
mHttpClientTest = (TextView) findViewById(R.id.httpClientTest);
pingTestButton = (Button) findViewById(R.id.ping_test);
@@ -317,19 +316,10 @@
final Runnable updatePingResults = new Runnable() {
public void run() {
- mPingIpAddr.setText(mPingIpAddrResult);
mPingHostname.setText(mPingHostnameResult);
mHttpClientTest.setText(mHttpClientTestResult);
}
};
- Thread ipAddrThread = new Thread() {
- @Override
- public void run() {
- pingIpAddr();
- handler.post(updatePingResults);
- }
- };
- ipAddrThread.start();
Thread hostnameThread = new Thread() {
@Override
@@ -350,28 +340,6 @@
httpClientThread.start();
}
- /**
- * The ping functions have been borrowed from Radio diagnostic app to
- * enable quick access on the wifi status screen
- */
- private final void pingIpAddr() {
- try {
- // TODO: Hardcoded for now, make it UI configurable
- String ipAddress = "74.125.47.104";
- Process p = Runtime.getRuntime().exec("ping -c 1 -w 100 " + ipAddress);
- int status = p.waitFor();
- if (status == 0) {
- mPingIpAddrResult = "Pass";
- } else {
- mPingIpAddrResult = "Fail: IP addr not reachable";
- }
- } catch (IOException e) {
- mPingIpAddrResult = "Fail: IOException";
- } catch (InterruptedException e) {
- mPingIpAddrResult = "Fail: InterruptedException";
- }
- }
-
private final void pingHostname() {
try {
// TODO: Hardcoded for now, make it UI configurable
diff --git a/src/com/android/settings/wifi/p2p/WifiP2pPeer.java b/src/com/android/settings/wifi/p2p/WifiP2pPeer.java
index d4b50e6..a318e6f 100644
--- a/src/com/android/settings/wifi/p2p/WifiP2pPeer.java
+++ b/src/com/android/settings/wifi/p2p/WifiP2pPeer.java
@@ -23,7 +23,6 @@
import android.support.v7.preference.PreferenceViewHolder;
import android.text.TextUtils;
import android.widget.ImageView;
-
import com.android.settings.R;
public class WifiP2pPeer extends Preference {
@@ -41,15 +40,18 @@
device = dev;
setWidgetLayoutResource(R.layout.preference_widget_wifi_signal);
mRssi = 60; //TODO: fix
- }
-
- @Override
- public void onBindViewHolder(PreferenceViewHolder view) {
if (TextUtils.isEmpty(device.deviceName)) {
setTitle(device.deviceAddress);
} else {
setTitle(device.deviceName);
}
+ String[] statusArray = context.getResources().getStringArray(R.array.wifi_p2p_status);
+ setSummary(statusArray[device.status]);
+ }
+
+ @Override
+ public void onBindViewHolder(PreferenceViewHolder view) {
+ super.onBindViewHolder(view);
mSignal = (ImageView) view.findViewById(R.id.signal);
if (mRssi == Integer.MAX_VALUE) {
mSignal.setImageDrawable(null);
@@ -57,8 +59,7 @@
mSignal.setImageResource(R.drawable.wifi_signal_dark);
mSignal.setImageState(STATE_SECURED, true);
}
- refresh();
- super.onBindViewHolder(view);
+ mSignal.setImageLevel(getLevel());
}
@Override
@@ -87,14 +88,4 @@
}
return WifiManager.calculateSignalLevel(mRssi, SIGNAL_LEVELS);
}
-
- private void refresh() {
- if (mSignal == null) {
- return;
- }
- Context context = getContext();
- mSignal.setImageLevel(getLevel());
- String[] statusArray = context.getResources().getStringArray(R.array.wifi_p2p_status);
- setSummary(statusArray[device.status]);
- }
}