Merge "update station to show ranking and autobundles" into nyc-dev
diff --git a/res/layout/admin_support_details_content.xml b/res/layout/admin_support_details_content.xml
index 52de743..7c756c4 100644
--- a/res/layout/admin_support_details_content.xml
+++ b/res/layout/admin_support_details_content.xml
@@ -20,7 +20,7 @@
android:textAppearance="@android:style/TextAppearance.Material.Subhead"
android:text="@string/default_admin_support_msg"
android:maxLength="200"
- android:autoLink="email|phone"
+ android:autoLink="email|phone|web"
android:textColor="?android:attr/textColorSecondary" />
<TextView android:id="@+id/admins_policies_list"
android:layout_width="match_parent"
diff --git a/res/layout/battery_history_detail.xml b/res/layout/battery_history_detail.xml
index d1563bf..df6248d 100644
--- a/res/layout/battery_history_detail.xml
+++ b/res/layout/battery_history_detail.xml
@@ -41,7 +41,7 @@
<com.android.settingslib.graph.UsageView
android:id="@+id/battery_usage"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="141dp"
settings:sideLabels="@array/battery_labels"
android:colorAccent="?android:attr/colorAccent"
android:gravity="end"
diff --git a/res/layout/bugreport_options_dialog.xml b/res/layout/bugreport_options_dialog.xml
index d937bc3..fd00bc6 100644
--- a/res/layout/bugreport_options_dialog.xml
+++ b/res/layout/bugreport_options_dialog.xml
@@ -15,66 +15,68 @@
limitations under the License.
-->
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal"
- android:paddingStart="20dp"
- android:paddingEnd="24dp"
- android:paddingTop="15dp"
- >
-
- <CheckedTextView
- android:id="@+id/bugreport_option_interactive_title"
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android">
+ <RelativeLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:checked="true"
- android:drawableStart="?android:attr/listChoiceIndicatorSingle"
- android:ellipsize="marquee"
- android:gravity="center_vertical"
- android:paddingEnd="?android:attr/dialogPreferredPadding"
- android:text="@*android:string/bugreport_option_interactive_title"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorAlertDialogListItem" />
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:paddingStart="20dp"
+ android:paddingEnd="24dp"
+ android:paddingTop="15dp"
+ >
- <TextView
- android:id="@+id/bugreport_option_interactive_summary"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/bugreport_option_interactive_title"
- android:maxLines="10"
- android:paddingBottom="10dp"
- android:paddingStart="32dp"
- android:paddingEnd="?android:attr/dialogPreferredPadding"
- android:text="@*android:string/bugreport_option_interactive_summary"
- android:textAppearance="?android:attr/textAppearanceListItemSecondary"
- android:textColor="?android:attr/textColorSecondary" />
+ <CheckedTextView
+ android:id="@+id/bugreport_option_interactive_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:checked="true"
+ android:drawableStart="?android:attr/listChoiceIndicatorSingle"
+ android:ellipsize="marquee"
+ android:gravity="center_vertical"
+ android:paddingEnd="?android:attr/dialogPreferredPadding"
+ android:text="@*android:string/bugreport_option_interactive_title"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorAlertDialogListItem" />
- <CheckedTextView
- android:id="@+id/bugreport_option_full_title"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/bugreport_option_interactive_summary"
- android:checked="false"
- android:drawableStart="?android:attr/listChoiceIndicatorSingle"
- android:ellipsize="marquee"
- android:gravity="center_vertical"
- android:paddingEnd="?android:attr/dialogPreferredPadding"
- android:text="@*android:string/bugreport_option_full_title"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorAlertDialogListItem" />
+ <TextView
+ android:id="@+id/bugreport_option_interactive_summary"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/bugreport_option_interactive_title"
+ android:maxLines="10"
+ android:paddingBottom="10dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="?android:attr/dialogPreferredPadding"
+ android:text="@*android:string/bugreport_option_interactive_summary"
+ android:textAppearance="?android:attr/textAppearanceListItemSecondary"
+ android:textColor="?android:attr/textColorSecondary" />
- <TextView
- android:id="@+id/bugreport_option_full_summary"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/bugreport_option_full_title"
- android:maxLines="10"
- android:paddingBottom="10dp"
- android:paddingStart="32dp"
- android:paddingEnd="?android:attr/dialogPreferredPadding"
- android:text="@*android:string/bugreport_option_full_summary"
- android:textAppearance="?android:attr/textAppearanceListItemSecondary"
- android:textColor="?android:attr/textColorSecondary" />
+ <CheckedTextView
+ android:id="@+id/bugreport_option_full_title"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/bugreport_option_interactive_summary"
+ android:checked="false"
+ android:drawableStart="?android:attr/listChoiceIndicatorSingle"
+ android:ellipsize="marquee"
+ android:gravity="center_vertical"
+ android:paddingEnd="?android:attr/dialogPreferredPadding"
+ android:text="@*android:string/bugreport_option_full_title"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorAlertDialogListItem" />
-</RelativeLayout>
\ No newline at end of file
+ <TextView
+ android:id="@+id/bugreport_option_full_summary"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_below="@+id/bugreport_option_full_title"
+ android:maxLines="10"
+ android:paddingBottom="10dp"
+ android:paddingStart="32dp"
+ android:paddingEnd="?android:attr/dialogPreferredPadding"
+ android:text="@*android:string/bugreport_option_full_summary"
+ android:textAppearance="?android:attr/textAppearanceListItemSecondary"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ </RelativeLayout>
+</ScrollView>
diff --git a/res/layout/confirm_lock_password_base.xml b/res/layout/confirm_lock_password_base.xml
index b104f07..536617d 100644
--- a/res/layout/confirm_lock_password_base.xml
+++ b/res/layout/confirm_lock_password_base.xml
@@ -59,9 +59,15 @@
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"/>
- <View android:layout_width="match_parent"
+ <TextView
+ android:id="@+id/strongAuthRequiredText"
+ style="@style/TextAppearance.ConfirmDeviceCredentialsStrongAuthRequiredText"
+ android:layout_width="match_parent"
android:layout_height="0dp"
- android:layout_weight="1"/>
+ android:layout_weight="1"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:gravity="center"/>
<EditText
android:id="@+id/password_entry"
diff --git a/res/layout/confirm_lock_pattern_base.xml b/res/layout/confirm_lock_pattern_base.xml
index c188ccf..117c499 100644
--- a/res/layout/confirm_lock_pattern_base.xml
+++ b/res/layout/confirm_lock_pattern_base.xml
@@ -59,9 +59,15 @@
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"/>
- <View android:layout_width="match_parent"
+ <TextView
+ android:id="@+id/strongAuthRequiredText"
+ style="@style/TextAppearance.ConfirmDeviceCredentialsStrongAuthRequiredText"
+ android:layout_width="match_parent"
android:layout_height="0dp"
- android:layout_weight="0.5"/>
+ android:layout_weight="0.5"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:gravity="center"/>
<com.android.internal.widget.LockPatternView
android:id="@+id/lockPattern"
diff --git a/res/layout/dashboard_tile.xml b/res/layout/dashboard_tile.xml
index cd7c8ee..983e6ea 100644
--- a/res/layout/dashboard_tile.xml
+++ b/res/layout/dashboard_tile.xml
@@ -15,57 +15,40 @@
-->
<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_vertical"
- android:minHeight="@dimen/dashboard_tile_minimum_height"
- android:clickable="true"
- android:background="@drawable/selectable_card" >
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:minHeight="@dimen/dashboard_tile_minimum_height"
+ android:clickable="true"
+ android:background="@drawable/selectable_card" >
<ImageView
- android:id="@android:id/icon"
- android:layout_width="@dimen/dashboard_tile_image_size"
- android:layout_height="@dimen/dashboard_tile_image_size"
- android:scaleType="centerInside"
- android:layout_marginStart="@dimen/dashboard_tile_image_margin_start"
- android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end" />
+ android:id="@android:id/icon"
+ android:layout_width="@dimen/dashboard_tile_image_size"
+ android:layout_height="@dimen/dashboard_tile_image_size"
+ android:scaleType="centerInside"
+ android:layout_marginStart="@dimen/dashboard_tile_image_margin_start"
+ android:layout_marginEnd="@dimen/dashboard_tile_image_margin_end" />
<LinearLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:orientation="vertical"
- android:gravity="center_vertical"
- android:layout_weight="1">
+ <TextView android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:singleLine="true"
+ android:textAppearance="@style/TextAppearance.TileTitle"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal" />
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content">
-
- <TextView android:id="@android:id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:textAppearance="@style/TextAppearance.TileTitle"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal" />
-
- <TextView android:id="@android:id/summary"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@android:id/title"
- android:layout_alignStart="@android:id/title"
- android:textAppearance="@style/TextAppearance.Small"
- android:textColor="?android:attr/textColorSecondary" />
-
- </RelativeLayout>
-
- </LinearLayout>
+ <TextView android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/TextAppearance.Small"
+ android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
diff --git a/res/layout/device_admin_add.xml b/res/layout/device_admin_add.xml
index a15a962..034075b 100644
--- a/res/layout/device_admin_add.xml
+++ b/res/layout/device_admin_add.xml
@@ -118,7 +118,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:autoLink="email|phone"
+ android:autoLink="email|phone|web"
android:padding="10dip" />
</LinearLayout>
diff --git a/res/layout/preview_seek_bar_view_pager.xml b/res/layout/preview_seek_bar_view_pager.xml
index 66b492c..e24b674 100644
--- a/res/layout/preview_seek_bar_view_pager.xml
+++ b/res/layout/preview_seek_bar_view_pager.xml
@@ -39,6 +39,6 @@
android:text="@string/screen_zoom_preview_title"
android:textAppearance="@android:style/TextAppearance.Material.Widget.ActionBar.Title"
android:textColor="@color/seek_bar_preference_preview_text"
- android:accessibilityTraversalBefore="@id/preview_pager"/>
+ android:importantForAccessibility="no" />
</LinearLayout>
diff --git a/res/layout/radio_info.xml b/res/layout/radio_info.xml
index 16bf0f6..c64b68e 100644
--- a/res/layout/radio_info.xml
+++ b/res/layout/radio_info.xml
@@ -41,6 +41,67 @@
<TextView android:id="@+id/operator" style="@style/info_value" />
</LinearLayout>
+ <!-- Signal Strength -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_signal_strength_label" style="@style/info_label" />
+ <TextView android:id="@+id/dbm" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- Voice Service Status -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_gsm_service_label" style="@style/info_label" />
+ <TextView android:id="@+id/gsm" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- Data Service Status -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_gprs_service_label" style="@style/info_label" />
+ <TextView android:id="@+id/gprs" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- Network Type -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_voice_network_type_label" style="@style/info_label" />
+ <TextView android:id="@+id/voice_network" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- Network Type -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_data_network_type_label" style="@style/info_label" />
+ <TextView android:id="@+id/data_network" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- Call Status -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_call_status_label" style="@style/info_label" />
+ <TextView android:id="@+id/call" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- Roaming -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_roaming_label" style="@style/info_label" />
+ <TextView android:id="@+id/roaming" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- Preferred Network Type -->
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/radio_info_set_perferred_label"
+ style="@style/info_label"
+ />
+
+ <Spinner android:id="@+id/preferredNetworkType"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+
+ <!-- Horizontal Rule -->
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1dip"
+ android:background="#000000" />
+
<!-- Ping stats -->
<Button android:id="@+id/ping_test"
android:textSize="14sp"
@@ -65,41 +126,11 @@
<TextView android:id="@+id/httpClientTest" style="@style/info_value" />
</LinearLayout>
- <!-- Signal Strength -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_signal_strength_label" style="@style/info_label" />
- <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" />
- <TextView android:id="@+id/location" style="@style/info_value" />
- </LinearLayout>
-
- <!-- Neighboring Cids -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_neighboring_location_label"
- style="@style/info_label" />
- <TextView android:id="@+id/neighboring" style="@style/info_value" />
- </LinearLayout>
-
- <!-- CellInfo -->
- <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>
+ <!-- Horizontal Rule -->
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1dip"
+ android:background="#000000" />
<!-- DcRtInfo - DataConnectionRealTimeInfo -->
<LinearLayout style="@style/entry_layout">
@@ -108,30 +139,6 @@
<TextView android:id="@+id/dcrtinfo" style="@style/info_value" />
</LinearLayout>
- <!-- Roaming -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_roaming_label" style="@style/info_label" />
- <TextView android:id="@+id/roaming" style="@style/info_value" />
- </LinearLayout>
-
- <!-- GSM Service -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_gsm_service_label" style="@style/info_label" />
- <TextView android:id="@+id/gsm" style="@style/info_value" />
- </LinearLayout>
-
- <!-- GPRS Service -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_gprs_service_label" style="@style/info_label" />
- <TextView android:id="@+id/gprs" style="@style/info_value" />
- </LinearLayout>
-
- <!-- Network Type -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_network_type_label" style="@style/info_label" />
- <TextView android:id="@+id/network" style="@style/info_value" />
- </LinearLayout>
-
<!-- Message Waiting Indicator -->
<LinearLayout style="@style/entry_layout">
<TextView android:text="@string/radio_info_message_waiting_label" style="@style/info_label" />
@@ -144,39 +151,6 @@
<TextView android:id="@+id/cfi" style="@style/info_value" />
</LinearLayout>
- <!-- Call Status -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_call_status_label" style="@style/info_label" />
- <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" />
- <TextView android:id="@+id/resets" style="@style/info_value" />
- </LinearLayout>
-
- <!-- Attempted Data Connections -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_data_attempts_label"
- style="@style/info_label" />
- <TextView android:id="@+id/attempts" style="@style/info_value" />
- </LinearLayout>
-
- <!-- Successful Data Connections -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_data_successes_label"
- style="@style/info_label" />
- <TextView android:id="@+id/successes" style="@style/info_value" />
- </LinearLayout>
-
- <!-- GSM Disconnects -->
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_gsm_disconnects_label"
- style="@style/info_label" />
- <TextView android:id="@+id/disconnects" style="@style/info_value" />
- </LinearLayout>
-
<!-- PPP Sent -->
<LinearLayout style="@style/entry_layout">
<TextView android:text="@string/radio_info_ppp_sent_label"
@@ -198,58 +172,21 @@
<TextView android:id="@+id/sentSinceReceived" style="@style/info_value" />
</LinearLayout>
- <!-- Preferred Network Type -->
- <TextView
+ <!-- Radio Power -->
+ <Switch android:id="@+id/radio_power"
+ android:textSize="14sp"
+ android:layout_marginTop="8dip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:text="@string/radio_info_set_perferred_label"
- style="@style/info_label"
- />
-
- <Spinner android:id="@+id/preferredNetworkType"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- />
-
- <!-- Radio Power -->
- <Button android:id="@+id/radio_power"
- android:textSize="14sp"
- android:layout_marginTop="8dip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- />
-
- <!-- IMS registration required -->
- <Button android:id="@+id/ims_reg_required"
- android:textSize="14sp"
- android:layout_marginTop="8dip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- />
+ android:text="@string/radio_info_radio_power"/>
<!-- VoLTE provisioned -->
- <Button android:id="@+id/volte_provisioned_flag"
+ <Switch android:id="@+id/volte_provisioned_switch"
android:textSize="14sp"
android:layout_marginTop="8dip"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
- />
-
- <!-- SMS over IMS -->
- <Button android:id="@+id/sms_over_ims"
- android:textSize="14sp"
- android:layout_marginTop="8dip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- />
-
- <!-- LTE ram dump -->
- <Button android:id="@+id/lte_ram_dump"
- android:textSize="14sp"
- android:layout_marginTop="8dip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- />
+ android:text="@string/volte_provisioned_switch_string"/>
<!-- SMSC -->
<RelativeLayout android:layout_width="match_parent"
@@ -303,5 +240,49 @@
android:text="@string/oem_radio_info_label"
/>
+ <!-- Horizontal Rule -->
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1dip"
+ android:background="#000000" />
+
+ <!-- CellInfoListRate Selection -->
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/radio_info_cell_info_refresh_rate"
+ style="@style/info_label"
+ />
+
+ <Spinner android:id="@+id/cell_info_rate_select"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
+
+ <!-- Location -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_signal_location_label" style="@style/info_label" />
+ <TextView android:id="@+id/location" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- Neighboring Cids -->
+ <LinearLayout style="@style/entry_layout">
+ <TextView android:text="@string/radio_info_neighboring_location_label"
+ style="@style/info_label" />
+ <TextView android:id="@+id/neighboring" style="@style/info_value" />
+ </LinearLayout>
+
+ <!-- CellInfo -->
+ <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"
+ android:minHeight="300dip"
+ android:textSize="12sp" />
+ </LinearLayout>
+
</LinearLayout>
</ScrollView>
diff --git a/res/layout/screen_zoom_preview_1.xml b/res/layout/screen_zoom_preview_1.xml
index 4280091..b7d2d15 100644
--- a/res/layout/screen_zoom_preview_1.xml
+++ b/res/layout/screen_zoom_preview_1.xml
@@ -17,7 +17,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:fillViewport="true" >
+ android:fillViewport="true"
+ android:importantForAccessibility="noHideDescendants">
<view class="com.android.settings.TouchBlockingFrameLayout"
android:id="@+id/frame"
@@ -31,8 +32,7 @@
android:paddingTop="@dimen/conversation_message_list_padding"
android:paddingStart="@dimen/conversation_message_list_padding"
android:paddingEnd="@dimen/conversation_message_list_padding"
- android:orientation="vertical"
- android:importantForAccessibility="noHideDescendants">
+ android:orientation="vertical">
<com.android.settings.display.ConversationMessageView
android:layout_width="match_parent"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f14f9b8..a875199 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -57,61 +57,46 @@
<!-- Settings main menu category heading. System (Updates, data, accessibility, about phone). [CHAR LIMIT=40] -->
<string name="header_category_system">System</string>
- <!-- Phone info -->
- <!-- Phone Info screen. Button label to turn on the radio . Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="turn_on_radio">Turn on radio</string>
- <!-- Phone Info screen. Button label to turn off the radio . Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="turn_off_radio">Turn off radio</string>
-
- <!-- Phone SMS over IMS on. Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="sms_over_ims_on">Turn on SMS over IMS</string>
- <!-- Phone SMS over IMS off. Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="sms_over_ims_off">Turn off SMS over IMS</string>
-
- <!-- Phone SMS over IMS IMS registration required on. Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="ims_reg_required_on">Turn on IMS registration required</string>
- <!-- Phone IMS registration required off. Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="ims_reg_required_off">Turn off IMS registration required</string>
+ <!-- Data Connection Enable. Only shown in diagnostic screen, so precise translation is not needed. -->
+ <string name="radio_info_data_connection_enable">Enable Data Connection</string>
+ <!-- Data Connection Disable. Only shown in diagnostic screen, so precise translation is not needed. -->
+ <string name="radio_info_data_connection_disable">Disable Data Connection</string>
<!-- VoLTE provisioning flag on. Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="volte_provisioned_flag_on">Turn on VoLTE provisioned flag</string>
- <!-- VoLTE provisioning flag off. Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="volte_provisioned_flag_off">Turn off VoLTE provisioned flag</string>
+ <string name="volte_provisioned_switch_string">VoLTE Provisioned</string>
- <!-- Phone ram dump on. Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="lte_ram_dump_on">Turn on lte ram dump</string>
- <!-- Phone ram dump off. Only shown in diagnostic screen, so precise translation is not needed. -->
- <string name="lte_ram_dump_off">Turn off lte ram dump</string>
+ <!-- Cell Radio Power. Only shown in diagnostic screen, so precise translation is not needed. -->
+ <string name="radio_info_radio_power">Cellular Radio Power</string>
<!-- Phone Info screen. Menu item label. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_menu_viewADN">View SIM address book</string>
+ <string name="radioInfo_menu_viewADN">View SIM Address Book</string>
<!-- Phone Info screen. Menu item label. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radioInfo_menu_viewFDN">View Fixed Dialing Numbers</string>
<!-- Phone Info screen. Menu item label. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radioInfo_menu_viewSDN">View Service Dialing Numbers</string>
<!-- Phone Info screen. Menu item label. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_menu_getPDP">Get PDP list</string>
+ <string name="radioInfo_menu_getPDP">Get PDP List</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_service_in">In service</string>
+ <string name="radioInfo_service_in">In Service</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_service_out">Out of service</string>
+ <string name="radioInfo_service_out">Out of Service</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_service_emergency">Emergency calls only</string>
+ <string name="radioInfo_service_emergency">Emergency Calls Only</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_service_off">Radio off</string>
+ <string name="radioInfo_service_off">Radio Off</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radioInfo_roaming_in">Roaming</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_roaming_not">Not roaming</string>
+ <string name="radioInfo_roaming_not">Not Roaming</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radioInfo_phone_idle">Idle</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radioInfo_phone_ringing">Ringing</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_phone_offhook">Call in progress</string>
+ <string name="radioInfo_phone_offhook">Call in Progress</string>
<!-- Phone Info screen. Status label. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radioInfo_data_disconnected">Disconnected</string>
@@ -123,7 +108,7 @@
<string name="radioInfo_data_suspended">Suspended</string>
<!-- Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radioInfo_unknown">unknown</string>
+ <string name="radioInfo_unknown">Unknown</string>
<!-- Phone Info screen. Units shown after a value. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radioInfo_display_packets">pkts</string>
<!-- Phone Info screen. Units shown after a value. Used for diagnostic info screens, precise translation isn't needed -->
@@ -402,62 +387,57 @@
<string name="proxy_url_title">"PAC URL: "</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_signal_location_label">Location:</string>
+ <string name="radio_info_signal_location_label">Cell Location Info (deprecated):</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_neighboring_location_label">Neighboring CID:</string>
+ <string name="radio_info_neighboring_location_label">Neighbor Cell Info (deprecated):</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_cellinfo_label">CellInfo:</string>
+ <string name="radio_info_cell_info_refresh_rate">Cell Info Refresh Rate:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_dcrtinfo_label">DcRtInfo:</string>
+ <string name="radio_info_cellinfo_label">All Cell Measurement Info:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_data_attempts_label">Data attempts:</string>
+ <string name="radio_info_dcrtinfo_label">Data Connection Real-Time Info:</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">Data Technology:</string>
+ <string name="radio_info_gprs_service_label">Data Service:</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 -->
<string name="radio_info_imei_label">IMEI:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_call_redirect_label">Call redirect:</string>
+ <string name="radio_info_call_redirect_label">Call Redirect:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_ppp_resets_label">Number of PPP reset since boot:</string>
+ <string name="radio_info_ppp_resets_label">Number of PPP Reset Since Boot:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_gsm_disconnects_label">GSM disconnects:</string>
+ <string name="radio_info_current_network_label">Current Network:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_current_network_label">Current network:</string>
+ <string name="radio_info_ppp_received_label">Data Received:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_data_successes_label">Data successes:</string>
+ <string name="radio_info_gsm_service_label">Voice Service:</string>
<!-- 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>
+ <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 -->
- <string name="radio_info_gsm_service_label">Voice Technology:</string>
+ <string name="radio_info_call_status_label">Voice Call Status:</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>
+ <string name="radio_info_ppp_sent_label">Data Sent:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_call_status_label">Call status:</string>
+ <string name="radio_info_message_waiting_label">Message Waiting:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_ppp_sent_label">PPP sent:</string>
+ <string name="radio_info_phone_number_label">Phone Number:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_radio_resets_label">Radio resets:</string>
+ <string name="radio_info_band_mode_label">Select Radio Band</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_message_waiting_label">Message waiting:</string>
+ <string name="radio_info_voice_network_type_label">Voice 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_phone_number_label">Phone number:</string>
+ <string name="radio_info_data_network_type_label">Data 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_band_mode_label">Select radio band</string>
- <!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_network_type_label">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_set_perferred_label">Set preferred network type:</string>
+ <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_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_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>
+ <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 -->
- <string name="ping_test_label">Run ping test</string>
+ <string name="ping_test_label">Run Ping Test</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radio_info_smsc_label">SMSC:</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
@@ -465,15 +445,15 @@
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="radio_info_smsc_refresh_label">Refresh</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
- <string name="radio_info_toggle_dns_check_label">Toggle DNS check</string>
+ <string name="radio_info_toggle_dns_check_label">Toggle DNS Check</string>
<!-- Radio Info screen. Label for a status item. Used for diagnostic info screens, precise translation isn't needed -->
<string name="oem_radio_info_label">OEM-specific Info/Settings</string>
<!-- Band Mode Selection -->
<!-- Band mode screen. Title of activity. -->
- <string name="band_mode_title">Set GSM/UMTS band</string>
+ <string name="band_mode_title">Set Radio Band Mode</string>
<!-- Band mode screen. Loading message. -->
- <string name="band_mode_loading">Loading band list\u2026</string>
+ <string name="band_mode_loading">Loading Band List\u2026</string>
<!-- Band mode screen. Button caption to set the bandmode. -->
<string name="band_mode_set">Set</string>
<!-- Band mode screen. Status message when unsuccessful. -->
@@ -3089,6 +3069,13 @@
<!-- Message to be used to explain the user that he needs to enter his work password to continue a
particular operation. [CHAR LIMIT=70]-->
<string name="lockpassword_confirm_your_password_generic_profile">Enter your work password to continue</string>
+ <!-- An explanation text that the pattern needs to be solved since the device has just been restarted. [CHAR LIMIT=80] -->
+ <string name="lockpassword_strong_auth_required_reason_restart_pattern">Pattern required after device restarts</string>
+ <!-- An explanation text that the pin needs to be entered since the device has just been restarted. [CHAR LIMIT=80] -->
+ <string name="lockpassword_strong_auth_required_reason_restart_pin">PIN required after device restarts</string>
+
+ <!-- An explanation text that the password needs to be entered since the device has just been restarted. [CHAR LIMIT=80] -->
+ <string name="lockpassword_strong_auth_required_reason_restart_password">Password required after device restarts</string>
<!-- Security & location settings screen, change security method screen instruction if user
enters incorrect PIN [CHAR LIMIT=30] -->
@@ -7369,7 +7356,7 @@
<!-- Message of the dialog box to confirm resetting rate-limiting in the system service ShortcutManager. [CHAR_LIMIT=none] -->
<string name="confirm_reset_shortcut_manager_throttling_message">Reset ShortcutManager rate-limiting counters?</string>
- <!-- Title of notification suggestion during optional steps of setup. [CHAR_LIMIT=40] -->
+ <!-- Title of notification suggestion during optional steps of setup. [CHAR_LIMIT=60] -->
<string name="notification_suggestion_title">Control lock screen notifications</string>
<!-- Summary of notification suggestion during optional steps of setup. [CHAR_LIMIT=80] -->
<string name="notification_suggestion_summary">Show or hide notification content</string>
@@ -7392,4 +7379,7 @@
<!-- [CHAR LIMIT=25] Bluetooth is disabled. -->
<string name="bluetooth_disabled">Disabled</string>
+ <!-- [CHAR LIMIT=60] Name of dev option called demo mode -->
+ <string name="demo_mode">Demo mode</string>
+
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 45d2c11..0eb566c 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -357,6 +357,11 @@
<item name="android:textColor">@color/warning</item>
</style>
+ <style name="TextAppearance.ConfirmDeviceCredentialsStrongAuthRequiredText"
+ parent="android:TextAppearance.Material.Body1">
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
+ </style>
+
<style name="TextAppearance.Small.SwitchBar">
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textStyle">normal</item>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index c85a4f1..427e11f 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -198,8 +198,8 @@
</style>
<style name="ThemeOverlay.SwitchBar.Settings" parent="@android:style/ThemeOverlay.Material.Dark.ActionBar">
- <item name="switchBarMarginStart">@dimen/switchbar_margin_start</item>
- <item name="switchBarMarginEnd">@dimen/switchbar_margin_end</item>
+ <item name="switchBarMarginStart">@dimen/switchbar_subsettings_margin_start</item>
+ <item name="switchBarMarginEnd">@dimen/switchbar_subsettings_margin_end</item>
<item name="switchBarBackgroundColor">@color/switchbar_background_color</item>
</style>
diff --git a/res/xml/development_prefs.xml b/res/xml/development_prefs.xml
index 7415464..e737ba8 100644
--- a/res/xml/development_prefs.xml
+++ b/res/xml/development_prefs.xml
@@ -91,6 +91,12 @@
android:key="ota_disable_automatic_update"
android:title="@string/ota_disable_automatic_update" />
+ <PreferenceScreen
+ android:key="demo_mode"
+ android:title="@string/demo_mode">
+ <intent android:action="com.android.settings.action.DEMO_MODE" />
+ </PreferenceScreen>
+
<PreferenceCategory android:key="debug_debugging_category"
android:title="@string/debug_debugging_category">
diff --git a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
index 16b028f..0572bcf 100644
--- a/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
+++ b/src/com/android/settings/ConfirmDeviceCredentialBaseFragment.java
@@ -66,6 +66,7 @@
PACKAGE + ".ConfirmCredentials.showWhenLocked";
private FingerprintUiHelper mFingerprintHelper;
+ private boolean mIsStrongAuthRequired;
private boolean mAllowFpAuthentication;
protected Button mCancelButton;
protected ImageView mFingerprintIcon;
@@ -73,6 +74,7 @@
protected int mUserId;
protected LockPatternUtils mLockPatternUtils;
protected TextView mErrorTextView;
+ protected TextView mStrongAuthRequiredTextView;
protected final Handler mHandler = new Handler();
@Override
@@ -85,7 +87,9 @@
mUserId = Utils.getUserIdFromBundle(getActivity(), intent.getExtras());
final UserManager userManager = UserManager.get(getActivity());
mEffectiveUserId = userManager.getCredentialOwnerProfile(mUserId);
- mAllowFpAuthentication = mAllowFpAuthentication && !isFingerprintDisabledByAdmin();
+ mIsStrongAuthRequired = isStrongAuthRequired();
+ mAllowFpAuthentication = mAllowFpAuthentication && !isFingerprintDisabledByAdmin()
+ && !mIsStrongAuthRequired;
mLockPatternUtils = new LockPatternUtils(getActivity());
}
@@ -93,6 +97,11 @@
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mCancelButton = (Button) view.findViewById(R.id.cancelButton);
+ if (mStrongAuthRequiredTextView != null) {
+ // INIVISIBLE instead of GONE because it also acts as a weighted spacer
+ mStrongAuthRequiredTextView.setVisibility(
+ mIsStrongAuthRequired ? View.VISIBLE : View.INVISIBLE);
+ }
mFingerprintIcon = (ImageView) view.findViewById(R.id.fingerprintIcon);
mFingerprintHelper = new FingerprintUiHelper(
mFingerprintIcon,
@@ -123,6 +132,10 @@
return (disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT) != 0;
}
+ private boolean isStrongAuthRequired() {
+ return !(UserManager.get(getContext()).isUserUnlocked(mEffectiveUserId));
+ }
+
@Override
public void onResume() {
super.onResume();
diff --git a/src/com/android/settings/ConfirmLockPassword.java b/src/com/android/settings/ConfirmLockPassword.java
index d7bdb8b..ca4be6c 100644
--- a/src/com/android/settings/ConfirmLockPassword.java
+++ b/src/com/android/settings/ConfirmLockPassword.java
@@ -124,6 +124,18 @@
|| DevicePolicyManager.PASSWORD_QUALITY_COMPLEX == storedQuality
|| DevicePolicyManager.PASSWORD_QUALITY_MANAGED == storedQuality;
+ // Strong auth is required when the user is locked.
+ // Currently a user does not get locked again until the device restarts. Show the
+ // hint text as "device has just been restarted".
+ mStrongAuthRequiredTextView = (TextView) view.findViewById(R.id.strongAuthRequiredText);
+ if (mIsAlpha) {
+ mStrongAuthRequiredTextView.setText(
+ R.string.lockpassword_strong_auth_required_reason_restart_password);
+ } else {
+ mStrongAuthRequiredTextView.setText(
+ R.string.lockpassword_strong_auth_required_reason_restart_pin);
+ }
+
mImm = (InputMethodManager) getActivity().getSystemService(
Context.INPUT_METHOD_SERVICE);
diff --git a/src/com/android/settings/ConfirmLockPattern.java b/src/com/android/settings/ConfirmLockPattern.java
index 0a52d21..875fcb7 100644
--- a/src/com/android/settings/ConfirmLockPattern.java
+++ b/src/com/android/settings/ConfirmLockPattern.java
@@ -118,6 +118,7 @@
mHeaderTextView = (TextView) view.findViewById(R.id.headerText);
mLockPatternView = (LockPatternView) view.findViewById(R.id.lockPattern);
mDetailsTextView = (TextView) view.findViewById(R.id.detailsText);
+ mStrongAuthRequiredTextView = (TextView) view.findViewById(R.id.strongAuthRequiredText);
mErrorTextView = (TextView) view.findViewById(R.id.errorText);
mLeftSpacerLandscape = view.findViewById(R.id.leftSpacer);
mRightSpacerLandscape = view.findViewById(R.id.rightSpacer);
@@ -176,6 +177,12 @@
FRAGMENT_TAG_CHECK_LOCK_RESULT).commit();
}
+ // Strong auth is required when the user is locked.
+ // Currently a user does not get locked again until the device restarts. Show the
+ // hint text as "device has just been restarted".
+ mStrongAuthRequiredTextView.setText(
+ R.string.lockpassword_strong_auth_required_reason_restart_pattern);
+
return view;
}
diff --git a/src/com/android/settings/CredentialStorage.java b/src/com/android/settings/CredentialStorage.java
index 03bf7b3..6cdf0b9 100644
--- a/src/com/android/settings/CredentialStorage.java
+++ b/src/com/android/settings/CredentialStorage.java
@@ -344,13 +344,12 @@
// Clear all the users credentials could have been installed in for this user.
final UserManager um = (UserManager) getSystemService(USER_SERVICE);
- for (UserInfo pi : um.getProfiles(UserHandle.getUserId(Process.myUid()))) {
+ for (int userId : um.getProfileIdsWithDisabled(UserHandle.myUserId())) {
for (int uid : SYSTEM_CREDENTIAL_UIDS) {
- mKeyStore.clearUid(UserHandle.getUid(pi.id, uid));
+ mKeyStore.clearUid(UserHandle.getUid(userId, uid));
}
}
-
try {
KeyChainConnection keyChainConnection = KeyChain.bind(CredentialStorage.this);
try {
diff --git a/src/com/android/settings/PreviewPagerAdapter.java b/src/com/android/settings/PreviewPagerAdapter.java
index 485ac8f..20d1761 100644
--- a/src/com/android/settings/PreviewPagerAdapter.java
+++ b/src/com/android/settings/PreviewPagerAdapter.java
@@ -15,6 +15,8 @@
*/
package com.android.settings;
+import android.animation.Animator;
+import android.animation.Animator.AnimatorListener;
import android.content.Context;
import android.content.res.Configuration;
import android.support.v4.view.PagerAdapter;
@@ -34,8 +36,6 @@
*/
public class PreviewPagerAdapter extends PagerAdapter {
- private FrameLayout[] mPreviewFrames;
-
/** Duration to use when cross-fading between previews. */
private static final long CROSS_FADE_DURATION_MS = 400;
@@ -45,6 +45,12 @@
/** Interpolator to use when cross-fading between previews. */
private static final Interpolator FADE_OUT_INTERPOLATOR = new AccelerateInterpolator();
+ private final FrameLayout[] mPreviewFrames;
+
+ private Runnable mAnimationEndAction;
+
+ private int mAnimationCounter;
+
public PreviewPagerAdapter(Context context, int[] previewSampleResIds,
Configuration[] configurations) {
mPreviewFrames = new FrameLayout[previewSampleResIds.length];
@@ -54,9 +60,6 @@
mPreviewFrames[i].setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT));
- mPreviewFrames[i].setContentDescription(
- context.getString(R.string.preview_page_indicator_content_description, i + 1,
- previewSampleResIds.length));
for (Configuration configuration : configurations) {
// Create a new configuration for the specified value. It won't
@@ -95,6 +98,14 @@
return (view == object);
}
+ boolean isAnimating() {
+ return mAnimationCounter > 0;
+ }
+
+ void setAnimationEndAction(Runnable action) {
+ mAnimationEndAction = action;
+ }
+
void setPreviewLayer(int newIndex, int currentIndex, int currentItem, boolean animate) {
for (FrameLayout previewFrame : mPreviewFrames) {
if (currentIndex >= 0) {
@@ -104,6 +115,7 @@
.alpha(0)
.setInterpolator(FADE_OUT_INTERPOLATOR)
.setDuration(CROSS_FADE_DURATION_MS)
+ .setListener(new PreviewFrameAnimatorListener())
.withEndAction(new Runnable() {
@Override
public void run() {
@@ -122,6 +134,7 @@
.alpha(1)
.setInterpolator(FADE_IN_INTERPOLATOR)
.setDuration(CROSS_FADE_DURATION_MS)
+ .setListener(new PreviewFrameAnimatorListener())
.withStartAction(new Runnable() {
@Override
public void run() {
@@ -134,4 +147,34 @@
}
}
}
+
+ private void runAnimationEndAction() {
+ if (mAnimationEndAction != null && !isAnimating()) {
+ mAnimationEndAction.run();
+ mAnimationEndAction = null;
+ }
+ }
+
+ private class PreviewFrameAnimatorListener implements AnimatorListener {
+ @Override
+ public void onAnimationStart(Animator animation) {
+ mAnimationCounter++;
+ }
+
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ mAnimationCounter--;
+ runAnimationEndAction();
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ // Empty method.
+ }
+
+ @Override
+ public void onAnimationRepeat(Animator animation) {
+ // Empty method.
+ }
+ }
}
diff --git a/src/com/android/settings/PreviewSeekBarPreferenceFragment.java b/src/com/android/settings/PreviewSeekBarPreferenceFragment.java
index bac146d..aa663cf 100644
--- a/src/com/android/settings/PreviewSeekBarPreferenceFragment.java
+++ b/src/com/android/settings/PreviewSeekBarPreferenceFragment.java
@@ -79,7 +79,16 @@
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
- commit();
+ if (mPreviewPagerAdapter.isAnimating()) {
+ mPreviewPagerAdapter.setAnimationEndAction(new Runnable() {
+ @Override
+ public void run() {
+ commit();
+ }
+ });
+ } else {
+ commit();
+ }
mSeekByTouch = false;
}
}
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index 7ed70c7..4a1c887 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -46,8 +46,10 @@
import android.telephony.CellSignalStrengthWcdma;
import android.telephony.DataConnectionRealTimeInfo;
import android.telephony.NeighboringCellInfo;
+import android.telephony.PreciseCallState;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
+import android.telephony.SignalStrength;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.telephony.cdma.CdmaCellLocation;
@@ -60,8 +62,11 @@
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
+import android.widget.CompoundButton;
+import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.Spinner;
+import android.widget.Switch;
import android.widget.TextView;
import com.android.ims.ImsConfig;
@@ -70,7 +75,6 @@
import com.android.internal.telephony.Phone;
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;
@@ -82,11 +86,60 @@
import java.util.List;
public class RadioInfo extends Activity {
- private final String TAG = "phone";
+ private static final String TAG = "RadioInfo";
- private static final int EVENT_PHONE_STATE_CHANGED = 100;
- private static final int EVENT_SIGNAL_STRENGTH_CHANGED = 200;
- private static final int EVENT_SERVICE_STATE_CHANGED = 300;
+ private static final String[] mPreferredNetworkLabels = {
+ "WCDMA preferred",
+ "GSM only",
+ "WCDMA only",
+ "GSM auto (PRL)",
+ "CDMA auto (PRL)",
+ "CDMA only",
+ "EvDo only",
+ "Global auto (PRL)",
+ "LTE/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 static final int CELL_INFO_LIST_RATE_DISABLED = Integer.MAX_VALUE;
+ private static final int CELL_INFO_LIST_RATE_MAX = 0;
+
+ //Values in must match mCellInfoRefreshRates
+ private static final String[] mCellInfoRefreshRateLabels = {
+ "Disabled",
+ "Immediate",
+ "Min 5s",
+ "Min 10s",
+ "Min 60s"
+ };
+
+ //Values in seconds, must match mCellInfoRefreshRateLabels
+ private static final int mCellInfoRefreshRates[] = {
+ CELL_INFO_LIST_RATE_DISABLED,
+ CELL_INFO_LIST_RATE_MAX,
+ 5000,
+ 10000,
+ 60000
+ };
+
+ private void log(String s) {
+ Log.d(TAG, s);
+ }
+
private static final int EVENT_CFI_CHANGED = 302;
private static final int EVENT_QUERY_PREFERRED_TYPE_DONE = 1000;
@@ -101,9 +154,6 @@
private static final int MENU_ITEM_GET_PDP_LIST = 4;
private static final int MENU_ITEM_TOGGLE_DATA = 5;
- static final String ENABLE_DATA_STR = "Enable data connection";
- static final String DISABLE_DATA_STR = "Disable data connection";
-
private TextView mDeviceId; //DeviceId is the IMEI in GSM and the MEID in CDMA
private TextView number;
private TextView callState;
@@ -111,7 +161,8 @@
private TextView roamingState;
private TextView gsmState;
private TextView gprsState;
- private TextView network;
+ private TextView voiceNetwork;
+ private TextView dataNetwork;
private TextView dBm;
private TextView mMwi;
private TextView mCfi;
@@ -119,11 +170,6 @@
private TextView mNeighboringCids;
private TextView mCellInfo;
private TextView mDcRtInfoTv;
- private TextView resets;
- private TextView attempts;
- private TextView successes;
- private TextView disconnects;
- private TextView sentSinceReceived;
private TextView sent;
private TextView received;
private TextView mPingHostnameV4;
@@ -131,19 +177,20 @@
private TextView mHttpClientTest;
private TextView dnsCheckState;
private EditText smsc;
- private Button radioPowerButton;
- private Button cellInfoListRateButton;
+ private Switch radioPowerOnSwitch;
+ private Button cellInfoRefreshRateButton;
private Button dnsCheckToggleButton;
private Button pingTestButton;
private Button updateSmscButton;
private Button refreshSmscButton;
private Button oemInfoButton;
+ private Switch imsVoLteProvisionedSwitch;
private Spinner preferredNetworkType;
+ private Spinner cellInfoRefreshRateSpinner;
private TelephonyManager mTelephonyManager;
private ImsManager mImsManager = null;
private Phone phone = null;
- private PhoneStateIntentReceiver mPhoneStateReceiver;
private String mPingHostnameResultV4;
private String mPingHostnameResultV6;
@@ -156,13 +203,12 @@
private List<NeighboringCellInfo> mNeighboringCellResult = null;
private int mPreferredNetworkTypeResult;
+ private int mCellInfoRefreshRateIndex;
- private PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
+ private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
@Override
public void onDataConnectionStateChanged(int state) {
updateDataState();
- updateDataStats();
- updatePdpList();
updateNetworkType();
}
@@ -172,6 +218,17 @@
}
@Override
+ public void onCallStateChanged(int state, String incomingNumber) {
+ updateNetworkType();
+ updatePhoneState(state);
+ }
+
+ @Override
+ public void onPreciseCallStateChanged(PreciseCallState preciseState) {
+ updateNetworkType();
+ }
+
+ @Override
public void onCellLocationChanged(CellLocation location) {
updateLocation(location);
}
@@ -200,6 +257,21 @@
log("onDataConnectionRealTimeInfoChanged: dcRtInfo=" + dcRtInfo);
updateDcRtInfoTv(dcRtInfo);
}
+
+ @Override
+ public void onSignalStrengthsChanged(SignalStrength signalStrength) {
+ log("onSignalStrengthChanged: SignalStrength=" +signalStrength);
+ updateSignalStrength(signalStrength);
+ }
+
+ @Override
+ public void onServiceStateChanged(ServiceState serviceState) {
+ log("onServiceStateChanged: ServiceState=" + serviceState);
+ updateServiceState(serviceState);
+ updateRadioPowerState();
+ updateNetworkType();
+ updateImsVoLteProvisionedState();
+ }
};
private void updatePreferredNetworkType(int type) {
@@ -218,20 +290,6 @@
public void handleMessage(Message msg) {
AsyncResult ar;
switch (msg.what) {
- case EVENT_PHONE_STATE_CHANGED:
- updatePhoneState();
- break;
-
- case EVENT_SIGNAL_STRENGTH_CHANGED:
- updateSignalStrength();
- break;
-
- case EVENT_SERVICE_STATE_CHANGED:
- updateServiceState();
- updatePowerState();
- updateImsVoLteProvisionedState();
- break;
-
case EVENT_QUERY_PREFERRED_TYPE_DONE:
ar= (AsyncResult) msg.obj;
if (ar.exception == null && ar.result != null) {
@@ -293,7 +351,8 @@
roamingState = (TextView) findViewById(R.id.roaming);
gsmState = (TextView) findViewById(R.id.gsm);
gprsState = (TextView) findViewById(R.id.gprs);
- network = (TextView) findViewById(R.id.network);
+ voiceNetwork = (TextView) findViewById(R.id.voice_network);
+ dataNetwork = (TextView) findViewById(R.id.data_network);
dBm = (TextView) findViewById(R.id.dbm);
mMwi = (TextView) findViewById(R.id.mwi);
mCfi = (TextView) findViewById(R.id.cfi);
@@ -303,11 +362,6 @@
mCellInfo.setTypeface(Typeface.MONOSPACE);
mDcRtInfoTv = (TextView) findViewById(R.id.dcrtinfo);
- resets = (TextView) findViewById(R.id.resets);
- attempts = (TextView) findViewById(R.id.attempts);
- successes = (TextView) findViewById(R.id.successes);
- disconnects = (TextView) findViewById(R.id.disconnects);
- sentSinceReceived = (TextView) findViewById(R.id.sentSinceReceived);
sent = (TextView) findViewById(R.id.sent);
received = (TextView) findViewById(R.id.received);
smsc = (EditText) findViewById(R.id.smsc);
@@ -321,25 +375,16 @@
android.R.layout.simple_spinner_item, mPreferredNetworkLabels);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
preferredNetworkType.setAdapter(adapter);
- preferredNetworkType.setOnItemSelectedListener(mPreferredNetworkHandler);
- radioPowerButton = (Button) findViewById(R.id.radio_power);
- radioPowerButton.setOnClickListener(mPowerButtonHandler);
+ cellInfoRefreshRateSpinner = (Spinner) findViewById(R.id.cell_info_rate_select);
+ ArrayAdapter<String> cellInfoAdapter = new ArrayAdapter<String>(this,
+ android.R.layout.simple_spinner_item, mCellInfoRefreshRateLabels);
+ cellInfoAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+ cellInfoRefreshRateSpinner.setAdapter(cellInfoAdapter);
- cellInfoListRateButton = (Button) findViewById(R.id.cell_info_list_rate);
- cellInfoListRateButton.setOnClickListener(mCellInfoListRateHandler);
+ imsVoLteProvisionedSwitch = (Switch) findViewById(R.id.volte_provisioned_switch);
- imsRegRequiredButton = (Button) findViewById(R.id.ims_reg_required);
- imsRegRequiredButton.setOnClickListener(mImsRegRequiredHandler);
-
- imsVoLteProvisionedButton = (Button) findViewById(R.id.volte_provisioned_flag);
- imsVoLteProvisionedButton.setOnClickListener(mImsVoLteProvisionedHandler);
-
- smsOverImsButton = (Button) findViewById(R.id.sms_over_ims);
- smsOverImsButton.setOnClickListener(mSmsOverImsHandler);
-
- lteRamDumpButton = (Button) findViewById(R.id.lte_ram_dump);
- lteRamDumpButton.setOnClickListener(mLteRamDumpHandler);
+ radioPowerOnSwitch = (Switch) findViewById(R.id.radio_power);
pingTestButton = (Button) findViewById(R.id.ping_test);
pingTestButton.setOnClickListener(mPingButtonHandler);
@@ -359,11 +404,7 @@
oemInfoButton.setEnabled(false);
}
- mPhoneStateReceiver = new PhoneStateIntentReceiver(this, mHandler);
- mPhoneStateReceiver.notifySignalStrength(EVENT_SIGNAL_STRENGTH_CHANGED);
- mPhoneStateReceiver.notifyServiceState(EVENT_SERVICE_STATE_CHANGED);
- mPhoneStateReceiver.notifyPhoneCallState(EVENT_PHONE_STATE_CHANGED);
-
+ mCellInfoRefreshRateIndex = CELL_INFO_LIST_RATE_DISABLED;
mPreferredNetworkTypeResult = mPreferredNetworkLabels.length - 1; //Unknown
//FIXME: Replace with TelephonyManager call
@@ -379,22 +420,15 @@
log("Started onResume");
- updatePhoneState();
- updateSignalStrength();
updateMessageWaiting();
updateCallRedirect();
- updateServiceState();
updateDataState();
- updateDataStats();
updateDataStats2();
- updatePowerState();
- updateCellInfoListRate();
- updateImsRegRequiredState();
+ updateRadioPowerState();
updateImsVoLteProvisionedState();
- updateSmsOverImsState();
- updateLteRamDumpState();
updateProperties();
updateDnsCheckState();
+ updateNetworkType();
updateNeighboringCids(mNeighboringCellResult);
updateLocation(mCellLocationResult);
@@ -404,14 +438,24 @@
mPingHostnameV6.setText(mPingHostnameResultV6);
mHttpClientTest.setText(mHttpClientTestResult);
- mPhoneStateReceiver.registerIntent();
+ //move these here so that the initial updates in create don't cause values to reset
+ cellInfoRefreshRateSpinner.setOnItemSelectedListener(mCellInfoRefreshRateHandler);
+ preferredNetworkType.setOnItemSelectedListener(mPreferredNetworkHandler);
+ radioPowerOnSwitch.setOnCheckedChangeListener(mRadioPowerOnChangeListener);
+ imsVoLteProvisionedSwitch.setOnCheckedChangeListener(mImsVoLteCheckedChangeListener);
+
mTelephonyManager.listen(mPhoneStateListener,
- PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
+ PhoneStateListener.LISTEN_CALL_STATE
+ //b/27803938 - RadioInfo currently cannot read PRECISE_CALL_STATE
+ // | PhoneStateListener.LISTEN_PRECISE_CALL_STATE
+ | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
| PhoneStateListener.LISTEN_DATA_ACTIVITY
| PhoneStateListener.LISTEN_CELL_LOCATION
| PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
| PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR
| PhoneStateListener.LISTEN_CELL_INFO
+ | PhoneStateListener.LISTEN_SERVICE_STATE
+ | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
| PhoneStateListener.LISTEN_DATA_CONNECTION_REAL_TIME_INFO);
}
@@ -421,7 +465,6 @@
log("onPause: unregister phone & data intents");
- mPhoneStateReceiver.unregisterIntent();
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
}
@@ -438,7 +481,12 @@
mPingHostnameV6.setText(mPingHostnameResultV6);
mHttpClientTest.setText(mHttpClientTestResult);
- mPreferredNetworkTypeResult = b.getInt("mPreferredNetworkTypeResult", 0);
+ mPreferredNetworkTypeResult = b.getInt("mPreferredNetworkTypeResult",
+ mPreferredNetworkLabels.length - 1);
+
+ mCellInfoRefreshRateIndex = b.getInt("mCellInfoRefreshRateIndex", 0);
+
+ cellInfoRefreshRateSpinner.setSelection(mCellInfoRefreshRateIndex);
}
@Override
@@ -446,7 +494,11 @@
outState.putString("mPingHostnameResultV4", mPingHostnameResultV4);
outState.putString("mPingHostnameResultV6", mPingHostnameResultV6);
outState.putString("mHttpClientTestResult", mHttpClientTestResult);
+
outState.putInt("mPreferredNetworkTypeResult", mPreferredNetworkTypeResult);
+
+ outState.putInt("mCellInfoRefreshRateIndex", mCellInfoRefreshRateIndex);
+
}
@Override
@@ -463,7 +515,7 @@
menu.add(1, MENU_ITEM_GET_PDP_LIST,
0, R.string.radioInfo_menu_getPDP).setOnMenuItemClickListener(mGetPdpList);
menu.add(1, MENU_ITEM_TOGGLE_DATA,
- 0, DISABLE_DATA_STR).setOnMenuItemClickListener(mToggleData);
+ 0, R.string.radio_info_data_connection_disable).setOnMenuItemClickListener(mToggleData);
return true;
}
@@ -477,10 +529,10 @@
switch (state) {
case TelephonyManager.DATA_CONNECTED:
case TelephonyManager.DATA_SUSPENDED:
- item.setTitle(DISABLE_DATA_STR);
+ item.setTitle(R.string.radio_info_data_connection_disable);
break;
case TelephonyManager.DATA_DISCONNECTED:
- item.setTitle(ENABLE_DATA_STR);
+ item.setTitle(R.string.radio_info_data_connection_enable);
break;
default:
visible = false;
@@ -490,35 +542,6 @@
return true;
}
- private boolean isRadioOn() {
- //FIXME: Replace with a TelephonyManager call
- return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
- }
-
- private void updatePowerState() {
- String buttonText = isRadioOn() ?
- getString(R.string.turn_off_radio) :
- getString(R.string.turn_on_radio);
- radioPowerButton.setText(buttonText);
- }
-
- private void updateCellInfoListRate() {
- 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() ?
@@ -526,22 +549,12 @@
}
private final void
- updateSignalStrength() {
- // TODO PhoneStateIntentReceiver is deprecated and PhoneStateListener
- // should probably used instead.
- int state = mPhoneStateReceiver.getServiceState().getState();
+ updateSignalStrength(SignalStrength signalStrength) {
Resources r = getResources();
- if ((ServiceState.STATE_OUT_OF_SERVICE == state) ||
- (ServiceState.STATE_POWER_OFF == state)) {
- dBm.setText("0");
- }
+ int signalDbm = signalStrength.getDbm();
- int signalDbm = mPhoneStateReceiver.getSignalStrengthDbm();
-
- if (-1 == signalDbm) signalDbm = 0;
-
- int signalAsu = mPhoneStateReceiver.getSignalStrengthLevelAsu();
+ int signalAsu = signalStrength.getAsuLevel();
if (-1 == signalAsu) signalAsu = 0;
@@ -635,15 +648,14 @@
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",
+ return String.format("%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-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(cidGsm.getArfcn()),
+ getCellInfoDisplayString(cidGsm.getBsic()),
getCellInfoDisplayString(ssGsm.getDbm()));
}
@@ -652,13 +664,14 @@
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",
+ "%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-6.6s %-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(cidLte.getEarfcn()),
getCellInfoDisplayString(ssLte.getDbm()),
getCellInfoDisplayString(ssLte.getRsrq()),
getCellInfoDisplayString(ssLte.getTimingAdvance()));
@@ -668,12 +681,13 @@
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",
+ return String.format("%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-3.3s %-4.4s\n",
ci.isRegistered() ? "S " : " ",
getCellInfoDisplayString(cidWcdma.getMcc()),
getCellInfoDisplayString(cidWcdma.getMnc()),
getCellInfoDisplayString(cidWcdma.getLac()),
getCellInfoDisplayString(cidWcdma.getCid()),
+ getCellInfoDisplayString(cidWcdma.getUarfcn()),
getCellInfoDisplayString(cidWcdma.getPsc()),
getCellInfoDisplayString(ssWcdma.getDbm()));
}
@@ -700,18 +714,18 @@
}
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");
+ "LTE\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-6.6s %-4.4s %-4.4s %-2.2s\n",
+ "SRV", "MCC", "MNC", "TAC", "CID", "PCI", "EARFCN", "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 += String.format("WCDMA\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-3.3s %-4.4s\n",
+ "SRV", "MCC", "MNC", "LAC", "CID", "UARFCN", "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 += String.format("GSM\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-4.4s %-4.4s\n",
+ "SRV", "MCC", "MNC", "LAC", "CID", "ARFCN", "BSIC", "RSSI");
value += gsmCells.toString();
}
if (cdmaCells.length() != 0) {
@@ -747,8 +761,7 @@
private final void
- updateServiceState() {
- ServiceState serviceState = mPhoneStateReceiver.getServiceState();
+ updateServiceState(ServiceState serviceState) {
int state = serviceState.getState();
Resources r = getResources();
String display = r.getString(R.string.radioInfo_unknown);
@@ -778,19 +791,18 @@
}
private final void
- updatePhoneState() {
- PhoneConstants.State state = mPhoneStateReceiver.getPhoneState();
+ updatePhoneState(int state) {
Resources r = getResources();
String display = r.getString(R.string.radioInfo_unknown);
switch (state) {
- case IDLE:
+ case TelephonyManager.CALL_STATE_IDLE:
display = r.getString(R.string.radioInfo_phone_idle);
break;
- case RINGING:
+ case TelephonyManager.CALL_STATE_RINGING:
display = r.getString(R.string.radioInfo_phone_ringing);
break;
- case OFFHOOK:
+ case TelephonyManager.CALL_STATE_OFFHOOK:
display = r.getString(R.string.radioInfo_phone_offhook);
break;
}
@@ -823,11 +835,13 @@
}
private final void updateNetworkType() {
- Resources r = getResources();
- String display = SystemProperties.get(TelephonyProperties.PROPERTY_DATA_NETWORK_TYPE,
- r.getString(R.string.radioInfo_unknown));
-
- network.setText(display);
+ if( phone != null ) {
+ ServiceState ss = phone.getServiceState();
+ dataNetwork.setText(ServiceState.rilRadioTechnologyToString(
+ phone.getServiceState().getRilDataRadioTechnology()));
+ voiceNetwork.setText(ServiceState.rilRadioTechnologyToString(
+ phone.getServiceState().getRilVoiceRadioTechnology()));
+ }
}
private final void
@@ -845,25 +859,6 @@
number.setText(s);
}
- private final void updateDataStats() {
- String s;
-
- s = SystemProperties.get("net.gsm.radio-reset", "0");
- resets.setText(s);
-
- s = SystemProperties.get("net.gsm.attempt-gprs", "0");
- attempts.setText(s);
-
- s = SystemProperties.get("net.gsm.succeed-gprs", "0");
- successes.setText(s);
-
- //s = SystemProperties.get("net.gsm.disconnect", "0");
- //disconnects.setText(s);
-
- s = SystemProperties.get("net.ppp.reset-by-timeout", "0");
- sentSinceReceived.setText(s);
- }
-
private final void updateDataStats2() {
Resources r = getResources();
@@ -1003,48 +998,6 @@
httpClient.start();
}
- private final void updatePdpList() {
- StringBuilder sb = new StringBuilder("========DATA=======\n");
-
-// List<DataConnection> dcs = phone.getCurrentDataConnectionList();
-//
-// for (DataConnection dc : dcs) {
-// sb.append(" State=").append(dc.getStateAsString()).append("\n");
-// if (dc.isActive()) {
-// long timeElapsed =
-// (System.currentTimeMillis() - dc.getConnectionTime())/1000;
-// sb.append(" connected at ")
-// .append(DateUtils.timeString(dc.getConnectionTime()))
-// .append(" and elapsed ")
-// .append(DateUtils.formatElapsedTime(timeElapsed));
-//
-// if (dc instanceof GsmDataConnection) {
-// GsmDataConnection pdp = (GsmDataConnection)dc;
-// sb.append("\n to ")
-// .append(pdp.getApn().toString());
-// }
-// sb.append("\nLinkProperties: ");
-// sb.append(phone.getLinkProperties(phone.getActiveApnTypes()[0]).toString());
-// } else if (dc.isInactive()) {
-// sb.append(" disconnected with last try at ")
-// .append(DateUtils.timeString(dc.getLastFailTime()))
-// .append("\n fail because ")
-// .append(dc.getLastFailCause().toString());
-// } else {
-// if (dc instanceof GsmDataConnection) {
-// GsmDataConnection pdp = (GsmDataConnection)dc;
-// sb.append(" is connecting to ")
-// .append(pdp.getApn().toString());
-// } else {
-// sb.append(" is connecting");
-// }
-// }
-// sb.append("\n===================");
-// }
-
- disconnects.setText(sb.toString());
- }
-
private MenuItem.OnMenuItemClickListener mViewADNCallback = new MenuItem.OnMenuItemClickListener() {
public boolean onMenuItemClick(MenuItem item) {
Intent intent = new Intent(Intent.ACTION_VIEW);
@@ -1128,155 +1081,67 @@
}
};
- 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());
- }
+ private boolean isRadioOn() {
+ //FIXME: Replace with a TelephonyManager call
+ return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
+ }
+
+ private void updateRadioPowerState() {
+ //delightful hack to prevent on-checked-changed calls from
+ //actually forcing the radio preference to its transient/current value.
+ radioPowerOnSwitch.setOnCheckedChangeListener(null);
+ radioPowerOnSwitch.setChecked(isRadioOn());
+ radioPowerOnSwitch.setOnCheckedChangeListener(mRadioPowerOnChangeListener);
+ }
+
+ OnCheckedChangeListener mRadioPowerOnChangeListener = new OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ log("toggle radio power: currently " + (isRadioOn()?"on":"off"));
+ phone.setRadioPower(isChecked);
+ }
};
- class CellInfoListRateHandler implements OnClickListener {
- int rates[] = {Integer.MAX_VALUE, 0, 5000};
- int index = 0;
+ void setImsVoLteProvisionedState( boolean state ) {
+ log(String.format("toggle VoLTE provisioned: %s", ((state) ? "on":"off")));
- public int getRate() {
- return rates[index];
- }
-
- @Override
- public void onClick(View v) {
- index += 1;
- index %= rates.length;
-
- // FIXME: Replace with a TelephonyManager call
- phone.setCellInfoListRate(rates[index]);
- updateCellInfoListRate();
-
- updateAllCellInfo();
- }
- }
- CellInfoListRateHandler mCellInfoListRateHandler = new CellInfoListRateHandler();
-
- private Button imsRegRequiredButton;
- static final String PROPERTY_IMS_REG_REQUIRED = "persist.radio.imsregrequired";
- OnClickListener mImsRegRequiredHandler = new OnClickListener() {
- @Override
- public void onClick(View v) {
- log(String.format("toggle %s: currently %s",
- PROPERTY_IMS_REG_REQUIRED, (isImsRegRequired() ? "on":"off")));
- boolean newValue = !isImsRegRequired();
- SystemProperties.set(PROPERTY_IMS_REG_REQUIRED,
- newValue ? "1":"0");
- updateImsRegRequiredState();
- }
- };
-
- private boolean isImsRegRequired() {
- return SystemProperties.getBoolean(PROPERTY_IMS_REG_REQUIRED, false);
- }
-
- private void updateImsRegRequiredState() {
- log("updateImsRegRequiredState isImsRegRequired()=" + isImsRegRequired());
- String buttonText = isImsRegRequired() ?
- getString(R.string.ims_reg_required_off) :
- getString(R.string.ims_reg_required_on);
- imsRegRequiredButton.setText(buttonText);
- }
-
- private Button smsOverImsButton;
- static final String PROPERTY_SMS_OVER_IMS = "persist.radio.imsallowmtsms";
- OnClickListener mSmsOverImsHandler = new OnClickListener() {
- @Override
- public void onClick(View v) {
- log(String.format("toggle %s: currently %s",
- PROPERTY_SMS_OVER_IMS, (isSmsOverImsEnabled() ? "on":"off")));
- boolean newValue = !isSmsOverImsEnabled();
- SystemProperties.set(PROPERTY_SMS_OVER_IMS, newValue ? "1":"0");
- updateSmsOverImsState();
- }
- };
-
- private boolean isSmsOverImsEnabled() {
- return SystemProperties.getBoolean(PROPERTY_SMS_OVER_IMS, false);
- }
-
- private Button imsVoLteProvisionedButton;
- OnClickListener mImsVoLteProvisionedHandler = new OnClickListener() {
- @Override
- public void onClick(View v) {
- log(String.format("toggle VoLTE provisioned: currently %s",
- (isImsVoLteProvisioned() ? "on":"off")));
- final boolean newValue = !isImsVoLteProvisioned();
- if (phone != 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 {
- mImsManager.getConfigInterface().setProvisionedValue(
- ImsConfig.ConfigConstants.VLT_SETTING_ENABLED,
- newValue? 1 : 0);
- } catch (ImsException e) {
- Log.e(TAG, "setImsVoLteProvisioned() exception:", e);
- }
- }
- });
+ if (phone != null && mImsManager != null) {
+ QueuedWork.singleThreadExecutor().submit(new Runnable() {
+ public void run() {
+ try {
+ mImsManager.getConfigInterface().setProvisionedValue(
+ ImsConfig.ConfigConstants.VLT_SETTING_ENABLED,
+ state? 1 : 0);
+ } catch (ImsException e) {
+ Log.e(TAG, "setImsVoLteProvisioned() exception:", e);
+ }
}
- }
- updateImsVoLteProvisionedState();
+ });
}
- };
+ }
private boolean isImsVoLteProvisioned() {
- if (phone != null) {
- //TODO: Why does this have to be called within the phone's context?
- if(mImsManager != null ) {
- return mImsManager.isVolteProvisionedOnDevice(phone.getContext());
- }
+ if (phone != null && mImsManager != null) {
+ return mImsManager.isVolteEnabledByPlatform(phone.getContext())
+ && mImsManager.isVolteProvisionedOnDevice(phone.getContext());
}
return false;
}
- private void updateImsVoLteProvisionedState() {
- log("updateImsVoLteProvisionedState isImsVoLteProvisioned()=" + isImsVoLteProvisioned());
- String buttonText = isImsVoLteProvisioned() ?
- getString(R.string.volte_provisioned_flag_off) :
- getString(R.string.volte_provisioned_flag_on);
- imsVoLteProvisionedButton.setText(buttonText);
- }
-
- private void updateSmsOverImsState() {
- log("updateSmsOverImsState isSmsOverImsEnabled()=" + isSmsOverImsEnabled());
- String buttonText = isSmsOverImsEnabled() ?
- getString(R.string.sms_over_ims_off) :
- getString(R.string.sms_over_ims_on);
- smsOverImsButton.setText(buttonText);
- }
-
- private Button lteRamDumpButton;
- static final String PROPERTY_LTE_RAM_DUMP = "persist.radio.ramdump";
- OnClickListener mLteRamDumpHandler = new OnClickListener() {
+ OnCheckedChangeListener mImsVoLteCheckedChangeListener = new OnCheckedChangeListener() {
@Override
- public void onClick(View v) {
- log(String.format("toggle %s: currently %s",
- PROPERTY_LTE_RAM_DUMP, (isSmsOverImsEnabled() ? "on":"off")));
- boolean newValue = !isLteRamDumpEnabled();
- SystemProperties.set(PROPERTY_LTE_RAM_DUMP, newValue ? "1":"0");
- updateLteRamDumpState();
- }
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ setImsVoLteProvisionedState(isChecked);
+ }
};
- private boolean isLteRamDumpEnabled() {
- return SystemProperties.getBoolean(PROPERTY_LTE_RAM_DUMP, false);
- }
-
- private void updateLteRamDumpState() {
- log("updateLteRamDumpState isLteRamDumpEnabled()=" + isLteRamDumpEnabled());
- String buttonText = isLteRamDumpEnabled() ?
- getString(R.string.lte_ram_dump_off) :
- getString(R.string.lte_ram_dump_on);
- lteRamDumpButton.setText(buttonText);
+ private void updateImsVoLteProvisionedState() {
+ log("updateImsVoLteProvisionedState isImsVoLteProvisioned()=" + isImsVoLteProvisioned());
+ //delightful hack to prevent on-checked-changed calls from
+ //actually forcing the ims provisioning to its transient/current value.
+ imsVoLteProvisionedSwitch.setOnCheckedChangeListener(null);
+ imsVoLteProvisionedSwitch.setChecked(isImsVoLteProvisioned());
+ imsVoLteProvisionedSwitch.setOnCheckedChangeListener(mImsVoLteCheckedChangeListener);
}
OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
@@ -1336,32 +1201,17 @@
}
};
- private String[] mPreferredNetworkLabels = {
- "WCDMA preferred",
- "GSM only",
- "WCDMA only",
- "GSM auto (PRL)",
- "CDMA auto (PRL)",
- "CDMA only",
- "EvDo only",
- "Global auto (PRL)",
- "LTE/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"};
+ AdapterView.OnItemSelectedListener mCellInfoRefreshRateHandler =
+ new AdapterView.OnItemSelectedListener() {
- private void log(String s) {
- Log.d(TAG, "[RadioInfo] " + s);
- }
+ public void onItemSelected(AdapterView parent, View v, int pos, long id) {
+ mCellInfoRefreshRateIndex = pos;
+ phone.setCellInfoListRate(mCellInfoRefreshRates[pos]);
+ updateAllCellInfo();
+ }
+
+ public void onNothingSelected(AdapterView parent) {
+ }
+ };
+
}
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index 0c3260f..bcb677d 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -706,8 +706,6 @@
private void unifyLocks() {
int profileQuality =
mLockPatternUtils.getKeyguardStoredPasswordQuality(mProfileChallengeUserId);
- mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false,
- mCurrentProfilePassword);
if (profileQuality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
mLockPatternUtils.saveLockPattern(
LockPatternUtils.stringToPattern(mCurrentProfilePassword),
@@ -717,6 +715,8 @@
mCurrentProfilePassword, mCurrentDevicePassword,
profileQuality, MY_USER_ID);
}
+ mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false,
+ mCurrentProfilePassword);
final boolean profilePatternVisibility =
mLockPatternUtils.isVisiblePatternEnabled(mProfileChallengeUserId);
mLockPatternUtils.setVisiblePatternEnabled(profilePatternVisibility, MY_USER_ID);
diff --git a/src/com/android/settings/Utils.java b/src/com/android/settings/Utils.java
index 84bb2dd..527194f 100644
--- a/src/com/android/settings/Utils.java
+++ b/src/com/android/settings/Utils.java
@@ -615,12 +615,10 @@
* @return the managed profile id or UserHandle.USER_NULL if there is none.
*/
public static int getManagedProfileId(UserManager um, int parentUserId) {
- List<UserInfo> profiles = um.getProfiles(parentUserId);
- int numProfiles = profiles.size();
- for (int i = 0; i < numProfiles; ++i) {
- UserInfo profile = profiles.get(i);
- if (profile.id != parentUserId) {
- return profile.id;
+ int[] profileIds = um.getProfileIdsWithDisabled(parentUserId);
+ for (int profileId : profileIds) {
+ if (profileId != parentUserId) {
+ return profileId;
}
}
return UserHandle.USER_NULL;
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java
index 49ef23a..9de3f7a 100644
--- a/src/com/android/settings/applications/ManageApplications.java
+++ b/src/com/android/settings/applications/ManageApplications.java
@@ -23,10 +23,7 @@
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.icu.text.AlphabeticIndex;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.UserHandle;
-import android.os.UserManager;
+import android.os.*;
import android.preference.PreferenceFrameLayout;
import android.text.TextUtils;
import android.util.ArraySet;
@@ -1225,6 +1222,7 @@
// TODO: Can probably hack together with less than full app state.
private final ApplicationsState mAppState;
private final ApplicationsState.Session mSession;
+ private final Handler mHandler;
private SummaryProvider(Context context, SummaryLoader loader) {
mContext = context;
@@ -1232,6 +1230,7 @@
mAppState =
ApplicationsState.getInstance((Application) context.getApplicationContext());
mSession = mAppState.newSession(this);
+ mHandler = new Handler(mAppState.getBackgroundLooper());
}
@Override
@@ -1248,6 +1247,16 @@
mLoader.setSummary(this, mContext.getString(R.string.apps_summary, apps.size()));
}
+ private void postRebuild() {
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ updateSummary(mSession.rebuild(ApplicationsState.FILTER_DOWNLOADED_AND_LAUNCHER,
+ null, false));
+ }
+ });
+ }
+
@Override
public void onRebuildComplete(ArrayList<AppEntry> apps) {
updateSummary(apps);
@@ -1255,20 +1264,17 @@
@Override
public void onPackageListChanged() {
- updateSummary(mSession.rebuild(ApplicationsState.FILTER_DOWNLOADED_AND_LAUNCHER,
- ApplicationsState.ALPHA_COMPARATOR));
+ postRebuild();
}
@Override
public void onLauncherInfoChanged() {
- updateSummary(mSession.rebuild(ApplicationsState.FILTER_DOWNLOADED_AND_LAUNCHER,
- ApplicationsState.ALPHA_COMPARATOR));
+ postRebuild();
}
@Override
public void onLoadEntriesCompleted() {
- updateSummary(mSession.rebuild(ApplicationsState.FILTER_DOWNLOADED_AND_LAUNCHER,
- ApplicationsState.ALPHA_COMPARATOR));
+ postRebuild();
}
@Override
diff --git a/src/com/android/settings/applications/ManageAssist.java b/src/com/android/settings/applications/ManageAssist.java
index 7af967c..6fe966d 100644
--- a/src/com/android/settings/applications/ManageAssist.java
+++ b/src/com/android/settings/applications/ManageAssist.java
@@ -60,8 +60,6 @@
mContextPref.setOnPreferenceChangeListener(this);
mScreenshotPref = (SwitchPreference) findPreference(KEY_SCREENSHOT);
- mScreenshotPref.setChecked(Settings.Secure.getInt(getContentResolver(),
- Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 1) != 0);
mScreenshotPref.setOnPreferenceChangeListener(this);
mVoiceInputPref = (VoiceInputListPreference) findPreference(KEY_VOICE_INPUT);
@@ -134,9 +132,8 @@
}
mScreenshotPref.setEnabled(mContextPref.isChecked());
- if (!mContextPref.isChecked()) {
- mScreenshotPref.setChecked(false);
- }
+ mScreenshotPref.setChecked(mContextPref.isChecked() && Settings.Secure.getInt(
+ getContentResolver(), Settings.Secure.ASSIST_SCREENSHOT_ENABLED, 1) != 0);
}
private boolean isCurrentAssistVoiceService() {
diff --git a/src/com/android/settings/applications/NotificationApps.java b/src/com/android/settings/applications/NotificationApps.java
index f76aa8d..b599eb6 100644
--- a/src/com/android/settings/applications/NotificationApps.java
+++ b/src/com/android/settings/applications/NotificationApps.java
@@ -17,6 +17,7 @@
import android.app.Activity;
import android.app.Application;
import android.content.Context;
+import android.os.Handler;
import com.android.settings.R;
import com.android.settings.applications.AppStateBaseBridge.Callback;
import com.android.settings.dashboard.SummaryLoader;
@@ -44,6 +45,7 @@
private final ApplicationsState.Session mSession;
private final NotificationBackend mNotifBackend;
private final AppStateNotificationBridge mExtraInfoBridge;
+ private final Handler mHandler;
private SummaryProvider(Context context, SummaryLoader loader) {
mContext = context;
@@ -54,6 +56,7 @@
mNotifBackend = new NotificationBackend();
mExtraInfoBridge = new AppStateNotificationBridge(mContext,
mAppState, this, mNotifBackend);
+ mHandler = new Handler(mAppState.getBackgroundLooper());
}
@Override
@@ -84,9 +87,14 @@
@Override
public void onExtraInfoUpdated() {
- updateSummary(mSession.rebuild(
- AppStateNotificationBridge.FILTER_APP_NOTIFICATION_BLOCKED,
- ApplicationsState.ALPHA_COMPARATOR));
+ mHandler.post(new Runnable() {
+ @Override
+ public void run() {
+ updateSummary(mSession.rebuild(
+ AppStateNotificationBridge.FILTER_APP_NOTIFICATION_BLOCKED,
+ null, false));
+ }
+ });
}
@Override
diff --git a/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java b/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
index 929179a..e6fcbcb 100644
--- a/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
+++ b/src/com/android/settings/bluetooth/DeviceListPreferenceFragment.java
@@ -77,7 +77,6 @@
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setAnimationAllowed(true);
mLocalManager = Utils.getLocalBtManager(getActivity());
if (mLocalManager == null) {
diff --git a/src/com/android/settings/dashboard/DashboardAdapter.java b/src/com/android/settings/dashboard/DashboardAdapter.java
index 292244c..8b29273 100644
--- a/src/com/android/settings/dashboard/DashboardAdapter.java
+++ b/src/com/android/settings/dashboard/DashboardAdapter.java
@@ -85,6 +85,10 @@
setShowingAll(true);
}
+ public List<Tile> getSuggestions() {
+ return mSuggestions;
+ }
+
public void setSuggestions(SuggestionParser suggestionParser) {
mSuggestionParser = suggestionParser;
mSuggestions = suggestionParser.getSuggestions();
diff --git a/src/com/android/settings/dashboard/DashboardSummary.java b/src/com/android/settings/dashboard/DashboardSummary.java
index 04c45fd..66b3730 100644
--- a/src/com/android/settings/dashboard/DashboardSummary.java
+++ b/src/com/android/settings/dashboard/DashboardSummary.java
@@ -77,19 +77,19 @@
@Override
public void onCreate(Bundle savedInstanceState) {
+ long startTime = System.currentTimeMillis();
super.onCreate(savedInstanceState);
- long startTime = System.currentTimeMillis();
List<DashboardCategory> categories =
((SettingsActivity) getActivity()).getDashboardCategories();
mSummaryLoader = new SummaryLoader(getActivity(), categories);
setHasOptionsMenu(true);
- if (DEBUG_TIMING) Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime)
- + " ms");
Context context = getContext();
mConditionManager = ConditionManager.get(context);
mSuggestionParser = new SuggestionParser(context,
context.getSharedPreferences(SUGGESTIONS, 0), R.xml.suggestion_ordering);
+ if (DEBUG_TIMING) Log.d(TAG, "onCreate took " + (System.currentTimeMillis() - startTime)
+ + " ms");
}
@Override
@@ -108,17 +108,22 @@
@Override
public void onResume() {
+ long startTime = System.currentTimeMillis();
super.onResume();
((SettingsDrawerActivity) getActivity()).addCategoryListener(this);
mSummaryLoader.setListening(true);
- for (Condition c : mConditionManager.getVisibleConditions()) {
- MetricsLogger.visible(getContext(), c.getMetricsConstant());
+ for (Condition c : mConditionManager.getConditions()) {
+ if (c.shouldShow()) {
+ MetricsLogger.visible(getContext(), c.getMetricsConstant());
+ }
}
- for (Tile suggestion : mSuggestionParser.getSuggestions()) {
+ for (Tile suggestion : mAdapter.getSuggestions()) {
MetricsLogger.action(getContext(), MetricsEvent.ACTION_SHOW_SETTINGS_SUGGESTION,
DashboardAdapter.getSuggestionIdentifier(getContext(), suggestion));
}
+ if (DEBUG_TIMING) Log.d(TAG, "onResume took " + (System.currentTimeMillis() - startTime)
+ + " ms");
}
@Override
@@ -127,10 +132,12 @@
((SettingsDrawerActivity) getActivity()).remCategoryListener(this);
mSummaryLoader.setListening(false);
- for (Condition c : mConditionManager.getVisibleConditions()) {
- MetricsLogger.hidden(getContext(), c.getMetricsConstant());
+ for (Condition c : mConditionManager.getConditions()) {
+ if (c.shouldShow()) {
+ MetricsLogger.hidden(getContext(), c.getMetricsConstant());
+ }
}
- for (Tile suggestion : mSuggestionParser.getSuggestions()) {
+ for (Tile suggestion : mAdapter.getSuggestions()) {
MetricsLogger.action(getContext(), MetricsEvent.ACTION_HIDE_SETTINGS_SUGGESTION,
DashboardAdapter.getSuggestionIdentifier(getContext(), suggestion));
}
@@ -138,12 +145,15 @@
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
+ long startTime = System.currentTimeMillis();
if (hasWindowFocus) {
mConditionManager.addListener(this);
mConditionManager.refreshAll();
} else {
mConditionManager.remListener(this);
}
+ if (DEBUG_TIMING) Log.d(TAG, "onWindowFocusChanged took "
+ + (System.currentTimeMillis() - startTime) + " ms");
}
@Override
@@ -161,6 +171,7 @@
@Override
public void onViewCreated(View view, Bundle bundle) {
+ long startTime = System.currentTimeMillis();
mDashboard = (FocusRecyclerView) view.findViewById(R.id.dashboard_container);
mLayoutManager = new LinearLayoutManager(getContext());
mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
@@ -174,10 +185,11 @@
mDashboard.addItemDecoration(new DashboardDecorator(getContext()));
mAdapter = new DashboardAdapter(getContext());
mAdapter.setConditions(mConditionManager.getConditions());
- mAdapter.setSuggestions(mSuggestionParser);
mDashboard.setAdapter(mAdapter);
mSummaryLoader.setAdapter(mAdapter);
ConditionAdapterUtils.addDismiss(mDashboard);
+ if (DEBUG_TIMING) Log.d(TAG, "onViewCreated took "
+ + (System.currentTimeMillis() - startTime) + " ms");
rebuildUI();
}
diff --git a/src/com/android/settings/dashboard/SummaryLoader.java b/src/com/android/settings/dashboard/SummaryLoader.java
index 86cffde..55d97df 100644
--- a/src/com/android/settings/dashboard/SummaryLoader.java
+++ b/src/com/android/settings/dashboard/SummaryLoader.java
@@ -17,11 +17,8 @@
import android.app.Activity;
import android.content.ComponentName;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.HandlerThread;
-import android.os.Looper;
-import android.os.Message;
+import android.os.*;
+import android.os.Process;
import android.util.ArrayMap;
import android.util.Log;
import com.android.settings.SettingsActivity;
@@ -51,7 +48,7 @@
public SummaryLoader(Activity activity, List<DashboardCategory> categories) {
mHandler = new Handler();
- mWorkerThread = new HandlerThread("SummaryLoader");
+ mWorkerThread = new HandlerThread("SummaryLoader", Process.THREAD_PRIORITY_BACKGROUND);
mWorkerThread.start();
mWorker = new Worker(mWorkerThread.getLooper());
mActivity = activity;
diff --git a/src/com/android/settings/dashboard/conditional/Condition.java b/src/com/android/settings/dashboard/conditional/Condition.java
index 4352f2d..1d48d5d 100644
--- a/src/com/android/settings/dashboard/conditional/Condition.java
+++ b/src/com/android/settings/dashboard/conditional/Condition.java
@@ -35,7 +35,8 @@
private boolean mIsActive;
private long mLastStateChange;
- public Condition(ConditionManager manager) {
+ // All conditions must live in this package.
+ Condition(ConditionManager manager) {
mManager = manager;
}
@@ -45,10 +46,15 @@
mLastStateChange = bundle.getLong(KEY_LAST_STATE);
}
- void saveState(PersistableBundle bundle) {
- bundle.putBoolean(KEY_SILENCE, mIsSilenced);
- bundle.putBoolean(KEY_ACTIVE, mIsActive);
- bundle.putLong(KEY_LAST_STATE, mLastStateChange);
+ boolean saveState(PersistableBundle bundle) {
+ if (mIsSilenced) {
+ bundle.putBoolean(KEY_SILENCE, mIsSilenced);
+ }
+ if (mIsActive) {
+ bundle.putBoolean(KEY_ACTIVE, mIsActive);
+ bundle.putLong(KEY_LAST_STATE, mLastStateChange);
+ }
+ return mIsSilenced || mIsActive;
}
protected void notifyChanged() {
diff --git a/src/com/android/settings/dashboard/conditional/ConditionManager.java b/src/com/android/settings/dashboard/conditional/ConditionManager.java
index cd044ac..24d5f09 100644
--- a/src/com/android/settings/dashboard/conditional/ConditionManager.java
+++ b/src/com/android/settings/dashboard/conditional/ConditionManager.java
@@ -38,10 +38,12 @@
private static final boolean DEBUG = true;
+ private static final String PKG = "com.android.settings.dashboard.conditional.";
+
private static final String FILE_NAME = "condition_state.xml";
- private static final String TAG_CONDITIONS = "conditions";
- private static final String TAG_CONDITION = "condition";
- private static final String ATTR_CLASS = "class";
+ private static final String TAG_CONDITIONS = "cs";
+ private static final String TAG_CONDITION = "c";
+ private static final String ATTR_CLASS = "cls";
private static ConditionManager sInstance;
@@ -80,6 +82,9 @@
if (TAG_CONDITION.equals(parser.getName())) {
int depth = parser.getDepth();
String clz = parser.getAttributeValue("", ATTR_CLASS);
+ if (!clz.startsWith(PKG)) {
+ clz = PKG + clz;
+ }
Condition condition = createCondition(Class.forName(clz));
PersistableBundle bundle = PersistableBundle.restoreFromXml(parser);
if (DEBUG) Log.d(TAG, "Reading " + clz + " -- " + bundle);
@@ -109,12 +114,14 @@
final int N = mConditions.size();
for (int i = 0; i < N; i++) {
- serializer.startTag("", TAG_CONDITION);
- serializer.attribute("", ATTR_CLASS, mConditions.get(i).getClass().getName());
PersistableBundle bundle = new PersistableBundle();
- mConditions.get(i).saveState(bundle);
- bundle.saveToXml(serializer);
- serializer.endTag("", TAG_CONDITION);
+ if (mConditions.get(i).saveState(bundle)) {
+ serializer.startTag("", TAG_CONDITION);
+ final String clz = mConditions.get(i).getClass().getSimpleName();
+ serializer.attribute("", ATTR_CLASS, clz);
+ bundle.saveToXml(serializer);
+ serializer.endTag("", TAG_CONDITION);
+ }
}
serializer.endTag("", TAG_CONDITIONS);
@@ -133,6 +140,7 @@
addIfMissing(CellularDataCondition.class);
addIfMissing(BackgroundDataCondition.class);
addIfMissing(WorkModeCondition.class);
+ Collections.sort(mConditions, CONDITION_COMPARATOR);
}
private void addIfMissing(Class<? extends Condition> clz) {
@@ -187,12 +195,12 @@
conditions.add(mConditions.get(i));
}
}
- Collections.sort(conditions, CONDITION_COMPARATOR);
return conditions;
}
public void notifyChanged(Condition condition) {
saveToXml();
+ Collections.sort(mConditions, CONDITION_COMPARATOR);
final int N = mListeners.size();
for (int i = 0; i < N; i++) {
mListeners.get(i).onConditionsChanged();
@@ -209,7 +217,7 @@
public static ConditionManager get(Context context) {
if (sInstance == null) {
- sInstance = new ConditionManager(context);
+ sInstance = new ConditionManager(context.getApplicationContext());
}
return sInstance;
}
diff --git a/src/com/android/settings/datausage/UnrestrictedDataAccess.java b/src/com/android/settings/datausage/UnrestrictedDataAccess.java
index e3771d3..c9014c0 100644
--- a/src/com/android/settings/datausage/UnrestrictedDataAccess.java
+++ b/src/com/android/settings/datausage/UnrestrictedDataAccess.java
@@ -28,6 +28,7 @@
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.applications.AppStateBaseBridge;
+import com.android.settings.datausage.AppStateDataUsageBridge.DataUsageState;
import com.android.settingslib.applications.ApplicationsState;
import com.android.settingslib.applications.ApplicationsState.AppEntry;
import com.android.settingslib.applications.ApplicationsState.AppFilter;
@@ -215,8 +216,8 @@
mEntry = entry;
mEntry.ensureLabel(getContext());
setTitle(entry.label);
- setChecked(((AppStateDataUsageBridge.DataUsageState) entry.extraInfo)
- .isDataSaverWhitelisted);
+ final DataUsageState state = (DataUsageState) entry.extraInfo;
+ setChecked(state != null && state.isDataSaverWhitelisted);
if (mEntry.icon != null) {
setIcon(mEntry.icon);
}
@@ -224,8 +225,8 @@
public void reuse() {
setTitle(mEntry.label);
- setChecked(((AppStateDataUsageBridge.DataUsageState) mEntry.extraInfo)
- .isDataSaverWhitelisted);
+ final DataUsageState state = (DataUsageState) mEntry.extraInfo;
+ setChecked(state != null && state.isDataSaverWhitelisted);
}
@Override
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryDetail.java b/src/com/android/settings/fuelgauge/BatteryHistoryDetail.java
index 25d5292..e79f8ff 100644
--- a/src/com/android/settings/fuelgauge/BatteryHistoryDetail.java
+++ b/src/com/android/settings/fuelgauge/BatteryHistoryDetail.java
@@ -75,6 +75,7 @@
mCpuParser = new BatteryFlagParser(accentColor, false,
HistoryItem.STATE_CPU_RUNNING_FLAG);
mPhoneParser = new BatteryCellParser();
+ setHasOptionsMenu(true);
}
@Override
diff --git a/src/com/android/settings/sim/SimSettings.java b/src/com/android/settings/sim/SimSettings.java
index e783923..ece3913 100644
--- a/src/com/android/settings/sim/SimSettings.java
+++ b/src/com/android/settings/sim/SimSettings.java
@@ -164,10 +164,11 @@
if (sir != null) {
simPref.setSummary(sir.getDisplayName());
+ simPref.setEnabled(mSelectableSubInfos.size() > 1);
} else if (sir == null) {
simPref.setSummary(R.string.sim_selection_required_pref);
+ simPref.setEnabled(mSelectableSubInfos.size() >= 1);
}
- simPref.setEnabled(mSelectableSubInfos.size() >= 1);
}
private void updateCellularDataValues() {
@@ -176,17 +177,18 @@
simPref.setTitle(R.string.cellular_data_title);
if (DBG) log("[updateCellularDataValues] mSubInfoList=" + mSubInfoList);
- if (sir != null) {
- simPref.setSummary(sir.getDisplayName());
- } else if (sir == null) {
- simPref.setSummary(R.string.sim_selection_required_pref);
- }
-
boolean callStateIdle = isCallStateIdle();
final boolean ecbMode = SystemProperties.getBoolean(
TelephonyProperties.PROPERTY_INECM_MODE, false);
- // Enable data preference in msim mode and call state idle
- simPref.setEnabled((mSelectableSubInfos.size() >= 1) && callStateIdle && !ecbMode);
+ if (sir != null) {
+ simPref.setSummary(sir.getDisplayName());
+ // Enable data preference in msim mode and call state idle
+ simPref.setEnabled((mSelectableSubInfos.size() > 1) && callStateIdle && !ecbMode);
+ } else if (sir == null) {
+ simPref.setSummary(R.string.sim_selection_required_pref);
+ // Enable data preference in msim mode and call state idle
+ simPref.setEnabled((mSelectableSubInfos.size() >= 1) && callStateIdle && !ecbMode);
+ }
}
private void updateCallValues() {
diff --git a/src/com/android/settings/widget/LabeledSeekBar.java b/src/com/android/settings/widget/LabeledSeekBar.java
index 00df09c..bf6983e 100644
--- a/src/com/android/settings/widget/LabeledSeekBar.java
+++ b/src/com/android/settings/widget/LabeledSeekBar.java
@@ -24,12 +24,10 @@
import android.support.v4.widget.ExploreByTouchHelper;
import android.util.AttributeSet;
import android.view.MotionEvent;
-import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.SeekBar;
-import android.widget.SeekBar.OnSeekBarChangeListener;
import java.util.List;
@@ -40,9 +38,90 @@
*/
public class LabeledSeekBar extends SeekBar {
+ private final ExploreByTouchHelper mAccessHelper;
+
+ /** Seek bar change listener set via public method. */
+ private OnSeekBarChangeListener mOnSeekBarChangeListener;
+
+ /** Labels for discrete progress values. */
+ private String[] mLabels;
+
+ public LabeledSeekBar(Context context, AttributeSet attrs) {
+ this(context, attrs, com.android.internal.R.attr.seekBarStyle);
+ }
+
+ public LabeledSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
+ this(context, attrs, defStyleAttr, 0);
+ }
+
+ public LabeledSeekBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+
+ mAccessHelper = new LabeledSeekBarExploreByTouchHelper(this);
+ ViewCompat.setAccessibilityDelegate(this, mAccessHelper);
+
+ super.setOnSeekBarChangeListener(mProxySeekBarListener);
+ }
+
+ @Override
+ public synchronized void setProgress(int progress) {
+ // This method gets called from the constructor, so mAccessHelper may
+ // not have been assigned yet.
+ if (mAccessHelper != null) {
+ mAccessHelper.invalidateRoot();
+ }
+
+ super.setProgress(progress);
+ }
+
+ public void setLabels(String[] labels) {
+ mLabels = labels;
+ }
+
+ @Override
+ public void setOnSeekBarChangeListener(OnSeekBarChangeListener l) {
+ // The callback set in the constructor will proxy calls to this
+ // listener.
+ mOnSeekBarChangeListener = l;
+ }
+
+ @Override
+ protected boolean dispatchHoverEvent(MotionEvent event) {
+ return mAccessHelper.dispatchHoverEvent(event) || super.dispatchHoverEvent(event);
+ }
+
+ private void sendClickEventForAccessibility(int progress) {
+ mAccessHelper.invalidateRoot();
+ mAccessHelper.sendEventForVirtualView(progress, AccessibilityEvent.TYPE_VIEW_CLICKED);
+ }
+
+ private final OnSeekBarChangeListener mProxySeekBarListener = new OnSeekBarChangeListener() {
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ if (mOnSeekBarChangeListener != null) {
+ mOnSeekBarChangeListener.onStopTrackingTouch(seekBar);
+ }
+ }
+
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ if (mOnSeekBarChangeListener != null) {
+ mOnSeekBarChangeListener.onStartTrackingTouch(seekBar);
+ }
+ }
+
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+ if (mOnSeekBarChangeListener != null) {
+ mOnSeekBarChangeListener.onProgressChanged(seekBar, progress, fromUser);
+ sendClickEventForAccessibility(progress);
+ }
+ }
+ };
+
private class LabeledSeekBarExploreByTouchHelper extends ExploreByTouchHelper {
- public LabeledSeekBarExploreByTouchHelper(View forView) {
+ public LabeledSeekBarExploreByTouchHelper(LabeledSeekBar forView) {
super(forView);
}
@@ -134,125 +213,4 @@
return r;
}
}
-
- private String[] mLabels;
-
- private ExploreByTouchHelper mAccessHelper;
-
- private boolean mOnMeasureCalled;
- private boolean mOnAttachedWindowCalled;
-
- public LabeledSeekBar(Context context, AttributeSet attrs) {
- this(context, attrs, com.android.internal.R.attr.seekBarStyle);
- }
-
- public LabeledSeekBar(Context context, AttributeSet attrs, int defStyleAttr) {
- this(context, attrs, defStyleAttr, 0);
- }
-
- public LabeledSeekBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
- super(context, attrs, defStyleAttr, defStyleRes);
- super.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
- // Do nothing
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
- // Do nothing
- }
-
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- sendClickEventForAccessibility(progress);
- }
- });
- }
-
- @Override
- public synchronized void setProgress(int progress) {
- if (mAccessHelper != null) {
- mAccessHelper.invalidateRoot();
- }
-
- super.setProgress(progress);
- }
-
- public void setLabels(String[] labels) {
- mLabels = labels;
- }
-
- @Override
- public void setOnSeekBarChangeListener(final OnSeekBarChangeListener l) {
- // Tweak the listener to send accessibility event on progress changed.
- OnSeekBarChangeListener l2 = new OnSeekBarChangeListener() {
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
- l.onStopTrackingTouch(seekBar);
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
- l.onStartTrackingTouch(seekBar);
- }
-
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- l.onProgressChanged(seekBar, progress, fromUser);
- sendClickEventForAccessibility(progress);
- }
- };
-
- super.setOnSeekBarChangeListener(l2);
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
- mOnMeasureCalled = true;
- tryInitAccessHelper();
- }
-
- @Override
- protected void onAttachedToWindow() {
- super.onAttachedToWindow();
- mOnAttachedWindowCalled = true;
- tryInitAccessHelper();
- }
-
- @Override
- protected void onDetachedFromWindow() {
- ViewCompat.setAccessibilityDelegate(this, null);
- mAccessHelper = null;
- super.onDetachedFromWindow();
- }
-
- @Override
- protected boolean dispatchHoverEvent(MotionEvent event) {
- if (mAccessHelper != null && mAccessHelper.dispatchHoverEvent(event)) {
- return true;
- }
-
- return super.dispatchHoverEvent(event);
- }
-
- /**
- * Initialize accessibility delegation only when both onAttachedWindow and onMeasure
- * has been called.
- */
- private void tryInitAccessHelper() {
- if (mOnAttachedWindowCalled && mOnMeasureCalled) {
- mAccessHelper = new LabeledSeekBarExploreByTouchHelper(this);
- ViewCompat.setAccessibilityDelegate(this, mAccessHelper);
- mOnAttachedWindowCalled = mOnMeasureCalled = false;
- }
- }
-
- private void sendClickEventForAccessibility(int progress) {
- if (mAccessHelper != null) {
- mAccessHelper.invalidateRoot();
- mAccessHelper.sendEventForVirtualView(progress, AccessibilityEvent.TYPE_VIEW_CLICKED);
- }
- }
}