Replaced instances of toUpperCase() with uppercase() as the former is now deprecated and will cause errors when updating to future Kotlin releases.
Bug: 237017037
Test: Ran `atest DeskClockTests` after implementing the above fix and received the following results:
Summary (Test executed with 1 devices.)
-------
arm64-v8a DeskClockTests: Passed: 68, Failed: 0, Ignored: 0, Assumption
Failed: 0,
Change-Id: I2cf9b950b6bdcbd38a07c2a1a5dc13dce5391c79
diff --git a/src/com/android/deskclock/data/City.kt b/src/com/android/deskclock/data/City.kt
index 4a8abf3..d6e6b04 100644
--- a/src/com/android/deskclock/data/City.kt
+++ b/src/com/android/deskclock/data/City.kt
@@ -54,7 +54,7 @@
val nameUpperCase: String
get() {
if (mNameUpperCase == null) {
- mNameUpperCase = name.toUpperCase()
+ mNameUpperCase = name.uppercase()
}
return mNameUpperCase!!
}
diff --git a/src/com/android/deskclock/data/SettingsDAO.kt b/src/com/android/deskclock/data/SettingsDAO.kt
index 43e77b5..c399a6c 100644
--- a/src/com/android/deskclock/data/SettingsDAO.kt
+++ b/src/com/android/deskclock/data/SettingsDAO.kt
@@ -342,9 +342,9 @@
private fun getClockStyle(context: Context, prefs: SharedPreferences, key: String): ClockStyle {
val defaultStyle: String = context.getString(R.string.default_clock_style)
val clockStyle: String = prefs.getString(key, defaultStyle)!!
- // Use hardcoded locale to perform toUpperCase, because in some languages toUpperCase adds
+ // Use hardcoded locale to perform uppercase(), because in some languages uppercase() adds
// accent to character, which breaks the enum conversion.
- return ClockStyle.valueOf(clockStyle.toUpperCase(Locale.US))
+ return ClockStyle.valueOf(clockStyle.uppercase(Locale.US))
}
/**
diff --git a/src/com/android/deskclock/worldclock/CitySelectionActivity.kt b/src/com/android/deskclock/worldclock/CitySelectionActivity.kt
index 998faa5..6ec6952 100644
--- a/src/com/android/deskclock/worldclock/CitySelectionActivity.kt
+++ b/src/com/android/deskclock/worldclock/CitySelectionActivity.kt
@@ -459,7 +459,7 @@
*/
fun filter(queryText: String) {
mSearchMenuItemController.queryText = queryText
- val query = City.removeSpecialCharacters(queryText.toUpperCase())
+ val query = City.removeSpecialCharacters(queryText.uppercase())
// Compute the filtered list of cities.
val filteredCities = if (TextUtils.isEmpty(query)) {