package com.gh.gamecenter.va

import android.app.Application
import android.content.Context
import android.content.res.Configuration
import android.os.Build
import com.gh.gamecenter.core.iinterface.IApplication
import com.google.auto.service.AutoService
import com.lg.vspace.App64

@AutoService(IApplication::class)
class HaloApp : IApplication {

    private val app = App64()
    private val isDeviceSupportVa = Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1

    override fun attachBaseContext(base: Context) {
        if (isDeviceSupportVa) {
            app.attachBaseContext(base)
        }
    }

    override fun onCreate(application: Application) {
        if (isDeviceSupportVa) {
            app.onCreate(application)
        }
    }

    override fun onLowMemory() {
        if (isDeviceSupportVa) {
            app.onLowMemory()
        }
    }

    override fun onTerminate() {
        if (isDeviceSupportVa) {
            app.onTerminate()
        }
    }

    override fun onTrimMemory(level: Int) {
        if (isDeviceSupportVa) {
            app.onTrimMemory(level)
        }
    }

    override fun onConfigurationChanged(newConfig: Configuration) {
        if (isDeviceSupportVa) {
            app.onConfigurationChanged(newConfig)
        }
    }
}