Skip to content
Snippets Groups Projects
Commit 520a9b59 authored by Geoffrey Métais's avatar Geoffrey Métais Committed by Geoffrey Métais
Browse files

Set buildConfig.BETA field

parent 6df32543
No related branches found
No related tags found
1 merge request!204Crash sender
......@@ -52,7 +52,6 @@ android {
resValue "string", "build_time", buildTime()
resValue "string", "build_host", hostName()
resValue "string", "build_revision", revision()
resValue "bool", "is_beta", isBeta()
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
// The following argument makes the Android Test Orchestrator run its
......@@ -125,6 +124,7 @@ android {
shrinkResources false
proguardFile 'proguard.cfg'
kotlinOptions.freeCompilerArgs = ['-Xno-param-assertions']
buildConfigField "boolean", "BETA", isBeta()
}
signedRelease {
initWith release
......@@ -135,6 +135,7 @@ android {
applicationIdSuffix ".debug"
jniDebuggable true
multiDexEnabled true
buildConfigField "boolean", "BETA", "false"
}
dev {
initWith debug
......
......@@ -79,16 +79,14 @@ class StartActivity : FragmentActivity() {
if (AndroidUtil.isNougatOrLater) UiTools.setLocale(this)
try {
if (!Settings.showTvUi && AppUtils.isBeta(this) && !Settings.getInstance(this).getBoolean(BETA_WELCOME, false)) {
if (!Settings.showTvUi && BuildConfig.BETA && !Settings.getInstance(this).getBoolean(BETA_WELCOME, false)) {
val intent = Intent(this, BetaWelcomeActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
startActivityForResult(intent, SEND_CRASH_RESULT)
Settings.getInstance(this).edit().putBoolean(BETA_WELCOME, true).apply()
return
}
} catch (e: Exception) {
}
} catch (ignored: Exception) {}
resume()
}
......
......@@ -113,7 +113,7 @@ class VLCApplication : MultiDexApplication() {
Dialog.setCallbacks(VLCInstance[instance], dialogCallbacks)
})
packageManager.setComponentEnabledSetting(ComponentName(this, SendCrashActivity::class.java),
if (resources.getBoolean(R.bool.is_beta)) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP)
if (BuildConfig.BETA) PackageManager.COMPONENT_ENABLED_STATE_ENABLED else PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP)
}).start()
}
......
......@@ -4,13 +4,11 @@ import android.content.Context
import android.os.Build
import android.os.Environment
import android.os.StatFs
import org.videolan.vlc.R
import org.videolan.vlc.VLCApplication
object AppUtils {
fun getVersionName(context: Context): String {
return context.packageManager.getPackageInfo(VLCApplication.appContext.packageName, 0).versionName
return context.packageManager.getPackageInfo(context.packageName, 0).versionName
}
fun getVersionCode(context: Context): Long {
......@@ -19,10 +17,6 @@ object AppUtils {
else context.packageManager.getPackageInfo(context.packageName, 0).versionCode.toLong()
}
fun isBeta(context: Context): Boolean {
return context.resources.getBoolean(R.bool.is_beta)
}
fun totalMemory(): Long {
val statFs = StatFs(Environment.getRootDirectory().absolutePath)
return (statFs.blockCount * statFs.blockSize).toLong()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment