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

Commit b0194712 authored by Bo Majewski's avatar Bo Majewski
Browse files

[DocsUI, Search]: Fix failing DocumentsUIUnitTests

The test reports that "No virtual method toSeconds()" exists on the
Duration class or its superclasses. It was implemented in JDK Level 9,
but I guess it did not make it into Android code(??). This cl uses the
default toString() implementation of Duration to avoid any problems. It
is a bit less readable, but more reliable.

Bug: 421965206
Test: m DocumentsUIGoogle
Flag: com.android.documentsui.flags.use_search_v2_read_only
Change-Id: Ie43b016a452591f7afe67d297dd1bbfcdfce78dd
parent 618f7c68
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -56,8 +56,7 @@ data class LoaderTestParams(
    override fun toString(): String {
        var base = "query '$query'"
        if (lastModifiedDelta != null) {
            val durationInMs = lastModifiedDelta.toSeconds()
            base = "$base, modified in the last ${durationInMs}s"
            base = "$base, modified in the last $lastModifiedDelta"
        }
        if (!otherArgs.isEmpty) {
            base = "$base, and $otherArgs"