XYOracleNetwork/sdk-xyo-client-android

View on GitHub
sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoOs.kt

Summary

Maintainability
A
0 mins
Test Coverage
package network.xyo.client.witness.system.info

import android.content.Context
import android.os.Build
import androidx.annotation.RequiresApi
import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
class XyoSystemInfoOs (
    val base_os: String?,
    val codename: String?,
    val incremental: String?,
    val preview_sdk_int: Int?,
    val release: String?,
    val sdk_int: Int?,
    val security_patch: String?
) {
    companion object {
        @RequiresApi(Build.VERSION_CODES.M)
        fun detect(context: Context): XyoSystemInfoOs {
            return XyoSystemInfoOs(
                Build.VERSION.BASE_OS,
                Build.VERSION.CODENAME,
                Build.VERSION.INCREMENTAL,
                Build.VERSION.PREVIEW_SDK_INT,
                Build.VERSION.RELEASE,
                Build.VERSION.SDK_INT,
                Build.VERSION.SECURITY_PATCH
            )
        }
    }
}