summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aurimas Liutikas <aurimas@google.com> 2021-05-12 23:09:41 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-05-12 23:09:41 +0000
commitb357fadd1ed9c7d073b358864953113214d537b8 (patch)
tree40e1fa65b45caa9bf17b58f4a71cec75d1404621
parentdd9dcdfb72b89002122ecbe03606b78d4012899f (diff)
parent51a1b7d0825095429054d639e7aecb882a930229 (diff)
Merge "Revert "Fix incompatibilities with Kotlin 1.5.0"" am: f1e2bb9a81 am: c2db9c85cc am: 51a1b7d082
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1705633 Change-Id: I20f9e94bb3241e07052edbe8c042162c2ad6f118
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/privacy/PrivacyChipBuilder.kt2
-rw-r--r--tools/codegen/src/com/android/codegen/Utils.kt4
3 files changed, 4 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt
index a904cefc48a0..26be98743eed 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt
@@ -120,7 +120,7 @@ class ControlsUiControllerImpl @Inject constructor (
private val onSeedingComplete = Consumer<Boolean> {
accepted ->
if (accepted) {
- selectedStructure = controlsController.get().getFavorites().maxByOrNull {
+ selectedStructure = controlsController.get().getFavorites().maxBy {
it.controls.size
} ?: EMPTY_STRUCTURE
updatePreferences(selectedStructure)
diff --git a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyChipBuilder.kt b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyChipBuilder.kt
index eec69f98b9be..1d2e74703b42 100644
--- a/packages/SystemUI/src/com/android/systemui/privacy/PrivacyChipBuilder.kt
+++ b/packages/SystemUI/src/com/android/systemui/privacy/PrivacyChipBuilder.kt
@@ -28,7 +28,7 @@ class PrivacyChipBuilder(private val context: Context, itemsList: List<PrivacyIt
appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType })
.toList()
.sortedWith(compareBy({ -it.second.size }, // Sort by number of AppOps
- { it.second.minOrNull() })) // Sort by "smallest" AppOpp (Location is largest)
+ { it.second.min() })) // Sort by "smallest" AppOpp (Location is largest)
types = itemsList.map { it.privacyType }.distinct().sorted()
}
diff --git a/tools/codegen/src/com/android/codegen/Utils.kt b/tools/codegen/src/com/android/codegen/Utils.kt
index 9ceb2042d74e..7cfa7847fcff 100644
--- a/tools/codegen/src/com/android/codegen/Utils.kt
+++ b/tools/codegen/src/com/android/codegen/Utils.kt
@@ -43,8 +43,8 @@ inline infix fun Int.times(action: () -> Unit) {
* cccc dd
*/
fun Iterable<Pair<String, String>>.columnize(separator: String = " | "): String {
- val col1w = map { (a, _) -> a.length }.maxOrNull()!!
- val col2w = map { (_, b) -> b.length }.maxOrNull()!!
+ val col1w = map { (a, _) -> a.length }.max()!!
+ val col2w = map { (_, b) -> b.length }.max()!!
return map { it.first.padEnd(col1w) + separator + it.second.padEnd(col2w) }.joinToString("\n")
}