mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 11:38:51 +01:00
Remove all mentions of analytics
The analytics build configuration has not been used or updated for a while. This removes some dependencies, and some deprecated code sections.
This commit is contained in:
@@ -20,11 +20,10 @@ package dev.octoshrimpy.quik.experiment
|
||||
|
||||
import android.content.Context
|
||||
import android.preference.PreferenceManager
|
||||
import dev.octoshrimpy.quik.manager.AnalyticsManager
|
||||
import java.util.Locale
|
||||
import java.util.Random
|
||||
|
||||
abstract class Experiment<T>(val context: Context, val analytics: AnalyticsManager) {
|
||||
abstract class Experiment<T>(val context: Context) {
|
||||
|
||||
private val prefs by lazy { PreferenceManager.getDefaultSharedPreferences(context) }
|
||||
private val prefKey: String
|
||||
@@ -49,7 +48,6 @@ abstract class Experiment<T>(val context: Context, val analytics: AnalyticsManag
|
||||
|
||||
else -> { // Variant hasn't been set yet
|
||||
variants[Random().nextInt(variants.size)].also { variant ->
|
||||
analytics.setUserProperty("Experiment: $key", variant.key)
|
||||
prefs.edit().putString(prefKey, variant.key).apply()
|
||||
}.value
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2017 Moez Bhatti <moez.bhatti@gmail.com>
|
||||
*
|
||||
* This file is part of QKSMS.
|
||||
*
|
||||
* QKSMS is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QKSMS is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QKSMS. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package dev.octoshrimpy.quik.manager
|
||||
|
||||
interface AnalyticsManager {
|
||||
|
||||
fun track(event: String, vararg properties: Pair<String, Any>)
|
||||
|
||||
fun setUserProperty(key: String, value: Any)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user