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

Commit 70f27448 authored by William Leshner's avatar William Leshner Committed by Android (Google) Code Review
Browse files

Merge "Fix an NPE in DisplayScreenTest." into main

parents 9f169fd6 132505ce
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ class ScreensaverScreen(fooContext: Context) :
        override fun dreamOn(context: Context, activeDreamName: CharSequence) =
            context.resources.getString(
                R.string.screensaver_settings_summary_on,
                dreamBackend.activeDreamName
                activeDreamName
            )

        override fun dreamOffBedtime(context: Context) =
@@ -103,7 +103,10 @@ class ScreensaverScreen(fooContext: Context) :

    private fun getSummaryTextWithDreamName(context: Context): CharSequence {
        return if (dreamBackend.isEnabled) {
            summaryStringsProvider.dreamOn(context, dreamBackend.activeDreamName)
            // In practice, activeDreamName would not be null, but it can be in tests and in that
            // case it needs to have the same behavior as the corresponding method in
            // DreamSettings (see b/411793272).
            summaryStringsProvider.dreamOn(context, dreamBackend.activeDreamName ?: "null")
        } else {
            summaryStringsProvider.dreamOff(context)
        }