-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry pick commit c6a11bd995889fd5b8ef910959dce1206542cf21,improve f…
…irstLaunchAsUpdate detection rule commit_hash:237cd2174f6d882201aaaa68225df4500a03e656
- Loading branch information
1 parent
93751ac
commit 818ff2b
Showing
17 changed files
with
135 additions
and
40 deletions.
There are no files selected for viewing
15 changes: 12 additions & 3 deletions
15
.../main/java/io/appmetrica/analytics/impl/AppMetricaConfigForAnonymousActivationProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
package io.appmetrica.analytics.impl | ||
|
||
import android.content.Context | ||
import io.appmetrica.analytics.AppMetricaConfig | ||
import io.appmetrica.analytics.impl.db.preferences.PreferencesClientDbStorage | ||
import io.appmetrica.analytics.logger.appmetrica.internal.DebugLogger | ||
|
||
internal class AppMetricaConfigForAnonymousActivationProvider( | ||
private val context: Context, | ||
private val preferences: PreferencesClientDbStorage | ||
) { | ||
|
||
private val tag = "[AppMetricaConfigForAnonymousActivationProvider]" | ||
|
||
private val defaultAnonymousConfigProvider = AppMetricaDefaultAnonymousConfigProvider() | ||
|
||
val config: AppMetricaConfig | ||
get() = preferences.appMetricaConfig ?: defaultAnonymousConfigProvider.getConfig(context) | ||
get() { | ||
val configFromPreferences = preferences.appMetricaConfig | ||
if (configFromPreferences != null) { | ||
DebugLogger.info(tag, "Choose saved config") | ||
return configFromPreferences | ||
} | ||
DebugLogger.info(tag, "Choose default anonymous config") | ||
return defaultAnonymousConfigProvider.getConfig() | ||
} | ||
} |
14 changes: 9 additions & 5 deletions
14
...cs/src/main/java/io/appmetrica/analytics/impl/AppMetricaDefaultAnonymousConfigProvider.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.