More consistent analytics consent dialog behavior

This commit is contained in:
Vincent Breitmoser 2018-07-19 10:36:31 +02:00
parent 2e7fca846e
commit e21a46fc07

View file

@ -51,7 +51,7 @@ public class AnalyticsConsentRequester {
activity.getPackageManager().getPackageInfo(BuildConfig.APPLICATION_ID, 0).firstInstallTime; activity.getPackageManager().getPackageInfo(BuildConfig.APPLICATION_ID, 0).firstInstallTime;
long threeDaysAgo = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(3); long threeDaysAgo = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(3);
boolean installedLessThanThreeDaysAgo = firstInstallTime > threeDaysAgo; boolean installedLessThanThreeDaysAgo = firstInstallTime > threeDaysAgo;
if (!Constants.DEBUG && installedLessThanThreeDaysAgo) { if (installedLessThanThreeDaysAgo) {
return; return;
} }
} catch (NameNotFoundException e) { } catch (NameNotFoundException e) {
@ -60,7 +60,7 @@ public class AnalyticsConsentRequester {
long twentyFourHoursAgo = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1); long twentyFourHoursAgo = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1);
boolean askedLessThan24HoursAgo = preferences.getAnalyticsLastAsked() > twentyFourHoursAgo; boolean askedLessThan24HoursAgo = preferences.getAnalyticsLastAsked() > twentyFourHoursAgo;
if (!Constants.DEBUG && askedLessThan24HoursAgo) { if (askedLessThan24HoursAgo) {
return; return;
} }
@ -85,7 +85,6 @@ public class AnalyticsConsentRequester {
}) })
.show(); .show();
alertDialog.<TextView>findViewById(android.R.id.message).setMovementMethod(LinkMovementMethod.getInstance()); alertDialog.<TextView>findViewById(android.R.id.message).setMovementMethod(LinkMovementMethod.getInstance());
alertDialog.setCanceledOnTouchOutside(false);
} }
private void startExperimentalSettingsActivity() { private void startExperimentalSettingsActivity() {