Loading packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -120,7 +120,7 @@ class ControlsUiControllerImpl @Inject constructor ( private val onSeedingComplete = Consumer<Boolean> { private val onSeedingComplete = Consumer<Boolean> { accepted -> accepted -> if (accepted) { if (accepted) { selectedStructure = controlsController.get().getFavorites().maxByOrNull { selectedStructure = controlsController.get().getFavorites().maxBy { it.controls.size it.controls.size } ?: EMPTY_STRUCTURE } ?: EMPTY_STRUCTURE updatePreferences(selectedStructure) updatePreferences(selectedStructure) Loading packages/SystemUI/src/com/android/systemui/privacy/PrivacyChipBuilder.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ class PrivacyChipBuilder(private val context: Context, itemsList: List<PrivacyIt appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType }) appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType }) .toList() .toList() .sortedWith(compareBy({ -it.second.size }, // Sort by number of AppOps .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() types = itemsList.map { it.privacyType }.distinct().sorted() } } Loading tools/codegen/src/com/android/codegen/Utils.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -43,8 +43,8 @@ inline infix fun Int.times(action: () -> Unit) { * cccc dd * cccc dd */ */ fun Iterable<Pair<String, String>>.columnize(separator: String = " | "): String { fun Iterable<Pair<String, String>>.columnize(separator: String = " | "): String { val col1w = map { (a, _) -> a.length }.maxOrNull()!! val col1w = map { (a, _) -> a.length }.max()!! val col2w = map { (_, b) -> b.length }.maxOrNull()!! val col2w = map { (_, b) -> b.length }.max()!! return map { it.first.padEnd(col1w) + separator + it.second.padEnd(col2w) }.joinToString("\n") return map { it.first.padEnd(col1w) + separator + it.second.padEnd(col2w) }.joinToString("\n") } } Loading Loading
packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -120,7 +120,7 @@ class ControlsUiControllerImpl @Inject constructor ( private val onSeedingComplete = Consumer<Boolean> { private val onSeedingComplete = Consumer<Boolean> { accepted -> accepted -> if (accepted) { if (accepted) { selectedStructure = controlsController.get().getFavorites().maxByOrNull { selectedStructure = controlsController.get().getFavorites().maxBy { it.controls.size it.controls.size } ?: EMPTY_STRUCTURE } ?: EMPTY_STRUCTURE updatePreferences(selectedStructure) updatePreferences(selectedStructure) Loading
packages/SystemUI/src/com/android/systemui/privacy/PrivacyChipBuilder.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -28,7 +28,7 @@ class PrivacyChipBuilder(private val context: Context, itemsList: List<PrivacyIt appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType }) appsAndTypes = itemsList.groupBy({ it.application }, { it.privacyType }) .toList() .toList() .sortedWith(compareBy({ -it.second.size }, // Sort by number of AppOps .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() types = itemsList.map { it.privacyType }.distinct().sorted() } } Loading
tools/codegen/src/com/android/codegen/Utils.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -43,8 +43,8 @@ inline infix fun Int.times(action: () -> Unit) { * cccc dd * cccc dd */ */ fun Iterable<Pair<String, String>>.columnize(separator: String = " | "): String { fun Iterable<Pair<String, String>>.columnize(separator: String = " | "): String { val col1w = map { (a, _) -> a.length }.maxOrNull()!! val col1w = map { (a, _) -> a.length }.max()!! val col2w = map { (_, b) -> b.length }.maxOrNull()!! val col2w = map { (_, b) -> b.length }.max()!! return map { it.first.padEnd(col1w) + separator + it.second.padEnd(col2w) }.joinToString("\n") return map { it.first.padEnd(col1w) + separator + it.second.padEnd(col2w) }.joinToString("\n") } } Loading