Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b768c71 authored by Liana Kazanova (xWF)'s avatar Liana Kazanova (xWF) Committed by Android (Google) Code Review
Browse files

Merge "Revert "Fix exception when getting grid title"" into main

parents 54344789 6c6a2d61
Loading
Loading
Loading
Loading
+28 −41
Original line number Diff line number Diff line
@@ -53,21 +53,15 @@ constructor(
                    ?.use { cursor ->
                        buildList {
                                while (cursor.moveToNext()) {
                                    try {
                                    val rows = cursor.getInt(cursor.getColumnIndex(COL_ROWS))
                                    val cols = cursor.getInt(cursor.getColumnIndex(COL_COLS))
                                        val titleIndex = cursor.getColumnIndex(COL_GRID_TITLE)
                                    val title =
                                            if (titleIndex != -1) {
                                                cursor.getString(titleIndex)
                                            } else {
                                                context.getString(
                                                    com.android.themepicker.R.string
                                                        .grid_title_pattern,
                                        cursor.getString(cursor.getColumnIndex(COL_GRID_TITLE))
                                            ?: context.getString(
                                                com.android.themepicker.R.string.grid_title_pattern,
                                                cols,
                                                rows,
                                            )
                                            }
                                    add(
                                        GridOptionModel(
                                            key =
@@ -89,13 +83,6 @@ constructor(
                                                ),
                                        )
                                    )
                                    } catch (e: IllegalStateException) {
                                        Log.e(
                                            TAG,
                                            "Fail to read from the cursor to build GridOptionModel",
                                            e,
                                        )
                                    }
                                }
                            }
                            .let { list ->