mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-10 16:02:25 +01:00
dev builds send no usage notes
This commit is contained in:
1 parent
355eb8bffd
commit
fe44576b06
2 files changed
+4
-5
No files matched your search
@@ -51,18 +51,17 @@ object UsageStats {
|
||||
private fun prefs(context: Context) = context.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
|
||||
|
||||
/**
|
||||
* Dev builds are the developer's own, so they always send everything and never ask: no switch
|
||||
* in Settings, no page in setup. Only release builds offer the choice.
|
||||
* Dev builds never send anything and never ask: no switch in Settings, no page in setup, so
|
||||
* testing doesn't muddy the numbers. Only release builds offer the choice.
|
||||
*/
|
||||
val choosable: Boolean get() = !BuildConfig.DEBUG
|
||||
|
||||
fun enabled(context: Context): Boolean = !choosable || prefs(context).getBoolean(KEY_ENABLED, false)
|
||||
fun enabled(context: Context): Boolean = choosable && prefs(context).getBoolean(KEY_ENABLED, false)
|
||||
|
||||
/** Whether the driver has answered the question in setup, either way. */
|
||||
fun asked(context: Context): Boolean = !choosable || prefs(context).getBoolean(KEY_ASKED, false)
|
||||
|
||||
fun choices(context: Context): Choices {
|
||||
if (!choosable) return Choices()
|
||||
val p = prefs(context)
|
||||
return Choices(
|
||||
android = p.getBoolean("share_android", true),
|
||||
|
||||
@@ -287,7 +287,7 @@ private fun pages(context: Context, onRequestCallScreening: () -> Unit): List<Gu
|
||||
|
||||
// --- The very end, every time: usage notes. The first time through, leaving the page
|
||||
// without turning them on is a no; on a replay, the switch shows what was chosen before.
|
||||
// Dev builds always send, so they skip the page.
|
||||
// Dev builds never send, so they skip the page.
|
||||
if (UsageStats.choosable) {
|
||||
add(
|
||||
GuidePage(
|
||||
|
||||
Reference in new issue
Block a user