From b5714fadf847e84d5554b94c566dcc389cd1ddec Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 20 Mar 2019 14:29:37 -0700 Subject: [PATCH] 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. --- xwords4/android/app/build.gradle | 2 ++ .../app/src/main/java/org/eehouse/android/xw4/XWApp.java | 3 +++ 2 files changed, 5 insertions(+) diff --git a/xwords4/android/app/build.gradle b/xwords4/android/app/build.gradle index 5af93068e..889f965e6 100644 --- a/xwords4/android/app/build.gradle +++ b/xwords4/android/app/build.gradle @@ -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 diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWApp.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWApp.java index 28673f063..d37422bbd 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWApp.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWApp.java @@ -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="