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)
|
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
|
* Dev builds never send anything and never ask: no switch in Settings, no page in setup, so
|
||||||
* in Settings, no page in setup. Only release builds offer the choice.
|
* testing doesn't muddy the numbers. Only release builds offer the choice.
|
||||||
*/
|
*/
|
||||||
val choosable: Boolean get() = !BuildConfig.DEBUG
|
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. */
|
/** Whether the driver has answered the question in setup, either way. */
|
||||||
fun asked(context: Context): Boolean = !choosable || prefs(context).getBoolean(KEY_ASKED, false)
|
fun asked(context: Context): Boolean = !choosable || prefs(context).getBoolean(KEY_ASKED, false)
|
||||||
|
|
||||||
fun choices(context: Context): Choices {
|
fun choices(context: Context): Choices {
|
||||||
if (!choosable) return Choices()
|
|
||||||
val p = prefs(context)
|
val p = prefs(context)
|
||||||
return Choices(
|
return Choices(
|
||||||
android = p.getBoolean("share_android", true),
|
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
|
// --- 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.
|
// 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) {
|
if (UsageStats.choosable) {
|
||||||
add(
|
add(
|
||||||
GuidePage(
|
GuidePage(
|
||||||
|
|||||||
Reference in new issue
Block a user