Bug 1432619 - Remove DawnHelper. r?nechen draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Tue, 23 Jan 2018 22:37:51 +0100
changeset 723821 13f1cf78360246abeafb578557c87b23a5fdd32d
parent 723820 8e5b7e016376cfc15ab809340d28bc140e1fc4be
child 746961 606c78949759ae7f134a7ff133434bdac0762386
push id96542
push usermozilla@buttercookie.de
push dateTue, 23 Jan 2018 21:40:21 +0000
reviewersnechen
bugs1432619
milestone60.0a1
Bug 1432619 - Remove DawnHelper. r?nechen It was only used in the 55 Nightly and never meant to stay around. MozReview-Commit-ID: JDJr9WC4V5M
mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
mobile/android/base/java/org/mozilla/gecko/dawn/DawnHelper.java
mobile/android/base/moz.build
mobile/android/base/strings.xml.in
--- a/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/BrowserApp.java
@@ -76,17 +76,16 @@ import org.mozilla.gecko.activitystream.
 import org.mozilla.gecko.activitystream.ActivityStreamTelemetry;
 import org.mozilla.gecko.adjust.AdjustBrowserAppDelegate;
 import org.mozilla.gecko.animation.PropertyAnimator;
 import org.mozilla.gecko.annotation.RobocopTarget;
 import org.mozilla.gecko.bookmarks.BookmarkEditFragment;
 import org.mozilla.gecko.bookmarks.BookmarkUtils;
 import org.mozilla.gecko.bookmarks.EditBookmarkTask;
 import org.mozilla.gecko.cleanup.FileCleanupController;
-import org.mozilla.gecko.dawn.DawnHelper;
 import org.mozilla.gecko.db.BrowserContract;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.db.SuggestedSites;
 import org.mozilla.gecko.delegates.BookmarkStateChangeDelegate;
 import org.mozilla.gecko.delegates.BrowserAppDelegate;
 import org.mozilla.gecko.delegates.OfflineTabStatusDelegate;
 import org.mozilla.gecko.delegates.ScreenshotDelegate;
 import org.mozilla.gecko.distribution.Distribution;
@@ -1133,18 +1132,16 @@ public class BrowserApp extends GeckoApp
 
     @Override
     public void onAttachedToWindow() {
         final SafeIntent intent = new SafeIntent(getIntent());
 
         if (!IntentUtils.getIsInAutomationFromEnvironment(intent)) {
             // We can't show the first run experience until Gecko has finished initialization (bug 1077583).
             checkFirstrun(this, intent);
-
-            DawnHelper.conditionallyNotifyDawn(this);
         }
     }
 
     @Override
     protected void processTabQueue() {
         if (TabQueueHelper.TAB_QUEUE_ENABLED && mInitialized) {
             ThreadUtils.postToBackgroundThread(new Runnable() {
                 @Override
deleted file mode 100644
--- a/mobile/android/base/java/org/mozilla/gecko/dawn/DawnHelper.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.dawn;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.support.annotation.NonNull;
-
-import org.mozilla.gecko.AppConstants;
-import org.mozilla.gecko.GeckoSharedPrefs;
-import org.mozilla.gecko.Locales;
-import org.mozilla.gecko.R;
-import org.mozilla.gecko.Tabs;
-
-import java.util.Locale;
-
-/**
- * This helper class is specific for the termination of aurora release train, a.k.a. Project Dawn.
- * ( https://hacks.mozilla.org/2017/04/simplifying-firefox-release-channels/ )
- * We want to keep current aurora user transit to use nightly codebase with aurora package name on
- * Google play. The purpose is similar to org.mozilla.gecko.notifications.WhatsNewReceiver and org.mozilla.gecko.BrowserApp#conditionallyNotifyEOL.
- * TODO: Make this more generic and able to on/off from Switchboard.
- */
-public class DawnHelper {
-
-    private static final String ANDROID_PACKAGE_NAME = AppConstants.ANDROID_PACKAGE_NAME;
-    private static final String ANDROID_PACKAGE_NAME_NIGHTLY_NEW = "org.mozilla.fennec_aurora";
-
-    private static final String KEY_PERF_BOOLEAN_NOTIFY_DAWN_ENABLED = "key-pref-boolean-notify-dawn-enabled";
-    private static final String TARGET_APP_VERSION = "55";
-
-
-    private static boolean isAuroraNightly() {
-        return ANDROID_PACKAGE_NAME.equals(ANDROID_PACKAGE_NAME_NIGHTLY_NEW);
-    }
-
-    private static boolean isTransitionRelease() {
-        return AppConstants.MOZ_APP_VERSION.startsWith(TARGET_APP_VERSION);
-    }
-
-    public static boolean conditionallyNotifyDawn(@NonNull Context context) {
-        if (!isAuroraNightly()) {
-            return false;
-        }
-
-        if (!isTransitionRelease()) {
-            return false;
-        }
-
-        final SharedPreferences prefs = GeckoSharedPrefs.forProfile(context);
-        if (!prefs.getBoolean(KEY_PERF_BOOLEAN_NOTIFY_DAWN_ENABLED, true)) {
-            return false;
-        } else {
-            prefs.edit().putBoolean(KEY_PERF_BOOLEAN_NOTIFY_DAWN_ENABLED, false).apply();
-        }
-
-        final String link = context.getString(R.string.aurora_transition_notification_url,
-                AppConstants.MOZ_APP_VERSION,
-                AppConstants.OS_TARGET,
-                Locales.getLanguageTag(Locale.getDefault()));
-
-        Tabs.getInstance().loadUrl(link, Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_USER_ENTERED);
-
-        return true;
-    }
-
-}
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -543,17 +543,16 @@ gbjar.sources += ['java/org/mozilla/geck
     'cleanup/FileCleanupService.java',
     'CustomEditText.java',
     'customtabs/ActionBarPresenter.java',
     'customtabs/CustomTabsActivity.java',
     'customtabs/CustomTabsSecurityPopup.java',
     'customtabs/GeckoCustomTabsService.java',
     'customtabs/IntentUtil.java',
     'DataReportingNotification.java',
-    'dawn/DawnHelper.java',
     'db/AbstractPerProfileDatabaseProvider.java',
     'db/AbstractTransactionalProvider.java',
     'db/BaseTable.java',
     'db/BrowserDatabaseHelper.java',
     'db/BrowserDB.java',
     'db/BrowserProvider.java',
     'db/DBUtils.java',
     'db/FormHistoryProvider.java',
--- a/mobile/android/base/strings.xml.in
+++ b/mobile/android/base/strings.xml.in
@@ -601,17 +601,16 @@
   <string name="eol_notification_summary">&eol_notification_summary;</string>
   <!-- https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/honeycomb -->
   <string name="eol_notification_url">https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/unsupported-version</string>
 
   <string name="whatsnew_notification_title">&whatsnew_notification_title;</string>
   <string name="whatsnew_notification_summary">&whatsnew_notification_summary;</string>
   <!-- https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/new-android -->
   <string name="whatsnew_notification_url">https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/new-android</string>
-  <string name="aurora_transition_notification_url">https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/aurora-transition</string>
 
   <string name="promotion_add_page_shortcut">&promotion_add_page_shortcut;</string>
 
   <string name="helper_first_offline_bookmark_title">&helper_first_offline_bookmark_title;</string>
   <string name="helper_first_offline_bookmark_message">&helper_first_offline_bookmark_message;</string>
   <string name="helper_first_offline_bookmark_button">&helper_first_offline_bookmark_button;</string>
 
   <string name="helper_triple_readerview_open_title">&helper_triple_readerview_open_title;</string>