add a bool resource matching BuildConfig.DEBUG

I want to be able to have some boolean prefs default based on whether
it's a DEBUG build.
This commit is contained in:
Eric House 2019-03-20 14:29:37 -07:00
parent 52f839e899
commit b5714fadf8
2 changed files with 5 additions and 0 deletions

View file

@ -180,9 +180,11 @@ android {
minifyEnabled false // PENDING
// proguard crashes when I do this (the optimize part)
// proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
resValue "bool", "DEBUG", "false"
}
debug {
debuggable true
resValue "bool", "DEBUG", "true"
minifyEnabled true // for testing
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// This doesn't work on marshmallow: duplicate permission error

View file

@ -72,6 +72,9 @@ public class XWApp extends Application
Assert.assertTrue( s_context == s_context.getApplicationContext() );
super.onCreate();
// Remove me soon!!!
Assert.assertTrue( BuildConfig.DEBUG == getResources().getBoolean(R.bool.DEBUG) );
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
android.util.Log.i( TAG, "onCreate(); git_rev="