package de.markusfisch.android.binaryeye.app

import android.app.Application
import android.support.v8.renderscript.RenderScript
import de.markusfisch.android.binaryeye.data.Database
import de.markusfisch.android.binaryeye.preference.Preferences

val db = Database()
val prefs = Preferences()

class BinaryEyeApp : Application() {
	override fun onCreate() {
		super.onCreate()
		prefs.init(this)

		if (prefs.forceCompat ||
			System.getProperty("os.version")?.contains(
				"lineageos", true
			) == true
		) {
			// required to make RenderScript work on Lineage 16.0
			RenderScript.forceCompat()
		}

		db.open(this)
	}
}

package de.markusfisch.android.binaryeye.app

import android.app.Application
import android.support.v8.renderscript.RenderScript
import de.markusfisch.android.binaryeye.data.Database
import de.markusfisch.android.binaryeye.preference.Preferences

val db = Database()
val prefs = Preferences()

class BinaryEyeApp : Application() {
	override fun onCreate() {
		super.onCreate()
		prefs.init(this)

		if (prefs.forceCompat) {
			RenderScript.forceCompat()
		}

		db.open(this)
	}
}

Remove special RenderScript handling for LineageOS
Remove special RenderScript handling for LineageOS

Always running `RenderScript.forceCompat()` interferes with the
`forceCompat` flag that is set/unset if there is a RSRuntimeException.

Now that the app is restarting automatically for a RSRuntimeException
this special handling is no longer required anyway.

markusfisch/BinaryEye,markusfisch/BinaryEye