Fix issue when preference screen title won't change depending on the device..
previously it defaults to just "Search your phone"
Now it correctly displays Phone/Tablet
Before: https://screenshot.googleplex.com/3PJrsP9mGvwMr98
After: https://screenshot.googleplex.com/B2nnUQHeHmEXXPd
Bug: 231611501
Change-Id: I49eab7e827ce4bb31a2722fbf21c244f98145907
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 829a21d..847e4a8 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -438,6 +438,10 @@
<!-- A hint shown in launcher settings develop options filter box -->
<string name="developer_options_filter_hint">Filter</string>
+ <!-- Title for preference screen show in Home Settings related to smart search preferences. [CHAR LIMIT=50]-->
+ <string name="search_pref_screen_title">Search your phone</string>
+ <!-- Title for preference screen show in Home Settings related to smart search preferences. [CHAR LIMIT=50]-->
+ <string name="search_pref_screen_title_tablet">Search your tablet</string>
<!-- Failed action error message: e.g. Failed: Pause -->
<string name="remote_action_failed">Failed: <xliff:g id="what" example="Pause">%1$s</xliff:g></string>
</resources>
diff --git a/src/com/android/launcher3/settings/SettingsActivity.java b/src/com/android/launcher3/settings/SettingsActivity.java
index 0c39632..49d27b7 100644
--- a/src/com/android/launcher3/settings/SettingsActivity.java
+++ b/src/com/android/launcher3/settings/SettingsActivity.java
@@ -213,6 +213,14 @@
}
if (getActivity() != null && !TextUtils.isEmpty(getPreferenceScreen().getTitle())) {
+ if (getPreferenceScreen().getTitle().equals(
+ getResources().getString(R.string.search_pref_screen_title))){
+ DeviceProfile mDeviceProfile = InvariantDeviceProfile.INSTANCE.get(
+ getContext()).getDeviceProfile(getContext());
+ getPreferenceScreen().setTitle(mDeviceProfile.isTablet ?
+ R.string.search_pref_screen_title_tablet
+ : R.string.search_pref_screen_title);
+ }
getActivity().setTitle(getPreferenceScreen().getTitle());
}
}