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"
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" />
+
+ <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>
\ No newline at end of file
+ </RelativeLayout>
+</ScrollView>
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"
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"
-->
<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">
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:orientation="vertical"
- android:gravity="center_vertical"
- android:layout_weight="1">
-
- <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>
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <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:textAppearance="@style/TextAppearance.Small"
+ android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
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>
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>
<TextView android:id="@+id/operator" style="@style/info_value" />
</LinearLayout>
- <!-- Ping stats -->
- <Button android:id="@+id/ping_test"
- android:textSize="14sp"
- android:layout_marginTop="8dip"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/ping_test_label"
- />
-
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_ping_hostname_v4" style="@style/info_label" />
- <TextView android:id="@+id/pingHostnameV4" style="@style/info_value" />
- </LinearLayout>
-
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_ping_hostname_v6" style="@style/info_label" />
- <TextView android:id="@+id/pingHostnameV6" style="@style/info_value" />
- </LinearLayout>
-
- <LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_http_client_test" style="@style/info_label" />
- <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 -->
+ <!-- Voice Service Status -->
<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" />
+ <TextView android:text="@string/radio_info_gsm_service_label" style="@style/info_label" />
+ <TextView android:id="@+id/gsm" style="@style/info_value" />
</LinearLayout>
- <!-- Neighboring Cids -->
+ <!-- Data Service Status -->
<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" />
+ <TextView android:text="@string/radio_info_gprs_service_label" style="@style/info_label" />
+ <TextView android:id="@+id/gprs" style="@style/info_value" />
</LinearLayout>
- <!-- CellInfo -->
+ <!-- Network Type -->
<LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_cellinfo_label"
- style="@style/info_label" />
+ <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:id="@+id/cellinfo" style="@style/info_value" />
+ <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>
- <!-- DcRtInfo - DataConnectionRealTimeInfo -->
+ <!-- Call Status -->
<LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_dcrtinfo_label"
- style="@style/info_label" />
- <TextView android:id="@+id/dcrtinfo" style="@style/info_value" />
+ <TextView android:text="@string/radio_info_call_status_label" style="@style/info_label" />
+ <TextView android:id="@+id/call" style="@style/info_value" />
</LinearLayout>
<!-- Roaming -->
<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>
+ <!-- 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"
+ />
- <!-- 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>
+ <Spinner android:id="@+id/preferredNetworkType"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ />
- <!-- 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>
+ <!-- Horizontal Rule -->
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1dip"
+ android:background="#000000" />
- <!-- Message Waiting Indicator -->
+ <!-- Ping stats -->
+ <Button android:id="@+id/ping_test"
+ android:textSize="14sp"
+ android:layout_marginTop="8dip"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/ping_test_label"
+ />
+
<LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_message_waiting_label" style="@style/info_label" />
- <TextView android:id="@+id/mwi" style="@style/info_value" />
+ <TextView android:text="@string/radio_info_ping_hostname_v4" style="@style/info_label" />
+ <TextView android:id="@+id/pingHostnameV4" style="@style/info_value" />
</LinearLayout>
- <!-- Call Forwarding Indicator -->
<LinearLayout style="@style/entry_layout">
- <TextView android:text="@string/radio_info_call_redirect_label" style="@style/info_label" />
- <TextView android:id="@+id/cfi" style="@style/info_value" />
+ <TextView android:text="@string/radio_info_ping_hostname_v6" style="@style/info_label" />
+ <TextView android:id="@+id/pingHostnameV6" style="@style/info_value" />
</LinearLayout>
- <!-- 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" />
+ <TextView android:text="@string/radio_info_http_client_test" style="@style/info_label" />
+ <TextView android:id="@+id/httpClientTest" 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>
+ <!-- Horizontal Rule -->
+ <View
+ android:layout_width="fill_parent"
+ android:layout_height="1dip"
+ android:background="#000000" />
- <!-- Attempted Data Connections -->
+ <!-- DcRtInfo - DataConnectionRealTimeInfo -->
<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" />
+ <TextView android:text="@string/radio_info_dcrtinfo_label"
+ style="@style/info_label" />
+ <TextView android:id="@+id/dcrtinfo" style="@style/info_value" />
</LinearLayout>
- <!-- Successful Data Connections -->
+ <!-- Message Waiting Indicator -->
<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" />
+ <TextView android:text="@string/radio_info_message_waiting_label" style="@style/info_label" />
+ <TextView android:id="@+id/mwi" style="@style/info_value" />
</LinearLayout>
- <!-- GSM Disconnects -->
+ <!-- Call Forwarding Indicator -->
<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" />
+ <TextView android:text="@string/radio_info_call_redirect_label" style="@style/info_label" />
+ <TextView android:id="@+id/cfi" style="@style/info_value" />
</LinearLayout>
<!-- PPP Sent -->
<TextView android:id="@+id/sentSinceReceived" 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"
- />
-
<!-- Radio Power -->
- <Button android:id="@+id/radio_power"
+ <Switch 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_width="match_parent"
android:layout_height="wrap_content"
- />
+ android:text="@string/radio_info_radio_power"/>
<!-- VoLTE provisioned -->
- <Button android:id="@+id/volte_provisioned_flag"
- android:textSize="14sp"
- android:layout_marginTop="8dip"
- android:layout_width="wrap_content"
- 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"
+ <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"
- />
+ android:text="@string/volte_provisioned_switch_string"/>
<!-- SMSC -->
<RelativeLayout android:layout_width="match_parent"
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>
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"
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"
<!-- 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>
<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 -->
<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>
- <!-- 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>
- <!-- 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_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_current_network_label">Current network:</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_data_successes_label">Data successes:</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_ppp_received_label">PPP received:</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_gsm_service_label">Voice Technology:</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_signal_strength_label">Signal strength:</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_call_status_label">Call status:</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_ppp_sent_label">PPP sent:</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_radio_resets_label">Radio resets:</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_message_waiting_label">Message waiting:</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_phone_number_label">Phone number:</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_band_mode_label">Select radio band</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_network_type_label">Network type:</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_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 -->
<!-- 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. -->
<!-- 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] -->
<string name="notification_log_details_default">default</string>
<!-- Notification log debug tool: the word 'none' -->
<string name="notification_log_details_none">none</string>
+ <!-- Notification log debug tool: missing ranking information -->
+ <string name="notification_log_details_ranking_null">Ranking object is missing.</string>
+ <!-- Notification log debug tool: the word 'none' -->
+ <string name="notification_log_details_ranking_none">Ranking object doesn\'t contain this key.</string>
<!-- [CHAR_LIMIT=60] Label for special access screen -->
<string name="special_access">Special access</string>
<!-- 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>
<!-- [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>
<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>
</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>
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">
PACKAGE + ".ConfirmCredentials.showWhenLocked";
private FingerprintUiHelper mFingerprintHelper;
+ private boolean mIsStrongAuthRequired;
private boolean mAllowFpAuthentication;
protected Button mCancelButton;
protected ImageView mFingerprintIcon;
protected int mUserId;
protected LockPatternUtils mLockPatternUtils;
protected TextView mErrorTextView;
+ protected TextView mStrongAuthRequiredTextView;
protected final Handler mHandler = new Handler();
@Override
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());
}
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,
return (disabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT) != 0;
}
+ private boolean isStrongAuthRequired() {
+ return !(UserManager.get(getContext()).isUserUnlocked(mEffectiveUserId));
+ }
+
@Override
public void onResume() {
super.onResume();
|| 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);
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);
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;
}
*/
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;
*/
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;
/** 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];
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
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) {
.alpha(0)
.setInterpolator(FADE_OUT_INTERPOLATOR)
.setDuration(CROSS_FADE_DURATION_MS)
+ .setListener(new PreviewFrameAnimatorListener())
.withEndAction(new Runnable() {
@Override
public void run() {
.alpha(1)
.setInterpolator(FADE_IN_INTERPOLATOR)
.setDuration(CROSS_FADE_DURATION_MS)
+ .setListener(new PreviewFrameAnimatorListener())
.withStartAction(new Runnable() {
@Override
public void run() {
}
}
}
+
+ 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.
+ }
+ }
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
- commit();
+ if (mPreviewPagerAdapter.isAnimating()) {
+ mPreviewPagerAdapter.setAnimationEndAction(new Runnable() {
+ @Override
+ public void run() {
+ commit();
+ }
+ });
+ } else {
+ commit();
+ }
mSeekByTouch = false;
}
}
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;
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;
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;
import java.util.List;
public class RadioInfo extends Activity {
- private final String TAG = "phone";
+ private static final String TAG = "RadioInfo";
+
+ 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_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 int EVENT_CFI_CHANGED = 302;
private static final int EVENT_QUERY_PREFERRED_TYPE_DONE = 1000;
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;
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;
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;
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;
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();
}
}
@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);
}
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) {
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) {
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);
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);
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);
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
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);
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);
}
log("onPause: unregister phone & data intents");
- mPhoneStateReceiver.unregisterIntent();
mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
}
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
outState.putString("mPingHostnameResultV4", mPingHostnameResultV4);
outState.putString("mPingHostnameResultV6", mPingHostnameResultV6);
outState.putString("mHttpClientTestResult", mHttpClientTestResult);
+
outState.putInt("mPreferredNetworkTypeResult", mPreferredNetworkTypeResult);
+
+ outState.putInt("mCellInfoRefreshRateIndex", mCellInfoRefreshRateIndex);
+
}
@Override
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;
}
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;
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() ?
}
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 = mPhoneStateReceiver.getSignalStrengthDbm();
-
- if (-1 == signalDbm) signalDbm = 0;
+ int signalDbm = signalStrength.getDbm();
- int signalAsu = mPhoneStateReceiver.getSignalStrengthLevelAsu();
+ int signalAsu = signalStrength.getAsuLevel();
if (-1 == signalAsu) signalAsu = 0;
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()));
}
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()));
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()));
}
}
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) {
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);
}
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;
}
}
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
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();
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);
}
};
- OnClickListener mPowerButtonHandler = new OnClickListener() {
- public void onClick(View v) {
- //log("toggle radio power: currently " + (isRadioOn()?"on":"off"));
- //FIXME: Replace with a TelephonyManager call
- phone.setRadioPower(!isRadioOn());
- }
- };
-
- class CellInfoListRateHandler implements OnClickListener {
- int rates[] = {Integer.MAX_VALUE, 0, 5000};
- int index = 0;
-
- 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 boolean isRadioOn() {
+ //FIXME: Replace with a TelephonyManager call
+ return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
}
- 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 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);
}
- private Button smsOverImsButton;
- static final String PROPERTY_SMS_OVER_IMS = "persist.radio.imsallowmtsms";
- OnClickListener mSmsOverImsHandler = new OnClickListener() {
+ OnCheckedChangeListener mRadioPowerOnChangeListener = new OnCheckedChangeListener() {
@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();
- }
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ log("toggle radio power: currently " + (isRadioOn()?"on":"off"));
+ phone.setRadioPower(isChecked);
+ }
};
- 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);
- }
- }
- });
+ void setImsVoLteProvisionedState( boolean state ) {
+ log(String.format("toggle VoLTE provisioned: %s", ((state) ? "on":"off")));
+
+ 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() {
}
};
- 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() {
+
+ public void onItemSelected(AdapterView parent, View v, int pos, long id) {
+ mCellInfoRefreshRateIndex = pos;
+ phone.setCellInfoListRate(mCellInfoRefreshRates[pos]);
+ updateAllCellInfo();
+ }
+
+ public void onNothingSelected(AdapterView parent) {
+ }
+ };
- private void log(String s) {
- Log.d(TAG, "[RadioInfo] " + s);
- }
}
private void unifyLocks() {
int profileQuality =
mLockPatternUtils.getKeyguardStoredPasswordQuality(mProfileChallengeUserId);
- mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false,
- mCurrentProfilePassword);
if (profileQuality == DevicePolicyManager.PASSWORD_QUALITY_SOMETHING) {
mLockPatternUtils.saveLockPattern(
LockPatternUtils.stringToPattern(mCurrentProfilePassword),
mCurrentProfilePassword, mCurrentDevicePassword,
profileQuality, MY_USER_ID);
}
+ mLockPatternUtils.setSeparateProfileChallengeEnabled(mProfileChallengeUserId, false,
+ mCurrentProfilePassword);
final boolean profilePatternVisibility =
mLockPatternUtils.isVisiblePatternEnabled(mProfileChallengeUserId);
mLockPatternUtils.setVisiblePatternEnabled(profilePatternVisibility, MY_USER_ID);
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;
// 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;
mAppState =
ApplicationsState.getInstance((Application) context.getApplicationContext());
mSession = mAppState.newSession(this);
+ mHandler = new Handler(mAppState.getBackgroundLooper());
}
@Override
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);
@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
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);
}
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() {
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;
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;
mNotifBackend = new NotificationBackend();
mExtraInfoBridge = new AppStateNotificationBridge(mContext,
mAppState, this, mNotifBackend);
+ mHandler = new Handler(mAppState.getBackgroundLooper());
}
@Override
@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
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setAnimationAllowed(true);
mLocalManager = Utils.getLocalBtManager(getActivity());
if (mLocalManager == null) {
setShowingAll(true);
}
+ public List<Tile> getSuggestions() {
+ return mSuggestions;
+ }
+
public void setSuggestions(SuggestionParser suggestionParser) {
mSuggestionParser = suggestionParser;
mSuggestions = suggestionParser.getSuggestions();
@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
@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
((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));
}
@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
@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);
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();
}
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;
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;
private boolean mIsActive;
private long mLastStateChange;
- public Condition(ConditionManager manager) {
+ // All conditions must live in this package.
+ Condition(ConditionManager manager) {
mManager = manager;
}
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() {
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;
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);
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);
addIfMissing(CellularDataCondition.class);
addIfMissing(BackgroundDataCondition.class);
addIfMissing(WorkModeCondition.class);
+ Collections.sort(mConditions, CONDITION_COMPARATOR);
}
private void addIfMissing(Class<? extends Condition> clz) {
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();
public static ConditionManager get(Context context) {
if (sInstance == null) {
- sInstance = new ConditionManager(context);
+ sInstance = new ConditionManager(context.getApplicationContext());
}
return sInstance;
}
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;
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);
}
public void reuse() {
setTitle(mEntry.label);
- setChecked(((AppStateDataUsageBridge.DataUsageState) mEntry.extraInfo)
- .isDataSaverWhitelisted);
+ final DataUsageState state = (DataUsageState) mEntry.extraInfo;
+ setChecked(state != null && state.isDataSaverWhitelisted);
}
@Override
import android.app.INotificationManager;
import android.content.ComponentName;
import android.content.Context;
-import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
-import android.net.Uri;
import android.os.*;
import android.service.notification.NotificationListenerService;
import android.service.notification.NotificationListenerService.Ranking;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceViewHolder;
import android.support.v7.widget.RecyclerView;
-import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
private static final boolean DEBUG = false;
private static final boolean DUMP_EXTRAS = true;
private static final boolean DUMP_PARCEL = true;
+ private Handler mHandler;
private static class HistoricalNotificationInfo {
public String pkg;
private final NotificationListenerService mListener = new NotificationListenerService() {
@Override
public void onNotificationPosted(StatusBarNotification sbn, RankingMap ranking) {
- logd("onNotificationPosted: %s", sbn.getNotification());
- final Handler h = getListView().getHandler();
+ logd("onNotificationPosted: %s, with update for %d", sbn.getNotification(),
+ ranking == null ? 0 : ranking.getOrderedKeys().length);
mRanking = ranking;
- h.removeCallbacks(mRefreshListRunnable);
- h.postDelayed(mRefreshListRunnable, 100);
+ scheduleRefreshList();
}
@Override
public void onNotificationRemoved(StatusBarNotification notification, RankingMap ranking) {
- final Handler h = getListView().getHandler();
+ logd("onNotificationRankingUpdate with update for %d",
+ ranking == null ? 0 : ranking.getOrderedKeys().length);
mRanking = ranking;
- h.removeCallbacks(mRefreshListRunnable);
- h.postDelayed(mRefreshListRunnable, 100);
+ scheduleRefreshList();
}
@Override
public void onNotificationRankingUpdate(RankingMap ranking) {
+ logd("onNotificationRankingUpdate with update for %d",
+ ranking == null ? 0 : ranking.getOrderedKeys().length);
mRanking = ranking;
+ scheduleRefreshList();
}
@Override
public void onListenerConnected() {
mRanking = getCurrentRanking();
+ logd("onListenerConnected with update for %d",
+ mRanking == null ? 0 : mRanking.getOrderedKeys().length);
+ scheduleRefreshList();
}
};
+ private void scheduleRefreshList() {
+ if (mHandler != null) {
+ mHandler.removeCallbacks(mRefreshListRunnable);
+ mHandler.postDelayed(mRefreshListRunnable, 100);
+ }
+ }
+
private Context mContext;
private final Comparator<HistoricalNotificationInfo> mNotificationSorter
public void onAttach(Activity activity) {
logd("onAttach(%s)", activity.getClass().getSimpleName());
super.onAttach(activity);
+ mHandler = new Handler(activity.getMainLooper());
mContext = activity;
mPm = mContext.getPackageManager();
mNoMan = INotificationManager.Stub.asInterface(
}
@Override
+ public void onDetach() {
+ logd("onDetach()");
+ mHandler.removeCallbacks(mRefreshListRunnable);
+ mHandler = null;
+ super.onDetach();
+ }
+
+ @Override
public void onPause() {
try {
mListener.unregisterAsSystemService();
.append(bold(getString(R.string.notification_log_details_icon)))
.append(delim)
.append(n.getSmallIcon().toString());
- if (!TextUtils.isEmpty(n.getGroup())) {
+ if (sbn.isGroup()) {
sb.append("\n")
.append(bold(getString(R.string.notification_log_details_group)))
.append(delim)
- .append(n.getGroup());
+ .append(sbn.getGroupKey());
if (n.isGroupSummary()) {
sb.append(bold(
getString(R.string.notification_log_details_group_summary)));
.append(bold(getString(R.string.notification_log_details_priority)))
.append(delim)
.append(Notification.priorityToString(n.priority));
- if (mRanking != null && mRanking.getRanking(sbn.getKey(), rank)) {
- sb.append("\n")
- .append(bold(getString(
- R.string.notification_log_details_importance)))
- .append(delim)
- .append(Ranking.importanceToString(rank.getImportance()));
- if (rank.getImportanceExplanation() != null) {
+ if (resultset == active) {
+ // mRanking only applies to active notifications
+ if (mRanking != null && mRanking.getRanking(sbn.getKey(), rank)) {
sb.append("\n")
.append(bold(getString(
- R.string.notification_log_details_explanation)))
+ R.string.notification_log_details_importance)))
.append(delim)
- .append(rank.getImportanceExplanation());
+ .append(Ranking.importanceToString(rank.getImportance()));
+ if (rank.getImportanceExplanation() != null) {
+ sb.append("\n")
+ .append(bold(getString(
+ R.string.notification_log_details_explanation)))
+ .append(delim)
+ .append(rank.getImportanceExplanation());
+ }
+ } else {
+ if (mRanking == null) {
+ sb.append("\n")
+ .append(bold(getString(
+ R.string.notification_log_details_ranking_null)));
+ } else {
+ sb.append("\n")
+ .append(bold(getString(
+ R.string.notification_log_details_ranking_none)));
+ }
}
}
if (n.contentIntent != null) {
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() {
simPref.setTitle(R.string.cellular_data_title);
if (DBG) log("[updateCellularDataValues] mSubInfoList=" + mSubInfoList);
+ boolean callStateIdle = isCallStateIdle();
+ final boolean ecbMode = SystemProperties.getBoolean(
+ TelephonyProperties.PROPERTY_INECM_MODE, false);
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);
}
-
- 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);
}
private void updateCallValues() {