privacy: app access default transition

This commit is contained in:
Thibault Deckers 2021-11-04 10:48:09 +09:00
parent f370abf811
commit 7c18334934
4 changed files with 11 additions and 3 deletions

View file

@ -14,8 +14,7 @@ class SettingsDefaults {
// app
static const hasAcceptedTerms = false;
static const canUseAnalysisService = true;
// TODO TLAD currently opt-out for transition (v1.5.4 -> vNext), should make it opt-in for vNext+1
static const isInstalledAppAccessAllowed = true;
static const isInstalledAppAccessAllowed = false;
static const isErrorReportingAllowed = false;
static const mustBackTwiceToExit = true;
static const keepScreenOn = KeepScreenOn.viewerOnly;

View file

@ -175,7 +175,8 @@ class Settings extends ChangeNotifier {
set canUseAnalysisService(bool newValue) => setAndNotify(canUseAnalysisServiceKey, newValue);
bool get isInstalledAppAccessAllowed => getBoolOrDefault(isInstalledAppAccessAllowedKey, SettingsDefaults.isInstalledAppAccessAllowed);
// TODO TLAD use `true` for transition (it's unset in v1.5.4), but replace by `SettingsDefaults.isInstalledAppAccessAllowed` in a later release
bool get isInstalledAppAccessAllowed => getBoolOrDefault(isInstalledAppAccessAllowedKey, true);
set isInstalledAppAccessAllowed(bool newValue) => setAndNotify(isInstalledAppAccessAllowedKey, newValue);

View file

@ -69,6 +69,9 @@ class _HomePageState extends State<HomePage> {
await androidFileUtils.init();
if (settings.isInstalledAppAccessAllowed) {
// TODO TLAD transition code (it's unset in v1.5.4), remove in a later release
settings.isInstalledAppAccessAllowed = settings.isInstalledAppAccessAllowed;
unawaited(androidFileUtils.initAppNames());
}

View file

@ -1,4 +1,5 @@
import 'package:aves/app_flavor.dart';
import 'package:aves/model/settings/defaults.dart';
import 'package:aves/model/settings/settings.dart';
import 'package:aves/theme/durations.dart';
import 'package:aves/widgets/common/basic/markdown_container.dart';
@ -30,6 +31,10 @@ class _WelcomePageState extends State<WelcomePage> {
super.initState();
settings.setContextualDefaults();
_termsLoader = rootBundle.loadString('assets/terms.md');
// explicitly set consent values to current defaults
// so they are not subject to future default changes
settings.isInstalledAppAccessAllowed = SettingsDefaults.isInstalledAppAccessAllowed;
settings.isErrorReportingAllowed = SettingsDefaults.isErrorReportingAllowed;
}
@override