2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

Bug 1832003 - Start with default false of telemetry when user disagrees with privacy notice

This commit is contained in:
rxu 2023-03-30 12:26:32 +08:00 committed by mergify[bot]
parent c5402c1cf4
commit bf9e782741
4 changed files with 13 additions and 6 deletions

View File

@ -19,7 +19,6 @@ import org.mozilla.fenix.components.metrics.MetricServiceType
import org.mozilla.fenix.ext.application
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings
import kotlin.system.exitProcess
fun showPrivacyPopWindow(context: Context, activity: Activity) {
val content = context.getString(R.string.privacy_notice_content)
@ -68,8 +67,16 @@ fun showPrivacyPopWindow(context: Context, activity: Activity) {
}
.setNeutralButton(
context.getString(R.string.privacy_notice_neutral_button_2),
{ _, _ -> exitProcess(0) },
)
) { _, _ ->
context.settings().shouldShowPrivacyPopWindow = false
context.settings().isMarketingTelemetryEnabled = false
context.settings().isTelemetryEnabled = false
context.components.analytics.metrics.start(MetricServiceType.Marketing)
// Now that the privacy notice is accepted, application initialization can continue.
context.application.initialize()
activity.startActivity(Intent(activity, HomeActivity::class.java))
activity.finish()
}
.setTitle(context.getString(R.string.privacy_notice_title))
.setMessage(messageSpannable)
.setCancelable(false)

View File

@ -304,7 +304,7 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = false,
)
val isTelemetryEnabled by booleanPreference(
var isTelemetryEnabled by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_telemetry),
default = true,
)

View File

@ -19,7 +19,7 @@
<string name="privacy_notice_positive_button">同意并继续</string>
<!-- Privacy Notice neutral button-->
<string name="privacy_notice_neutral_button" moz:removedIn="96" tools:ignore="UnusedResources">退出应用</string>
<string name="privacy_notice_neutral_button_2">不同意并退出</string>
<string name="privacy_notice_neutral_button_2">不同意</string>
<!-- Topsites-->
<!-- Default title for pinned Baidu top site that links to Baidu home page -->

View File

@ -18,7 +18,7 @@
<!-- Privacy Notice positive button-->
<string name="privacy_notice_positive_button">Agree and Continue</string>
<!-- Privacy Notice neutral button-->
<string name="privacy_notice_neutral_button_2">Disagree and Exit</string>
<string name="privacy_notice_neutral_button_2">Disagree</string>
<!-- Topsites-->
<!-- Default title for pinned Baidu top site that links to Baidu home page -->