Bug 1233614 - Remove MOZ_INSTALL_TRACKING branch around Adjust usage. r=mfinkle

We already take care of this in AdjustConstants where we return
StubAdjustHelper if MOZ_INSTALL_TRACKING is not defined.

However, the one downside to this is that we touch SharedPreferences on the
main thread in onCreate even if Adjust is disabled. However, our release and
beta users already have this problem (since Adjust is enabled) so who cares if
our Nightly and Aurora users also have this problem.

--HG--
extra : commitid : 23AwrEm4oaZ
extra : rebase_source : d1b1aa228878d18ef01091b0c5b693972237e3c8
This commit is contained in:
Michael Comella 2015-12-22 09:47:08 -08:00
Родитель 76182d7de7
Коммит 96ea9c62d8
2 изменённых файлов: 12 добавлений и 16 удалений

Просмотреть файл

@ -699,16 +699,14 @@ public class BrowserApp extends GeckoApp
mReadingListHelper = new ReadingListHelper(appContext, getProfile(), this);
mAccountsHelper = new AccountsHelper(appContext, getProfile());
if (AppConstants.MOZ_INSTALL_TRACKING) {
final AdjustHelperInterface adjustHelper = AdjustConstants.getAdjustHelper();
adjustHelper.onCreate(this, AdjustConstants.MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN);
final AdjustHelperInterface adjustHelper = AdjustConstants.getAdjustHelper();
adjustHelper.onCreate(this, AdjustConstants.MOZ_INSTALL_TRACKING_ADJUST_SDK_APP_TOKEN);
// Adjust stores enabled state so this is only necessary because users may have set
// their data preferences before this feature was implemented and we need to respect
// those before upload can occur in Adjust.onResume.
final SharedPreferences prefs = GeckoSharedPrefs.forApp(this);
adjustHelper.setEnabled(prefs.getBoolean(GeckoPreferences.PREFS_HEALTHREPORT_UPLOAD_ENABLED, true));
}
// Adjust stores enabled state so this is only necessary because users may have set
// their data preferences before this feature was implemented and we need to respect
// those before upload can occur in Adjust.onResume.
final SharedPreferences prefs = GeckoSharedPrefs.forApp(this);
adjustHelper.setEnabled(prefs.getBoolean(GeckoPreferences.PREFS_HEALTHREPORT_UPLOAD_ENABLED, true));
if (AppConstants.MOZ_ANDROID_BEAM) {
NfcAdapter nfc = NfcAdapter.getDefaultAdapter(this);

Просмотреть файл

@ -58,13 +58,11 @@ public class ReferrerReceiver extends BroadcastReceiver {
ReferrerDescriptor referrer = new ReferrerDescriptor(intent.getStringExtra("referrer"));
if (!TextUtils.equals(referrer.source, MOZILLA_UTM_SOURCE)) {
if (AppConstants.MOZ_INSTALL_TRACKING) {
// Allow the Adjust handler to process the intent.
try {
AdjustConstants.getAdjustHelper().onReceive(context, intent);
} catch (Exception e) {
Log.e(LOGTAG, "Got exception in Adjust's onReceive; ignoring referrer intent.", e);
}
// Allow the Adjust handler to process the intent.
try {
AdjustConstants.getAdjustHelper().onReceive(context, intent);
} catch (Exception e) {
Log.e(LOGTAG, "Got exception in Adjust's onReceive; ignoring referrer intent.", e);
}
return;
}