Merge "Bluetooth string changes"
diff --git a/Android.mk b/Android.mk
index 349b79c..eeaad0c 100644
--- a/Android.mk
+++ b/Android.mk
@@ -22,9 +22,10 @@
LOCAL_STATIC_ANDROID_LIBRARIES := \
android-support-v4 \
android-support-v13 \
- android-support-v7-recyclerview \
- android-support-v7-preference \
android-support-v7-appcompat \
+ android-support-v7-cardview \
+ android-support-v7-preference \
+ android-support-v7-recyclerview \
android-support-v14-preference
LOCAL_JAVA_LIBRARIES := \
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 7dd42df..4efabab 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -3013,7 +3013,7 @@
android:resource="@string/system_dashboard_summary"/>
</activity>
- <activity android:name=".dashboard.SupportDashboardActivity"
+ <activity android:name=".support.SupportDashboardActivity"
android:label="@string/page_tab_title_support"
android:icon="@drawable/ic_help"
android:theme="@android:style/Theme.NoDisplay"
diff --git a/res/layout/dashboard_header_spacer.xml b/res/layout/dashboard_header_spacer.xml
new file mode 100644
index 0000000..442ae48
--- /dev/null
+++ b/res/layout/dashboard_header_spacer.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:padding="@dimen/search_bar_margin">
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="?android:attr/actionBarSize"/>
+</LinearLayout>
diff --git a/res/layout/expand_preference.xml b/res/layout/expand_preference.xml
index f17e67c..729dfd9 100644
--- a/res/layout/expand_preference.xml
+++ b/res/layout/expand_preference.xml
@@ -28,10 +28,10 @@
android:clipToPadding="false">
<LinearLayout
- android:id="@+id/icon_container"
+ android:id="@+id/icon_frame"
+ style="@style/preference_icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:minWidth="56dp"
android:gravity="start|center_vertical"
android:orientation="horizontal"
android:paddingEnd="12dp"
diff --git a/res/layout/preference_material_settings.xml b/res/layout/preference_material_settings.xml
index 9682e32..e2ab3bb 100644
--- a/res/layout/preference_material_settings.xml
+++ b/res/layout/preference_material_settings.xml
@@ -28,10 +28,10 @@
android:clipToPadding="false">
<LinearLayout
- android:id="@+id/icon_container"
+ android:id="@+id/icon_frame"
+ style="@style/preference_icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:minWidth="56dp"
android:gravity="start|center_vertical"
android:orientation="horizontal"
android:paddingEnd="12dp"
diff --git a/res/layout/preference_small_icon.xml b/res/layout/preference_small_icon.xml
index a9f4c2f..e734b4b 100644
--- a/res/layout/preference_small_icon.xml
+++ b/res/layout/preference_small_icon.xml
@@ -29,10 +29,10 @@
android:focusable="true" >
<LinearLayout
- android:id="@android:id/icon_frame"
+ android:id="@+id/icon_frame"
+ style="@style/preference_icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:minWidth="56dp"
android:gravity="start|center_vertical"
android:orientation="horizontal"
android:paddingEnd="12dp"
diff --git a/res/layout/preference_volume_slider.xml b/res/layout/preference_volume_slider.xml
index 3eb0c97..107a8ae 100644
--- a/res/layout/preference_volume_slider.xml
+++ b/res/layout/preference_volume_slider.xml
@@ -26,7 +26,7 @@
android:orientation="horizontal">
<LinearLayout
- android:id="@+id/icon_container"
+ android:id="@+id/icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="44dp"
diff --git a/res/layout/settings_main_dashboard.xml b/res/layout/settings_main_dashboard.xml
index c10193c..1a3b133 100644
--- a/res/layout/settings_main_dashboard.xml
+++ b/res/layout/settings_main_dashboard.xml
@@ -18,7 +18,31 @@
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/main_content"
- android:layout_height="match_parent"
- android:layout_width="match_parent"
- />
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
+ <FrameLayout
+ android:id="@+id/main_content"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"/>
+ <android.support.v7.widget.CardView
+ android:id="@+id/search_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/search_bar_margin"
+ app:cardCornerRadius="2dp"
+ app:cardBackgroundColor="?android:attr/colorBackground"
+ app:cardElevation="2dp">
+ <Toolbar
+ android:id="@+id/search_action_bar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/search_bar_negative_margin"
+ android:background="?android:attr/selectableItemBackground"
+ android:navigationIcon="@drawable/ic_search_24dp"
+ android:title="@string/search_menu"
+ android:titleTextAppearance="?android:attr/subtitleTextAppearance"
+ android:titleTextColor="?android:attr/textColorHint"
+ android:theme="?android:attr/actionBarTheme"/>
+ </android.support.v7.widget.CardView>
+</FrameLayout>
diff --git a/res/layout/storage_item.xml b/res/layout/storage_item.xml
index 0c1f60c..a234dc0 100644
--- a/res/layout/storage_item.xml
+++ b/res/layout/storage_item.xml
@@ -20,24 +20,26 @@
android:orientation="vertical"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
- android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingTop="16dip"
android:paddingBottom="16dip"
- android:background="?android:attr/selectableItemBackground">
+ android:background="?android:attr/selectableItemBackground"
+ android:clipToPadding="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
- android:orientation="horizontal">
+ android:orientation="horizontal"
+ android:clipToPadding="false"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart">
<LinearLayout
- android:id="@android:id/icon_frame"
+ android:id="@+id/icon_frame"
+ style="@style/preference_icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="start|center_vertical"
- android:minWidth="60dp"
android:orientation="horizontal"
android:paddingEnd="12dp"
android:paddingTop="4dp"
@@ -76,7 +78,7 @@
android:id="@android:id/progress"
android:layout_width="match_parent"
android:layout_height="8dp"
- android:layout_marginStart="60dp"
+ android:layout_marginStart="72dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:visibility="gone"
diff --git a/res/layout/storage_volume.xml b/res/layout/storage_volume.xml
index 570cec6..39a6f85 100644
--- a/res/layout/storage_volume.xml
+++ b/res/layout/storage_volume.xml
@@ -26,10 +26,9 @@
<LinearLayout
android:id="@+id/icon_frame"
+ style="@style/preference_icon_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="-4dp"
- android:minWidth="60dp"
android:gravity="start|center_vertical"
android:orientation="horizontal"
android:paddingEnd="12dp"
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 592b30a..b579bd4 100755
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -139,6 +139,12 @@
<dimen name="search_suggestion_item_image_margin_start">32dp</dimen>
<dimen name="search_suggestion_item_image_margin_end">32dp</dimen>
+ <!-- The following two margins need to match, with the caveat that
+ the second should be negative. The second one ensures that the icons and text
+ align despite the additional padding caused by the search bar's card background. -->
+ <dimen name="search_bar_margin">8dp</dimen>
+ <dimen name="search_bar_negative_margin">-8dp</dimen>
+
<!-- Dimensions for Wifi Assistant Card -->
<dimen name="wifi_assistant_padding_top_bottom">16dp</dimen>
<dimen name="wifi_assistant_padding_start_end">16dp</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f7b2052..051bd68 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -256,11 +256,11 @@
<!-- Bluetooth Visibility message. This message informs the user that their device is now visible to other bluetooth devices. [CHAR LIMIT=NONE] -->
<string name="bluetooth_is_visible_message"><xliff:g id="device_name">%1$s</xliff:g> is visible to nearby devices while Bluetooth settings is open.</string>
<!-- Bluetooth mac address message. This message shows the bluetooth mac address for this device. [CHAR LIMIT=120] -->
- <string name="bluetooth_footer_mac_message" product="default">Your phone\'s Bluetooth address: <xliff:g id="bluetooth_mac_address">%1$s</xliff:g></string>
+ <string name="bluetooth_footer_mac_message" product="default">Phone\'s Bluetooth address: <xliff:g id="bluetooth_mac_address">%1$s</xliff:g></string>
<!-- Bluetooth mac address message. This message shows the bluetooth mac address for this device. [CHAR LIMIT=120] -->
- <string name="bluetooth_footer_mac_message" product="tablet">Your tablet\'s Bluetooth address: <xliff:g id="bluetooth_mac_address">%1$s</xliff:g></string>
+ <string name="bluetooth_footer_mac_message" product="tablet">Tablet\'s Bluetooth address: <xliff:g id="bluetooth_mac_address">%1$s</xliff:g></string>
<!-- Bluetooth mac address message. This message shows the bluetooth mac address for this device. [CHAR LIMIT=120] -->
- <string name="bluetooth_footer_mac_message" product="device">Your device\'s Bluetooth address: <xliff:g id="bluetooth_mac_address">%1$s</xliff:g></string>
+ <string name="bluetooth_footer_mac_message" product="device">Device\'s Bluetooth address: <xliff:g id="bluetooth_mac_address">%1$s</xliff:g></string>
<!-- Bluetooth Visibility disconnect question. Asks the user if they wish to disconnect a paired bluetooth device. [CHAR LIMIT=50] -->
<string name="bluetooth_is_disconnect_question">Disconnect <xliff:g id="device_name">%1$s</xliff:g>?</string>
@@ -385,7 +385,7 @@
<string name="bluetooth_sap_acceptance_dialog_text"><xliff:g id="device_name">%1$s</xliff:g> wants to access your SIM card. Granting access to the SIM card will disable data connectivity on your device for the duration of the connection. Give access to <xliff:g id="device_name">%2$s?</xliff:g></string>
<!-- Description for bluetooth device name summary [CHAR LIMIT=none] -->
- <string name="bluetooth_device_name_summary">Visible to other devices as: <xliff:g id="device_name">^1</xliff:g></string>
+ <string name="bluetooth_device_name_summary">Visible as \'<xliff:g id="device_name">^1</xliff:g>\' to other devices</string>
<!-- Title for paired device group [CHAR LIMIT=none] -->
<string name="bluetooth_paired_device_title">Your devices</string>
@@ -2377,40 +2377,38 @@
<string name="night_display_title">Night Light</string>
<!-- Night display screen, description of night display feature (renamed "Night Light" with title caps). [CHAR LIMIT=NONE] -->
<string name="night_display_text">Night Light tints your screen amber. This makes it easier to look at your screen or read in dim light, and may help you fall asleep more easily.</string>
- <!-- Night display screen, category title for settings to schedule when night display activates automatically. [CHAR LIMIT=30] -->
- <string name="night_display_category_schedule">Schedule</string>
- <!-- Night display screen, category title for settings to manually activate night display. [CHAR LIMIT=30] -->
- <string name="night_display_category_status">Status</string>
<!-- Night display screen, setting option name to configure whether night display turn on/off automatically. [CHAR LIMIT=30] -->
- <string name="night_display_auto_mode_title">Turn on automatically</string>
+ <string name="night_display_auto_mode_title">Schedule</string>
<!-- Night display screen, setting option value for night display to *never* turn on/off automatically. [CHAR LIMIT=30] -->
- <string name="night_display_auto_mode_never">Never</string>
- <!-- Night display screen, setting option value for night display to turn on/off automatically according to a user defined schedule. [CHAR LIMIT=30] -->
- <string name="night_display_auto_mode_custom">Custom schedule</string>
- <!-- Night display screen, setting option value for night display to turn on/off automatically at sunset/sunrise. [CHAR LIMIT=30] -->
- <string name="night_display_auto_mode_twilight">Sunset to sunrise</string>
+ <string name="night_display_auto_mode_never">None</string>
+ <!-- Night display screen, setting option value for night display to turn on/off automatically according to a user defined schedule. [CHAR LIMIT=32] -->
+ <string name="night_display_auto_mode_custom">Turns on at custom time</string>
+ <!-- Night display screen, setting option value for night display to turn on/off automatically at sunset/sunrise. [CHAR LIMIT=32] -->
+ <string name="night_display_auto_mode_twilight">Turns on from sunset to sunrise</string>
<!-- Night display screen, setting option name to configure time to automatically turn on night display. [CHAR LIMIT=30] -->
<string name="night_display_start_time_title">Start time</string>
<!-- Night display screen, setting option name to configure time to automatically turn off night display. [CHAR LIMIT=30] -->
<string name="night_display_end_time_title">End time</string>
+ <!-- Night display screen, setting option name controlling the current activation status. [CHAR LIMIT=30] -->
+ <string name="night_display_status_title">Status</string>
<!-- Night display screen, setting the color temperature of the display. [CHAR LIMIT=30] -->
<string name="night_display_temperature_title">Intensity</string>
<!-- Display settings screen, summary format of night display when off. [CHAR LIMIT=NONE] -->
- <string name="night_display_summary_off">Off. <xliff:g name="auto_mode_summary" example="Never turn on automatically">%1$s</xliff:g></string>
+ <string name="night_display_summary_off">Off / <xliff:g name="auto_mode_summary" example="Never turn on automatically">%1$s</xliff:g></string>
<!-- Display settings screen, summary of night display when off and will *never* turn on automatically. [CHAR LIMIT=NONE] -->
- <string name="night_display_summary_off_auto_mode_never">Will never turn on automatically.</string>
+ <string name="night_display_summary_off_auto_mode_never">Will never turn on automatically</string>
<!-- Display settings screen, summary format of night display when off and will turn on automatically at a user defined time. [CHAR LIMIT=NONE] -->
- <string name="night_display_summary_off_auto_mode_custom">Will turn on automatically at <xliff:g name="time" example="6 AM">%1$s</xliff:g>.</string>
+ <string name="night_display_summary_off_auto_mode_custom">Will turn on automatically at <xliff:g name="time" example="6 AM">%1$s</xliff:g></string>
<!-- Display settings screen, summary of night display when off and will turn on automatically at sunset. [CHAR LIMIT=NONE] -->
- <string name="night_display_summary_off_auto_mode_twilight">Will turn on automatically at sunset.</string>
+ <string name="night_display_summary_off_auto_mode_twilight">Will turn on automatically at sunset</string>
<!-- Display settings screen, summary format of night display when on. [CHAR LIMIT=NONE] -->
- <string name="night_display_summary_on">On. <xliff:g name="auto_mode_summary" example="Never turn off automatically">%1$s</xliff:g></string>
+ <string name="night_display_summary_on">On / <xliff:g name="auto_mode_summary" example="Never turn off automatically">%1$s</xliff:g></string>
<!-- Display settings screen, summary of night display when on and will *never* turn off automatically. [CHAR LIMIT=NONE] -->
- <string name="night_display_summary_on_auto_mode_never">Will never turn off automatically.</string>
+ <string name="night_display_summary_on_auto_mode_never">Will never turn off automatically</string>
<!-- Display settings screen, summary format of night display when on and will turn off automatically at a user defined time. [CHAR LIMIT=NONE] -->
- <string name="night_display_summary_on_auto_mode_custom">Will turn off automatically at <xliff:g name="time" example="10 PM">%1$s</xliff:g>.</string>
+ <string name="night_display_summary_on_auto_mode_custom">Will turn off automatically at <xliff:g name="time" example="10 PM">%1$s</xliff:g></string>
<!-- Display settings screen, summary of night display when on and will turn off automatically at sunrise. [CHAR LIMIT=NONE] -->
- <string name="night_display_summary_on_auto_mode_twilight">Will turn off automatically at sunrise.</string>
+ <string name="night_display_summary_on_auto_mode_twilight">Will turn off automatically at sunrise</string>
<!-- Sound & display settings screen, setting option name to change screen timeout -->
<string name="screen_timeout">Sleep</string>
@@ -8478,27 +8476,46 @@
<!-- Summary text for double tap power for camera [CHAR LIMIT=160]-->
<string name="double_tap_power_for_camera_summary">To quickly open camera, press the power button twice. Works from any screen.</string>
+ <!-- Title for settings suggestion for double tap power for camera [CHAR LIMIT=60] -->
+ <string name="double_tap_power_for_camera_suggestion_title">Open camera quickly</string>
+
+ <!-- Summary for settings suggestion for double tap power for camera [CHAR LIMIT=60] -->
+ <string name="double_tap_power_for_camera_suggestion_summary">Press power button twice to open camera</string>
+
<!-- Title text for double twist for camera mode [CHAR LIMIT=60]-->
<string name="double_twist_for_camera_mode_title">Flip camera</string>
<!-- Summary text for double twist for camera mode [CHAR LIMIT=160]-->
<string name="double_twist_for_camera_mode_summary"></string>
- <!-- Title text for ambient display double tap (phone) [CHAR LIMIT=60]-->
+ <!-- Title for settings suggestion for double twist for camera [CHAR LIMIT=60] -->
+ <string name="double_twist_for_camera_suggestion_title">Take selfies faster</string>
+
+ <!-- Summary for settings suggestion for double twist for camera (phone) [CHAR LIMIT=60] -->
+ <string name="double_twist_for_camera_suggestion_summary" product="default">Double-twist phone for selfie mode</string>
+ <!-- Summary for settings suggestion for double twist for camera (tablet) [CHAR LIMIT=60] -->
+ <string name="double_twist_for_camera_suggestion_summary" product="tablet">Double-twist tablet for selfie mode</string>
+ <!-- Summary for settings suggestion for double twist for camera (device) [CHAR LIMIT=60] -->
+ <string name="double_twist_for_camera_suggestion_summary" product="device">Double-twist device for selfie mode</string>
+
+ <!-- Preference and settings suggestion title text for ambient display double tap (phone) [CHAR LIMIT=60]-->
<string name="ambient_display_title" product="default">Double-tap to check phone</string>
- <!-- Title text for ambient display double tap (tablet) [CHAR LIMIT=60]-->
+ <!-- Preference and settings suggestion title text for ambient display double tap (tablet) [CHAR LIMIT=60]-->
<string name="ambient_display_title" product="tablet">Double-tap to check tablet</string>
- <!-- Title text for ambient display double tap (device) [CHAR LIMIT=60]-->
+ <!-- Preference and settings suggestion title text for ambient display double tap (device) [CHAR LIMIT=60]-->
<string name="ambient_display_title" product="device">Double-tap to check device</string>
<!-- Summary text for ambient display double tap [CHAR LIMIT=NONE]-->
<string name="ambient_display_summary">To check time, notification icons, and other info, double-tap your screen.</string>
- <!-- Title text for ambient display pick up (phone) [CHAR LIMIT=60]-->
+ <!-- Summary for settings suggestion for double tap power for camera [CHAR LIMIT=60] -->
+ <string name="ambient_display_suggestion_summary">Check notifications when screen is off</string>
+
+ <!-- Preference and settings suggestion title text for ambient display pick up (phone) [CHAR LIMIT=60]-->
<string name="ambient_display_pickup_title" product="default">Lift to check phone</string>
- <!-- Title text for ambient display pick up (tablet) [CHAR LIMIT=60]-->
+ <!-- Preference and settings suggestion title text for ambient display pick up (tablet) [CHAR LIMIT=60]-->
<string name="ambient_display_pickup_title" product="tablet">Lift to check tablet</string>
- <!-- Title text for ambient display pick up (device) [CHAR LIMIT=60]-->
+ <!-- Preference and settings suggestion title text for ambient display pick up (device) [CHAR LIMIT=60]-->
<string name="ambient_display_pickup_title" product="device">Lift to check device</string>
<!-- Summary text for ambient display (phone) [CHAR LIMIT=NONE]-->
@@ -8508,6 +8525,9 @@
<!-- Summary text for ambient display (device) [CHAR LIMIT=NONE]-->
<string name="ambient_display_pickup_summary" product="device">To check time, notification icons, and other info, pick up your device.</string>
+ <!-- Summary for settings suggestion for ambient display pick up [CHAR LIMIT=60] -->
+ <string name="ambient_display_pickup_suggestion_summary">Check notifications when screen is off</string>
+
<!-- Title text for swiping downwards on fingerprint sensor for notifications [CHAR LIMIT=80]-->
<string name="fingerprint_swipe_for_notifications_title">Swipe fingerprint for notifications</string>
@@ -8518,6 +8538,12 @@
<!-- Summary text for fingerprint swipe for notifications (device) [CHAR LIMIT=160]-->
<string name="fingerprint_swipe_for_notifications_summary" product="device">To check your notifications, swipe down on the fingerprint sensor on the back of your device.</string>
+ <!-- Title for settings suggestion for fingerprint swipe for notifications [CHAR LIMIT=60] -->
+ <string name="fingerprint_swipe_for_notifications_suggestion_title">See notifications quickly</string>
+
+ <!-- Summary for settings suggestion for fingerprint swipe for notifications [CHAR LIMIT=60] -->
+ <string name="fingerprint_swipe_for_notifications_suggestion_summary">Swipe down on the fingerprint sensor</string>
+
<!-- Title and settings suggestion title text for opening camera when lifting the phone to a photo-taking position [CHAR LIMIT=60]-->
<string name="camera_lift_trigger_title">Raise to open camera</string>
diff --git a/res/xml/night_display_settings.xml b/res/xml/night_display_settings.xml
index 5374b08..dc4fecd 100644
--- a/res/xml/night_display_settings.xml
+++ b/res/xml/night_display_settings.xml
@@ -18,35 +18,25 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/night_display_title">
- <PreferenceCategory
- android:title="@string/night_display_category_schedule">
+ <DropDownPreference
+ android:key="night_display_auto_mode"
+ android:title="@string/night_display_auto_mode_title"
+ android:summary="%s" />
- <DropDownPreference
- android:key="night_display_auto_mode"
- android:title="@string/night_display_auto_mode_title"
- android:summary="%s" />
+ <Preference
+ android:key="night_display_start_time"
+ android:title="@string/night_display_start_time_title" />
- <Preference
- android:key="night_display_start_time"
- android:title="@string/night_display_start_time_title" />
+ <Preference
+ android:key="night_display_end_time"
+ android:title="@string/night_display_end_time_title" />
- <Preference
- android:key="night_display_end_time"
- android:title="@string/night_display_end_time_title" />
+ <com.android.settings.display.NightDisplayPreference
+ android:key="night_display_activated"
+ android:title="@string/night_display_status_title" />
- </PreferenceCategory>
-
- <PreferenceCategory
- android:title="@string/night_display_category_status">
-
- <com.android.settings.display.NightDisplayPreference
- android:key="night_display_activated"
- android:title="@string/night_display_title" />
-
- <com.android.settings.widget.SeekBarPreference
+ <com.android.settings.widget.SeekBarPreference
android:key="night_display_temperature"
android:title="@string/night_display_temperature_title"/>
- </PreferenceCategory>
-
</PreferenceScreen>
\ No newline at end of file
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index fb64bd9..f61dfd3 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -50,6 +50,7 @@
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
+import android.widget.Toolbar;
import com.android.internal.util.ArrayUtils;
import com.android.settings.Settings.WifiSettingsActivity;
@@ -62,6 +63,7 @@
import com.android.settings.development.DevelopmentSettings;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.search.DynamicIndexableContentMonitor;
+import com.android.settings.search.SearchActivity;
import com.android.settings.search.SearchFeatureProvider;
import com.android.settings.wfd.WifiDisplaySettings;
import com.android.settings.widget.SwitchBar;
@@ -75,7 +77,7 @@
public class SettingsActivity extends SettingsDrawerActivity
implements PreferenceManager.OnPreferenceTreeClickListener,
PreferenceFragment.OnPreferenceStartFragmentCallback,
- ButtonBarHandler, FragmentManager.OnBackStackChangedListener {
+ ButtonBarHandler, FragmentManager.OnBackStackChangedListener, OnClickListener {
private static final String LOG_TAG = "Settings";
@@ -345,6 +347,14 @@
launchSettingFragment(initialFragmentName, isSubSettings, intent);
}
+ if (mIsShowingDashboard) {
+ findViewById(R.id.search_bar).setVisibility(View.VISIBLE);
+ findViewById(R.id.action_bar).setVisibility(View.GONE);
+ Toolbar toolbar = findViewById(R.id.search_action_bar);
+ toolbar.setOnClickListener(this);
+ setActionBar(toolbar);
+ }
+
mActionBar = getActionBar();
if (mActionBar != null) {
mActionBar.setDisplayHomeAsUpEnabled(mDisplayHomeAsUpEnabled);
@@ -432,10 +442,10 @@
switchToFragment(initialFragmentName, initialArguments, true, false,
mInitialTitleResId, mInitialTitle, false);
} else {
- // No UP affordance if we are displaying the main Dashboard
- mDisplayHomeAsUpEnabled = false;
- // Show Search affordance
- mDisplaySearch = true;
+ // Show search icon as up affordance if we are displaying the main Dashboard
+ mDisplayHomeAsUpEnabled = true;
+ // toolbar is search affordance so don't show search
+ mDisplaySearch = false;
mInitialTitleResId = R.string.dashboard_title;
switchToFragment(DashboardSummary.class.getName(), null /* args */, false, false,
@@ -939,4 +949,10 @@
return bitmap;
}
-}
\ No newline at end of file
+
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(this, SearchActivity.class);
+ startActivity(intent);
+ }
+}
diff --git a/src/com/android/settings/applications/AppStorageSettings.java b/src/com/android/settings/applications/AppStorageSettings.java
index 5ad5e48..e21ab7e 100644
--- a/src/com/android/settings/applications/AppStorageSettings.java
+++ b/src/com/android/settings/applications/AppStorageSettings.java
@@ -543,8 +543,8 @@
mClearCacheButton.setEnabled(false);
} else {
long codeSize = result.getCodeBytes();
- long dataSize = result.getDataBytes();
long cacheSize = result.getCacheBytes();
+ long dataSize = result.getDataBytes() - cacheSize;
if (dataSize <= 0 || !mCanClearData || mDataCleared) {
mClearDataButton.setEnabled(false);
diff --git a/src/com/android/settings/applications/AppStorageSizesController.java b/src/com/android/settings/applications/AppStorageSizesController.java
index 45ece6e..3626fab 100644
--- a/src/com/android/settings/applications/AppStorageSizesController.java
+++ b/src/com/android/settings/applications/AppStorageSizesController.java
@@ -70,7 +70,8 @@
mTotalSize.setSummary(errorRes);
} else {
long codeSize = mLastResult.getCodeBytes();
- long dataSize = mDataCleared ? 0 : mLastResult.getDataBytes();
+ long dataSize =
+ mDataCleared ? 0 : mLastResult.getDataBytes() - mLastResult.getCacheBytes();
if (mLastCodeSize != codeSize) {
mLastCodeSize = codeSize;
mAppSize.setSummary(getSizeStr(context, codeSize));
diff --git a/src/com/android/settings/backup/BackupSettingsActivity.java b/src/com/android/settings/backup/BackupSettingsActivity.java
index 3fe740e..7ffc6cd 100644
--- a/src/com/android/settings/backup/BackupSettingsActivity.java
+++ b/src/com/android/settings/backup/BackupSettingsActivity.java
@@ -94,14 +94,12 @@
// Add the activity title
SearchIndexableRaw data = new SearchIndexableRaw(context);
- data.title = context.getResources().getString(R.string.privacy_settings_title);
- data.screenTitle = context.getResources().getString(
- R.string.privacy_settings_title);
- data.keywords = context.getResources().getString(
- R.string.keywords_backup);
+ data.title = context.getString(R.string.privacy_settings_title);
+ data.screenTitle = context.getString(R.string.settings_label);
+ data.keywords = context.getString(R.string.keywords_backup);
data.intentTargetPackage = context.getPackageName();
data.intentTargetClass = BackupSettingsActivity.class.getName();
- data.intentAction = "android.intent.action.MAIN";
+ data.intentAction = Intent.ACTION_MAIN;
data.key = BACKUP_SEARCH_INDEX_KEY;
result.add(data);
diff --git a/src/com/android/settings/core/gateway/SettingsGateway.java b/src/com/android/settings/core/gateway/SettingsGateway.java
index 34328de..bd43b9b 100644
--- a/src/com/android/settings/core/gateway/SettingsGateway.java
+++ b/src/com/android/settings/core/gateway/SettingsGateway.java
@@ -23,8 +23,6 @@
import com.android.settings.DeviceAdminSettings;
import com.android.settings.DeviceInfoSettings;
import com.android.settings.DisplaySettings;
-import com.android.settings.dashboard.SupportDashboardActivity;
-import com.android.settings.dream.DreamSettings;
import com.android.settings.IccLockSettings;
import com.android.settings.MasterClear;
import com.android.settings.PrivacySettings;
@@ -74,6 +72,7 @@
import com.android.settings.deviceinfo.StorageDashboardFragment;
import com.android.settings.deviceinfo.StorageSettings;
import com.android.settings.display.NightDisplaySettings;
+import com.android.settings.dream.DreamSettings;
import com.android.settings.enterprise.EnterprisePrivacySettings;
import com.android.settings.fuelgauge.AdvancedPowerUsageDetail;
import com.android.settings.fuelgauge.BatterySaverSettings;
@@ -114,6 +113,7 @@
import com.android.settings.print.PrintSettingsFragment;
import com.android.settings.security.LockscreenDashboardFragment;
import com.android.settings.sim.SimSettings;
+import com.android.settings.support.SupportDashboardActivity;
import com.android.settings.system.ResetDashboardFragment;
import com.android.settings.system.SystemDashboardFragment;
import com.android.settings.tts.TextToSpeechSettings;
diff --git a/src/com/android/settings/dashboard/DashboardAdapter.java b/src/com/android/settings/dashboard/DashboardAdapter.java
index 2e7b861..eb74690 100644
--- a/src/com/android/settings/dashboard/DashboardAdapter.java
+++ b/src/com/android/settings/dashboard/DashboardAdapter.java
@@ -15,6 +15,8 @@
*/
package com.android.settings.dashboard;
+import android.annotation.AttrRes;
+import android.annotation.ColorInt;
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
@@ -54,6 +56,7 @@
private static final String STATE_CATEGORY_LIST = "category_list";
private static final String STATE_SUGGESTION_MODE = "suggestion_mode";
private static final String STATE_SUGGESTIONS_SHOWN_LOGGED = "suggestions_shown_logged";
+ private static final int DONT_SET_BACKGROUND_ATTR = -1;
private final IconCache mCache;
private final Context mContext;
@@ -223,6 +226,9 @@
public void onBindViewHolder(DashboardItemHolder holder, int position) {
final int type = mDashboardData.getItemTypeByPosition(position);
switch (type) {
+ case R.layout.dashboard_header_spacer:
+ onBindHeaderSpacer(holder, position);
+ break;
case R.layout.dashboard_category:
onBindCategory(holder,
(DashboardCategory) mDashboardData.getItemEntityByPosition(position));
@@ -343,6 +349,33 @@
notifyDashboardDataChanged(prevData);
}
+ private void onBindHeaderSpacer(DashboardItemHolder holder, int position) {
+ if (mDashboardData.size() > (position + 1)) {
+ // The spacer that goes underneath the search bar needs to match the
+ // background of the first real view. That view is either a condition,
+ // a suggestion, or the dashboard item.
+ //
+ // If it's a dashboard item, set null background so it uses the parent's
+ // background like the other views. Otherwise, match the colors.
+ int nextType = mDashboardData.getItemTypeByPosition(position + 1);
+ int colorAttr = nextType == R.layout.suggestion_header
+ ? android.R.attr.colorSecondary
+ : nextType == R.layout.condition_card
+ ? android.R.attr.colorAccent
+ : DONT_SET_BACKGROUND_ATTR;
+
+ if (colorAttr != DONT_SET_BACKGROUND_ATTR) {
+ TypedArray array = holder.itemView.getContext()
+ .obtainStyledAttributes(new int[]{colorAttr});
+ @ColorInt int color = array.getColor(0, 0);
+ array.recycle();
+ holder.itemView.setBackgroundColor(color);
+ } else {
+ holder.itemView.setBackground(null);
+ }
+ }
+ }
+
@VisibleForTesting
void onBindSuggestionHeader(final DashboardItemHolder holder, DashboardData
.SuggestionHeaderData data) {
diff --git a/src/com/android/settings/dashboard/DashboardData.java b/src/com/android/settings/dashboard/DashboardData.java
index 0a5ff35..60d7d8d 100644
--- a/src/com/android/settings/dashboard/DashboardData.java
+++ b/src/com/android/settings/dashboard/DashboardData.java
@@ -45,7 +45,8 @@
public static final int DEFAULT_SUGGESTION_COUNT = 2;
// id namespace for different type of items.
- private static final int NS_SPACER = 0;
+ private static final int NS_HEADER_SPACER = 0;
+ private static final int NS_SPACER = 1000;
private static final int NS_ITEMS = 2000;
private static final int NS_CONDITION = 3000;
@@ -234,6 +235,9 @@
* and mIsShowingAll, mSuggestionMode flag.
*/
private void buildItemsData() {
+ // add the view that goes under the search bar
+ countItem(null, R.layout.dashboard_header_spacer, true, NS_HEADER_SPACER);
+ resetCount();
boolean hasConditions = false;
for (int i = 0; mConditions != null && i < mConditions.size(); i++) {
boolean shouldShow = mConditions.get(i).shouldShow();
diff --git a/src/com/android/settings/dashboard/SupportDashboardActivity.java b/src/com/android/settings/dashboard/SupportDashboardActivity.java
deleted file mode 100644
index 6787089..0000000
--- a/src/com/android/settings/dashboard/SupportDashboardActivity.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.android.settings.dashboard;
-
-import android.app.Activity;
-import android.content.Intent;
-import android.os.Bundle;
-import com.android.settings.Settings.LegacySupportActivity;
-import com.android.settings.overlay.FeatureFactory;
-import com.android.settings.overlay.SupportFeatureProvider;
-
-/**
- * Trampoline activity that decides which version of support should be shown to the user.
- */
-public class SupportDashboardActivity extends Activity {
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- SupportFeatureProvider supportFeatureProvider = FeatureFactory.getFactory(this)
- .getSupportFeatureProvider(this);
-
- // try to launch support v2 if we have the feature provider
- if (supportFeatureProvider != null && supportFeatureProvider.isSupportV2Enabled()) {
- supportFeatureProvider.startSupportV2(this);
- } else {
- startActivity(new Intent(this, LegacySupportActivity.class));
- }
- finish();
- }
-}
diff --git a/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java
index 964e046..14c5ae2 100644
--- a/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java
+++ b/src/com/android/settings/fingerprint/FingerprintEnrollEnrolling.java
@@ -160,6 +160,14 @@
}
@Override
+ protected void onResume() {
+ super.onResume();
+ if (mSidecar != null) {
+ mSidecar.setListener(this);
+ }
+ }
+
+ @Override
protected void onPause() {
super.onPause();
if (mSidecar != null) {
diff --git a/src/com/android/settings/fuelgauge/BatteryUtils.java b/src/com/android/settings/fuelgauge/BatteryUtils.java
index 194b2fb..a9792af 100644
--- a/src/com/android/settings/fuelgauge/BatteryUtils.java
+++ b/src/com/android/settings/fuelgauge/BatteryUtils.java
@@ -261,6 +261,19 @@
});
}
+ /**
+ * Calculate the time since last full charge, including the device off time
+ *
+ * @param batteryStatsHelper utility class that contains the data
+ * @param currentTimeMs current wall time
+ * @return time in millis
+ */
+ public long calculateLastFullChargeTime(BatteryStatsHelper batteryStatsHelper,
+ long currentTimeMs) {
+ return currentTimeMs - batteryStatsHelper.getStats().getStartClockTime();
+
+ }
+
private long convertUsToMs(long timeUs) {
return timeUs / 1000;
}
diff --git a/src/com/android/settings/fuelgauge/PowerUsageSummary.java b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
index 275b78c..adea925 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageSummary.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageSummary.java
@@ -24,7 +24,6 @@
import android.content.IntentFilter;
import android.content.Loader;
import android.content.res.TypedArray;
-import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.drawable.Drawable;
import android.net.Uri;
@@ -42,13 +41,11 @@
import android.support.v7.preference.PreferenceGroup;
import android.text.TextUtils;
import android.text.format.DateUtils;
-import android.text.format.Formatter;
import android.util.Log;
import android.util.SparseArray;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
-import android.widget.TextView;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.internal.os.BatterySipper;
@@ -490,12 +487,13 @@
BatteryInfo batteryInfo = getBatteryInfo(elapsedRealtimeUs, batteryBroadcast);
mBatteryHeaderPreferenceController.updateHeaderPreference(batteryInfo);
- final long runningTime = mBatteryUtils.calculateRunningTimeBasedOnStatsType(mStatsHelper,
- mStatsType);
+ final long lastFullChargeTime = mBatteryUtils.calculateLastFullChargeTime(mStatsHelper,
+ System.currentTimeMillis());
updateScreenPreference();
- updateLastFullChargePreference(runningTime);
+ updateLastFullChargePreference(lastFullChargeTime);
- final CharSequence timeSequence = Utils.formatElapsedTime(context, runningTime, false);
+ final CharSequence timeSequence = Utils.formatElapsedTime(context, lastFullChargeTime,
+ false);
final int resId = mShowAllApps ? R.string.power_usage_list_summary_device
: R.string.power_usage_list_summary;
mAppListGroup.setTitle(TextUtils.expandTemplate(getText(resId), timeSequence));
diff --git a/src/com/android/settings/search/SearchFeatureProviderImpl.java b/src/com/android/settings/search/SearchFeatureProviderImpl.java
index 725a8ee..8bb57c6 100644
--- a/src/com/android/settings/search/SearchFeatureProviderImpl.java
+++ b/src/com/android/settings/search/SearchFeatureProviderImpl.java
@@ -51,13 +51,10 @@
String menuTitle = activity.getString(R.string.search_menu);
MenuItem menuItem = menu.add(Menu.NONE, Menu.NONE, Menu.NONE, menuTitle)
.setIcon(R.drawable.ic_search_24dp)
- .setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
- @Override
- public boolean onMenuItemClick(MenuItem item) {
- Intent intent = new Intent(activity, SearchActivity.class);
- activity.startActivity(intent);
- return true;
- }
+ .setOnMenuItemClickListener(item -> {
+ Intent intent = new Intent(activity, SearchActivity.class);
+ activity.startActivity(intent);
+ return true;
});
menuItem.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
diff --git a/src/com/android/settings/search/SearchIndexableResources.java b/src/com/android/settings/search/SearchIndexableResources.java
index 963aff4..431729f 100644
--- a/src/com/android/settings/search/SearchIndexableResources.java
+++ b/src/com/android/settings/search/SearchIndexableResources.java
@@ -42,6 +42,7 @@
import com.android.settings.bluetooth.BluetoothSettings;
import com.android.settings.bluetooth.BluetoothSettingsObsolete;
import com.android.settings.connecteddevice.ConnectedDeviceDashboardFragment;
+import com.android.settings.support.SupportDashboardActivity;
import com.android.settings.datausage.DataUsageMeteredSettings;
import com.android.settings.datausage.DataUsageSummary;
import com.android.settings.development.DevelopmentSettings;
@@ -55,12 +56,12 @@
import com.android.settings.fuelgauge.PowerUsageAdvanced;
import com.android.settings.fuelgauge.PowerUsageSummary;
import com.android.settings.gestures.AssistGestureSettings;
+import com.android.settings.gestures.CameraLiftTriggerSettings;
import com.android.settings.gestures.DoubleTapPowerSettings;
import com.android.settings.gestures.DoubleTapScreenSettings;
import com.android.settings.gestures.DoubleTwistGestureSettings;
import com.android.settings.gestures.PickupGestureSettings;
import com.android.settings.gestures.SwipeToNotificationSettings;
-import com.android.settings.gestures.CameraLiftTriggerSettings;
import com.android.settings.inputmethod.AvailableVirtualKeyboardFragment;
import com.android.settings.inputmethod.PhysicalKeyboardFragment;
import com.android.settings.inputmethod.VirtualKeyboardFragment;
@@ -190,6 +191,7 @@
addIndex(ChannelImportanceSettings.class, NO_DATA_RES_ID,
R.drawable.ic_settings_notifications);
addIndex(DreamSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_display);
+ addIndex(SupportDashboardActivity.class, NO_DATA_RES_ID, R.drawable.ic_help);
}
private SearchIndexableResources() {
diff --git a/src/com/android/settings/support/SupportDashboardActivity.java b/src/com/android/settings/support/SupportDashboardActivity.java
new file mode 100644
index 0000000..068d4e1
--- /dev/null
+++ b/src/com/android/settings/support/SupportDashboardActivity.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.settings.support;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+
+import com.android.settings.R;
+import com.android.settings.Settings.LegacySupportActivity;
+import com.android.settings.overlay.FeatureFactory;
+import com.android.settings.overlay.SupportFeatureProvider;
+import com.android.settings.search.BaseSearchIndexProvider;
+import com.android.settings.search.Indexable;
+import com.android.settings.search.SearchIndexableRaw;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Trampoline activity that decides which version of support should be shown to the user.
+ */
+public class SupportDashboardActivity extends Activity implements Indexable {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ SupportFeatureProvider supportFeatureProvider = FeatureFactory.getFactory(this)
+ .getSupportFeatureProvider(this);
+
+ // try to launch support v2 if we have the feature provider
+ if (supportFeatureProvider != null && supportFeatureProvider.isSupportV2Enabled()) {
+ supportFeatureProvider.startSupportV2(this);
+ } else {
+ startActivity(new Intent(this, LegacySupportActivity.class));
+ }
+ finish();
+ }
+
+ /**
+ * For Search.
+ */
+ public static final Indexable.SearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
+ new BaseSearchIndexProvider() {
+ private static final String SUPPORT_SEARCH_INDEX_KEY = "support_dashboard_activity";
+
+ @Override
+ public List<SearchIndexableRaw> getRawDataToIndex(Context context,
+ boolean enabled) {
+
+ final List<SearchIndexableRaw> result = new ArrayList<>();
+
+ // Add the activity title
+ SearchIndexableRaw data = new SearchIndexableRaw(context);
+ data.title = context.getString(R.string.page_tab_title_support);
+ data.screenTitle = context.getString(R.string.settings_label);
+ data.intentTargetPackage = context.getPackageName();
+ data.intentTargetClass = SupportDashboardActivity.class.getName();
+ data.intentAction = Intent.ACTION_MAIN;
+ data.key = SUPPORT_SEARCH_INDEX_KEY;
+ result.add(data);
+
+ return result;
+ }
+
+ @Override
+ public List<String> getNonIndexableKeys(Context context) {
+ final List<String> keys = super.getNonIndexableKeys(context);
+ if (!context.getResources().getBoolean(R.bool.config_support_enabled)) {
+ keys.add(SUPPORT_SEARCH_INDEX_KEY);
+ }
+ return keys;
+ }
+ };
+}
diff --git a/tests/robotests/src/com/android/settings/SettingsActivityTest.java b/tests/robotests/src/com/android/settings/SettingsActivityTest.java
index 2250090..75080cc 100644
--- a/tests/robotests/src/com/android/settings/SettingsActivityTest.java
+++ b/tests/robotests/src/com/android/settings/SettingsActivityTest.java
@@ -30,12 +30,14 @@
import android.app.ActivityManager;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
+import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.Menu;
+import com.android.settings.search.SearchActivity;
import com.android.settings.testutils.FakeFeatureFactory;
import org.junit.Before;
@@ -46,6 +48,7 @@
import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowApplication;
import org.robolectric.util.ReflectionHelpers;
@RunWith(SettingsRobolectricTestRunner.class)
@@ -140,4 +143,15 @@
assertThat(mActivity.mDisplaySearch).isTrue();
}
+
+ @Test
+ public void testOnClick() {
+ doReturn("com.android.settings").when(mActivity).getPackageName();
+
+ mActivity.onClick(null);
+
+ Intent intent = ShadowApplication.getInstance().getNextStartedActivity();
+ assertThat(intent.getComponent()).isEqualTo(
+ new ComponentName("com.android.settings", SearchActivity.class.getName()));
+ }
}
diff --git a/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java b/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java
index 36d78c1..e302edd 100644
--- a/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java
+++ b/tests/robotests/src/com/android/settings/applications/AppStorageSizesControllerTest.java
@@ -14,11 +14,9 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RuntimeEnvironment;
import org.robolectric.annotation.Config;
-import org.robolectric.shadows.ShadowApplication;
import com.android.settings.R;
import com.android.settingslib.applications.StorageStatsSource.AppStorageStats;
@@ -82,15 +80,15 @@
when(result.getCodeBytes()).thenReturn(1L);
when(result.getCacheBytes()).thenReturn(10L);
when(result.getDataBytes()).thenReturn(100L);
- when(result.getTotalBytes()).thenReturn(111L);
+ when(result.getTotalBytes()).thenReturn(101L);
mController.setResult(result);
mController.updateUi(mContext);
assertThat(mAppPreference.getSummary()).isEqualTo("1.00B");
assertThat(mCachePreference.getSummary()).isEqualTo("10.00B");
- assertThat(mDataPreference.getSummary()).isEqualTo("100B");
- assertThat(mTotalPreference.getSummary()).isEqualTo("111B");
+ assertThat(mDataPreference.getSummary()).isEqualTo("90.00B");
+ assertThat(mTotalPreference.getSummary()).isEqualTo("101B");
}
@Test
@@ -99,7 +97,7 @@
when(result.getCodeBytes()).thenReturn(1L);
when(result.getCacheBytes()).thenReturn(10L);
when(result.getDataBytes()).thenReturn(100L);
- when(result.getTotalBytes()).thenReturn(111L);
+ when(result.getTotalBytes()).thenReturn(101L);
mController.setResult(result);
mController.setCacheCleared(true);
@@ -107,8 +105,8 @@
assertThat(mAppPreference.getSummary()).isEqualTo("1.00B");
assertThat(mCachePreference.getSummary()).isEqualTo("0.00B");
- assertThat(mDataPreference.getSummary()).isEqualTo("100B");
- assertThat(mTotalPreference.getSummary()).isEqualTo("101B");
+ assertThat(mDataPreference.getSummary()).isEqualTo("90.00B");
+ assertThat(mTotalPreference.getSummary()).isEqualTo("91.00B");
}
@Test
@@ -117,7 +115,7 @@
when(result.getCodeBytes()).thenReturn(1L);
when(result.getCacheBytes()).thenReturn(10L);
when(result.getDataBytes()).thenReturn(100L);
- when(result.getTotalBytes()).thenReturn(111L);
+ when(result.getTotalBytes()).thenReturn(101L);
mController.setResult(result);
mController.setDataCleared(true);
diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java
index 7c1fc1c..d6077d8 100644
--- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDeviceNamePreferenceControllerTest.java
@@ -94,7 +94,7 @@
final Object[] spans = ((SpannableStringBuilder) summary).getSpans(0, summary.length(),
Object.class);
assertThat(summary.toString())
- .isEqualTo("Visible to other devices as: Nightshade");
+ .isEqualTo("Visible as 'Nightshade' to other devices");
// Test summary only has one color span
assertThat(spans).asList().hasSize(1);
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
index 365ba55..8eae8bc 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardAdapterTest.java
@@ -24,17 +24,19 @@
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static org.robolectric.RuntimeEnvironment.application;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
+import android.graphics.drawable.ColorDrawable;
import android.view.ContextThemeWrapper;
+import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
+import android.widget.LinearLayout;
import android.widget.RemoteViews;
import android.widget.TextView;
@@ -47,6 +49,7 @@
import com.android.settings.testutils.FakeFeatureFactory;
import com.android.settings.testutils.shadow.SettingsShadowResources;
import com.android.settings.testutils.shadow.ShadowDynamicIndexableContentMonitor;
+import com.android.settingslib.drawer.DashboardCategory;
import com.android.settingslib.drawer.Tile;
import org.junit.Before;
@@ -58,6 +61,7 @@
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;
+import org.robolectric.RuntimeEnvironment;
import org.robolectric.shadows.ShadowApplication;
import java.util.ArrayList;
@@ -113,6 +117,53 @@
}
@Test
+ public void testOnBindViewHolder_spacer_noSuggestions_noConditions() {
+ makeCategory();
+ DashboardAdapter.DashboardItemHolder holder = setupSpacer();
+
+ mDashboardAdapter.onBindViewHolder(holder, 0);
+
+ assertThat(holder.itemView.getBackground()).isNull();
+ }
+
+ @Test
+ public void testOnBindViewHolder_spacer_suggestion_noConditions() {
+ setupSuggestions(makeSuggestions("pkg1"));
+ makeCategory();
+ DashboardAdapter.DashboardItemHolder holder = setupSpacer();
+
+ mDashboardAdapter.onBindViewHolder(holder, 0);
+
+ assertThat(holder.itemView.getBackground()).isNotNull();
+ assertThat(holder.itemView.getBackground()).isInstanceOf(ColorDrawable.class);
+ }
+
+ @Test
+ public void testOnBindViewHolder_spacer_noSuggestion_condition() {
+ makeCondition();
+ makeCategory();
+ DashboardAdapter.DashboardItemHolder holder = setupSpacer();
+
+ mDashboardAdapter.onBindViewHolder(holder, 0);
+
+ assertThat(holder.itemView.getBackground()).isNotNull();
+ assertThat(holder.itemView.getBackground()).isInstanceOf(ColorDrawable.class);
+ }
+
+ @Test
+ public void testOnBindViewHolder_spacer_suggestion_condition() {
+ setupSuggestions(makeSuggestions("pkg1"));
+ makeCondition();
+ makeCategory();
+ DashboardAdapter.DashboardItemHolder holder = setupSpacer();
+
+ mDashboardAdapter.onBindViewHolder(holder, 0);
+
+ assertThat(holder.itemView.getBackground()).isNotNull();
+ assertThat(holder.itemView.getBackground()).isInstanceOf(ColorDrawable.class);
+ }
+
+ @Test
public void testSetConditions_AfterSetConditions_ExpandedConditionNull() {
mDashboardAdapter.onExpandClick(mView);
assertThat(mDashboardAdapter.mDashboardData.getExpandedCondition()).isEqualTo(mCondition);
@@ -122,7 +173,7 @@
@Test
public void testSuggestionsLogs_NotExpanded() {
- setUpSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
+ setupSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
verify(mFactory.metricsFeatureProvider, times(2)).action(
any(Context.class), mActionCategoryCaptor.capture(),
mActionPackageCaptor.capture());
@@ -137,7 +188,7 @@
@Test
public void testSuggestionsLogs_NotExpandedAndPaused() {
- setUpSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
+ setupSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
mDashboardAdapter.onPause();
verify(mFactory.metricsFeatureProvider, times(4)).action(
any(Context.class), mActionCategoryCaptor.capture(),
@@ -154,7 +205,7 @@
@Test
public void testSuggestionsLogs_Expanded() {
- setUpSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
+ setupSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
mDashboardAdapter.onBindSuggestionHeader(
mSuggestionHolder, mSuggestionHeaderData);
mSuggestionHolder.itemView.callOnClick();
@@ -173,7 +224,7 @@
@Test
public void testSuggestionsLogs_ExpandedAndPaused() {
- setUpSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
+ setupSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
mDashboardAdapter.onBindSuggestionHeader(
mSuggestionHolder, mSuggestionHeaderData);
mSuggestionHolder.itemView.callOnClick();
@@ -196,7 +247,7 @@
@Test
public void testSuggestionsLogs_ExpandedAfterPause() {
- setUpSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
+ setupSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
mDashboardAdapter.onPause();
mDashboardAdapter.onBindSuggestionHeader(
mSuggestionHolder, mSuggestionHeaderData);
@@ -221,7 +272,7 @@
@Test
public void testSuggestionsLogs_ExpandedAfterPauseAndPausedAgain() {
- setUpSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
+ setupSuggestions(makeSuggestions("pkg1", "pkg2", "pkg3"));
mDashboardAdapter.onPause();
mDashboardAdapter.onBindSuggestionHeader(
mSuggestionHolder, mSuggestionHeaderData);
@@ -250,7 +301,7 @@
@Test
public void testSuggestionsLogs_ExpandedWithLessThanDefaultShown() {
- setUpSuggestions(makeSuggestions("pkg1"));
+ setupSuggestions(makeSuggestions("pkg1"));
mDashboardAdapter.onBindSuggestionHeader(
mSuggestionHolder, mSuggestionHeaderData);
mSuggestionHolder.itemView.callOnClick();
@@ -267,7 +318,7 @@
@Test
public void testSuggestionsLogs_ExpandedWithLessThanDefaultShownAndPaused() {
- setUpSuggestions(makeSuggestions("pkg1"));
+ setupSuggestions(makeSuggestions("pkg1"));
mDashboardAdapter.onBindSuggestionHeader(
mSuggestionHolder, mSuggestionHeaderData);
mSuggestionHolder.itemView.callOnClick();
@@ -286,7 +337,7 @@
@Test
public void testSuggestionsLogs_ExpandedWithLessThanDefaultShownAfterPause() {
- setUpSuggestions(makeSuggestions("pkg1"));
+ setupSuggestions(makeSuggestions("pkg1"));
mDashboardAdapter.onPause();
mDashboardAdapter.onBindSuggestionHeader(
mSuggestionHolder, mSuggestionHeaderData);
@@ -306,7 +357,7 @@
@Test
public void testSuggestionsLogs_ExpandedWithLessThanDefaultShownAfterPauseAndPausedAgain() {
- setUpSuggestions(makeSuggestions("pkg1"));
+ setupSuggestions(makeSuggestions("pkg1"));
mDashboardAdapter.onPause();
mDashboardAdapter.onBindSuggestionHeader(
mSuggestionHolder, mSuggestionHeaderData);
@@ -330,15 +381,15 @@
public void testBindViewHolder_inflateRemoteView() {
List<Tile> packages = makeSuggestions("pkg1");
RemoteViews remoteViews = mock(RemoteViews.class);
- TextView textView = new TextView(application);
+ TextView textView = new TextView(RuntimeEnvironment.application);
doReturn(textView).when(remoteViews).apply(any(Context.class), any(ViewGroup.class));
packages.get(0).remoteViews = remoteViews;
mDashboardAdapter.setCategoriesAndSuggestions(Collections.emptyList(), packages);
mSuggestionHolder = mDashboardAdapter.onCreateViewHolder(
- new FrameLayout(application),
+ new FrameLayout(RuntimeEnvironment.application),
R.layout.suggestion_tile_card);
- mDashboardAdapter.onBindViewHolder(mSuggestionHolder, 1);
+ mDashboardAdapter.onBindViewHolder(mSuggestionHolder, 2);
assertThat(textView.getParent()).isSameAs(mSuggestionHolder.itemView);
mSuggestionHolder.itemView.performClick();
@@ -347,7 +398,8 @@
@Test
public void testBindViewHolder_primaryViewHandlesClick() {
- Context context = new ContextThemeWrapper(application, R.style.Theme_Settings);
+ Context context =
+ new ContextThemeWrapper(RuntimeEnvironment.application, R.style.Theme_Settings);
List<Tile> packages = makeSuggestions("pkg1");
RemoteViews remoteViews = mock(RemoteViews.class);
@@ -362,7 +414,7 @@
new FrameLayout(context),
R.layout.suggestion_tile_card);
- mDashboardAdapter.onBindViewHolder(mSuggestionHolder, 1);
+ mDashboardAdapter.onBindViewHolder(mSuggestionHolder, 2);
mSuggestionHolder.itemView.performClick();
assertThat(ShadowApplication.getInstance().getNextStartedActivity()).isNull();
@@ -375,7 +427,8 @@
@Test
public void testBindViewHolder_viewsClearedOnRebind() {
- Context context = new ContextThemeWrapper(application, R.style.Theme_Settings);
+ Context context =
+ new ContextThemeWrapper(RuntimeEnvironment.application, R.style.Theme_Settings);
List<Tile> packages = makeSuggestions("pkg1");
RemoteViews remoteViews = mock(RemoteViews.class);
@@ -390,8 +443,8 @@
new FrameLayout(context),
R.layout.suggestion_tile_card);
- mDashboardAdapter.onBindViewHolder(mSuggestionHolder, 1);
- mDashboardAdapter.onBindViewHolder(mSuggestionHolder, 1);
+ mDashboardAdapter.onBindViewHolder(mSuggestionHolder, 2);
+ mDashboardAdapter.onBindViewHolder(mSuggestionHolder, 2);
ViewGroup itemView = (ViewGroup) mSuggestionHolder.itemView;
assertThat(itemView.getChildCount()).isEqualTo(1);
@@ -408,11 +461,31 @@
return suggestions;
}
- private void setUpSuggestions(List<Tile> suggestions) {
+ private void setupSuggestions(List<Tile> suggestions) {
mDashboardAdapter.setCategoriesAndSuggestions(new ArrayList<>(), suggestions);
mSuggestionHolder = mDashboardAdapter.onCreateViewHolder(
- new FrameLayout(application),
- mDashboardAdapter.getItemViewType(0));
+ new FrameLayout(RuntimeEnvironment.application),
+ mDashboardAdapter.getItemViewType(1));
}
+ private void makeCondition() {
+ final List<Condition> conditions = new ArrayList<>();
+ Condition condition = mock(Condition.class);
+ when(condition.shouldShow()).thenReturn(true);
+ conditions.add(condition);
+ mDashboardAdapter.setConditions(conditions);
+ }
+
+ private void makeCategory() {
+ List<DashboardCategory> categories = new ArrayList<>();
+ categories.add(new DashboardCategory());
+ mDashboardAdapter.setCategory(categories);
+ }
+
+ private DashboardAdapter.DashboardItemHolder setupSpacer() {
+ Context context = RuntimeEnvironment.application;
+ final View view = LayoutInflater.from(context)
+ .inflate(R.layout.dashboard_header_spacer, new LinearLayout(context), false);
+ return new DashboardAdapter.DashboardItemHolder(view);
+ }
}
diff --git a/tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java b/tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java
index abea565..8bbb15b 100644
--- a/tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java
+++ b/tests/robotests/src/com/android/settings/dashboard/DashboardDataTest.java
@@ -112,7 +112,7 @@
public void testBuildItemsData_containsAllData() {
final DashboardData.SuggestionHeaderData data =
new DashboardData.SuggestionHeaderData(false, 1, 0);
- final Object[] expectedObjects = {mTestCondition, null, data, mTestSuggestion,
+ final Object[] expectedObjects = {null, mTestCondition, null, data, mTestSuggestion,
mDashboardCategory, mTestCategoryTile};
final int expectedSize = expectedObjects.length;
@@ -171,7 +171,7 @@
@Test
public void testDiffUtil_DataEqual_noResultData() {
List<ListUpdateResult.ResultData> testResultData = new ArrayList<>();
- testDiffUtil(mDashboardDataWithOneConditions,
+ testDiffUtil(mDashboardDataWithOneConditions,
mDashboardDataWithOneConditions, testResultData);
}
@@ -180,7 +180,7 @@
//Build testResultData
final List<ListUpdateResult.ResultData> testResultData = new ArrayList<>();
testResultData.add(new ListUpdateResult.ResultData(
- ListUpdateResult.ResultData.TYPE_OPERATION_INSERT, 1, 1));
+ ListUpdateResult.ResultData.TYPE_OPERATION_INSERT, 2, 1));
testDiffUtil(mDashboardDataWithOneConditions,
mDashboardDataWithTwoConditions, testResultData);
@@ -191,7 +191,7 @@
//Build testResultData
final List<ListUpdateResult.ResultData> testResultData = new ArrayList<>();
testResultData.add(new ListUpdateResult.ResultData(
- ListUpdateResult.ResultData.TYPE_OPERATION_REMOVE, 0, 6));
+ ListUpdateResult.ResultData.TYPE_OPERATION_REMOVE, 1, 6));
testDiffUtil(mDashboardDataWithOneConditions, mDashboardDataWithNoItems, testResultData);
}
@@ -203,8 +203,8 @@
mDashboardDataWithOneConditions.getItemList(),
mDashboardDataWithOneConditions.getItemList());
- // Item in position 0 is condition card, which payload should not be null
- assertThat(callback.getChangePayload(0, 0)).isNotEqualTo(null);
+ // Item in position 1 is condition card, which payload should not be null
+ assertThat(callback.getChangePayload(1, 1)).isNotNull();
}
@Test
@@ -214,9 +214,9 @@
mDashboardDataWithOneConditions.getItemList(),
mDashboardDataWithOneConditions.getItemList());
- // Only item in position 0 is condition card, so others' payload should be null
- for (int i = 1; i < mDashboardDataWithOneConditions.getItemList().size(); i++) {
- assertThat(callback.getChangePayload(i, i)).isEqualTo(null);
+ // Position 0 is spacer, 1 is condition card, so others' payload should be null
+ for (int i = 2; i < mDashboardDataWithOneConditions.getItemList().size(); i++) {
+ assertThat(callback.getChangePayload(i, i)).isNull();
}
}
@@ -356,6 +356,11 @@
return arg2 - resultData.arg2;
}
+
+ @Override
+ public String toString() {
+ return "op:" + operation + ",arg1:" + arg1 + ",arg2:" + arg2;
+ }
}
}
}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java b/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
index 45836ad..eaa0bca 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/BatteryUtilsTest.java
@@ -305,6 +305,16 @@
mScreenBatterySipper);
}
+ @Test
+ public void testCalculateLastFullChargeTime() {
+ final long currentTimeMs = System.currentTimeMillis();
+ when(mBatteryStatsHelper.getStats().getStartClockTime()).thenReturn(
+ currentTimeMs - TIME_SINCE_LAST_FULL_CHARGE_MS);
+
+ assertThat(mBatteryUtils.calculateLastFullChargeTime(
+ mBatteryStatsHelper, currentTimeMs)).isEqualTo(TIME_SINCE_LAST_FULL_CHARGE_MS);
+ }
+
private BatterySipper createTestSmearBatterySipper(long activityTime, double totalPowerMah,
int uidCode, boolean isUidNull) {
final BatterySipper sipper = mock(BatterySipper.class);
diff --git a/tests/robotests/src/com/android/settings/support/SupportDashboardActivityTest.java b/tests/robotests/src/com/android/settings/support/SupportDashboardActivityTest.java
new file mode 100644
index 0000000..d90d8d6
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/support/SupportDashboardActivityTest.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.support;
+
+
+import android.content.Context;
+import android.content.Intent;
+
+import com.android.settings.R;
+import com.android.settings.SettingsRobolectricTestRunner;
+import com.android.settings.TestConfig;
+import com.android.settings.search.SearchIndexableRaw;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.annotation.Config;
+
+import java.util.List;
+
+import static com.google.common.truth.Truth.assertThat;
+
+@RunWith(SettingsRobolectricTestRunner.class)
+@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
+public class SupportDashboardActivityTest {
+
+ private Context mContext;
+
+ @Before
+ public void setUp() {
+ mContext = RuntimeEnvironment.application;
+ }
+
+ @Test
+ public void shouldIndexSearchActivityForSearch() {
+ final List<SearchIndexableRaw> indexables =
+ SupportDashboardActivity.SEARCH_INDEX_DATA_PROVIDER
+ .getRawDataToIndex(mContext, true /* enabled */);
+
+ assertThat(indexables).hasSize(1);
+
+ final SearchIndexableRaw value = indexables.get(0);
+
+ assertThat(value.title).isEqualTo(mContext.getString(R.string.page_tab_title_support));
+ assertThat(value.screenTitle).isEqualTo(mContext.getString(R.string.settings_label));
+ assertThat(value.intentTargetPackage).isEqualTo(mContext.getPackageName());
+ assertThat(value.intentTargetClass).isEqualTo(SupportDashboardActivity.class.getName());
+ assertThat(value.intentAction).isEqualTo(Intent.ACTION_MAIN);
+ }
+}
diff --git a/tests/app/src/com/android/settings/dashboard/FirstIdViewMatcher.java b/tests/unit/src/com/android/settings/dashboard/FirstIdViewMatcher.java
similarity index 100%
rename from tests/app/src/com/android/settings/dashboard/FirstIdViewMatcher.java
rename to tests/unit/src/com/android/settings/dashboard/FirstIdViewMatcher.java
diff --git a/tests/app/src/com/android/settings/dashboard/PreferenceThemeTest.java b/tests/unit/src/com/android/settings/dashboard/PreferenceThemeTest.java
similarity index 95%
rename from tests/app/src/com/android/settings/dashboard/PreferenceThemeTest.java
rename to tests/unit/src/com/android/settings/dashboard/PreferenceThemeTest.java
index 22723a6..16e309d 100644
--- a/tests/app/src/com/android/settings/dashboard/PreferenceThemeTest.java
+++ b/tests/unit/src/com/android/settings/dashboard/PreferenceThemeTest.java
@@ -58,8 +58,7 @@
@Test
public void startPhoneStatus_preferenceIconSpaceReserved() throws InterruptedException {
launchPhoneStatus();
- onView(withId(R.id.icon_frame)).check(doesNotExist());
- onView(withFirstId(R.id.icon_container)).check(matches(isDisplayed()));
+ onView(withFirstId(R.id.icon_frame)).check(matches(isDisplayed()));
}
@Test