Backed out 2 changesets (bug 1456110) for failures on testSettingsPages related to notifications. CLOSED TREE

Backed out changeset 6120e8aa1e3b (bug 1456110)
Backed out changeset b074e28cbaec (bug 1456110)
This commit is contained in:
Csoregi Natalia 2018-09-17 19:05:05 +03:00
Родитель 3d4150df71
Коммит b473bf8cc9
2 изменённых файлов: 3 добавлений и 23 удалений

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

@ -46,11 +46,10 @@
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_notifications"
android:summary="@string/pref_category_notifications_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment"
android:key="android.not_a_preference.notifications_screen">
android:summary="@string/pref_category_notifications_summary"
android:fragment="org.mozilla.gecko.preferences.GeckoPreferenceFragment">
<extra android:name="resource"
android:value="preferences_notifications"/>
android:value="preferences_notifications"/>
</PreferenceScreen>
<PreferenceScreen android:title="@string/pref_category_advanced"

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

@ -57,7 +57,6 @@ import org.mozilla.gecko.BrowserLocaleManager;
import org.mozilla.gecko.DataReportingNotification;
import org.mozilla.gecko.DynamicToolbar;
import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.Experiments;
import org.mozilla.gecko.GeckoApplication;
import org.mozilla.gecko.GeckoProfile;
import org.mozilla.gecko.GeckoSharedPrefs;
@ -74,7 +73,6 @@ import org.mozilla.gecko.mma.MmaDelegate;
import org.mozilla.gecko.permissions.Permissions;
import org.mozilla.gecko.restrictions.Restrictable;
import org.mozilla.gecko.restrictions.Restrictions;
import org.mozilla.gecko.switchboard.SwitchBoard;
import org.mozilla.gecko.tabqueue.TabQueueHelper;
import org.mozilla.gecko.tabqueue.TabQueuePrompt;
import org.mozilla.gecko.updater.UpdateServiceHelper;
@ -147,7 +145,6 @@ public class GeckoPreferences
public static final String PREFS_HISTORY_SAVED_SEARCH = NON_PREF_PREFIX + "search.search_history.enabled";
private static final String PREFS_FAQ_LINK = NON_PREF_PREFIX + "faq.link";
private static final String PREFS_FEEDBACK_LINK = NON_PREF_PREFIX + "feedback.link";
private static final String PREFS_SCREEN_NOTIFICATIONS = NON_PREF_PREFIX + "notifications_screen";
public static final String PREFS_NOTIFICATIONS_WHATS_NEW = NON_PREF_PREFIX + "notifications.whats_new";
public static final String PREFS_NOTIFICATIONS_FEATURES_TIPS = NON_PREF_PREFIX + "notifications.features.tips";
public static final String PREFS_APP_UPDATE_LAST_BUILD_ID = "app.update.last_build_id";
@ -662,11 +659,6 @@ public class GeckoPreferences
preferences.removePreference(pref);
i--;
continue;
} else if (PREFS_SCREEN_NOTIFICATIONS.equals(key) &&
!haveNotificationsPreferences(getApplicationContext())) {
preferences.removePreference(pref);
i--;
continue;
}
setupPreferences((PreferenceGroup) pref, prefs);
} else {
@ -831,12 +823,6 @@ public class GeckoPreferences
i--;
continue;
}
} else if (PREFS_NOTIFICATIONS_WHATS_NEW.equals(key)) {
if (!SwitchBoard.isInExperiment(this, Experiments.WHATSNEW_NOTIFICATION)) {
preferences.removePreference(pref);
i--;
continue;
}
} else if (PREFS_NOTIFICATIONS_FEATURES_TIPS.equals(key)) {
final boolean isLeanplumAvailable = MmaDelegate.isMmaExperimentEnabled(this);
@ -1487,9 +1473,4 @@ public class GeckoPreferences
// Health Report is enabled by default so we'll return true if the preference is not found
return GeckoPreferences.getBooleanPref(context, PREFS_HEALTHREPORT_UPLOAD_ENABLED, true);
}
private static boolean haveNotificationsPreferences(@NonNull Context context) {
return SwitchBoard.isInExperiment(context, Experiments.WHATSNEW_NOTIFICATION) ||
MmaDelegate.isMmaExperimentEnabled(context);
}
}