test(android): remove invalid cold locale probe

This commit is contained in:
Vincent Koc
2026-07-12 12:57:24 +02:00
parent 01b33ea6be
commit e659acd9b2

View File

@@ -1,7 +1,5 @@
package ai.openclaw.app
import ai.openclaw.app.i18n.NativeStringResources
import ai.openclaw.app.i18n.nativeString
import android.app.Notification
import android.app.Service
import android.content.Context
@@ -175,32 +173,6 @@ class NodeForegroundServiceTest {
}
}
@Test
@Config(sdk = [31, 32])
fun coldServiceStartupUsesThePersistedAppLocaleWithoutAnActivity() {
val app = RuntimeEnvironment.getApplication()
val localesFile = "androidx.appcompat.app.AppCompatDelegate.application_locales_record_file"
app.openFileOutput(localesFile, Context.MODE_PRIVATE).bufferedWriter().use { writer ->
writer.write("""<?xml version='1.0' encoding='UTF-8' standalone='yes' ?><locales application_locales="fr" />""")
}
NativeStringResources.install(app)
assertEquals("Démarrage…", nativeString("Starting…"))
val controller = Robolectric.buildService(NodeForegroundService::class.java)
try {
controller.create()
assertSame(app, controller.get().application)
assertTrue(app.getFileStreamPath(localesFile).exists())
assertEquals("Démarrage…", nativeString("Starting…"))
val notification = Shadows.shadowOf(controller.get()).lastForegroundNotification
assertEquals("Démarrage…", notification.extras.getCharSequence(Notification.EXTRA_TEXT))
} finally {
controller.destroy()
app.deleteFile(localesFile)
}
}
@Test
fun backgroundRuntimeStartsWithoutForegroundCapabilitiesOrMicRestore() {
val app = RuntimeEnvironment.getApplication()