Browse Source

Data collection hotfix

pull/61/merge
Ezerous 6 years ago
parent
commit
910d8a9ff8
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 8
      app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java

8
app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java

@ -750,10 +750,12 @@ public abstract class BaseActivity extends AppCompatActivity {
FirebaseMessaging.getInstance().setAutoInitEnabled(true);
BaseApplication.getInstance().startFirebaseCrashlyticsCollection();
BaseApplication.getInstance().setFirebaseAnalyticsCollection(true);
setUserDataShareEnabled(true);
});
builder.setNegativeButton("Nope, leave me alone", (dialogInterface, i) -> {
addUserConsent();
FirebaseMessaging.getInstance().setAutoInitEnabled(true);
setUserDataShareEnabled(false);
});
builder.setNeutralButton("Privacy Policy", (dialog, which) -> {/*Will be overridden below*/});
builder.setCancelable(false);
@ -804,6 +806,12 @@ public abstract class BaseActivity extends AppCompatActivity {
editor.putBoolean(getString(R.string.user_consent_shared_preference_key), true).apply();
}
private void setUserDataShareEnabled(boolean enabled){
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean(getString(R.string.pref_privacy_crashlytics_enable_key), enabled).apply();
editor.putBoolean(getString(R.string.pref_privacy_analytics_enable_key), enabled).apply();
}
//----------------------------------MISC----------------------
protected void setMainActivity(MainActivity mainActivity) {
this.mainActivity = mainActivity;

Loading…
Cancel
Save