INNER CODE UNIT · Kotlin

setTimeFormat

spacecowboy/Feeder · app/src/androidTest/java/com/nononsenseapps/feeder/DateFormattingTest.kt:82

    private fun setTimeFormat(value: String?) {
        val command =
            if (value == null) {
                "settings delete system ${Settings.System.TIME_12_24}"
            } else {
                "settings put system ${Settings.System.TIME_12_24} $value"
            }
        val output = InstrumentationRegistry.getInstrumentation().uiAutomation.executeShellCommand(command)
        ParcelFileDescriptor.AutoCloseInputStream(output).use { it.readBytes() }
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…