Commit 21499700 authored by Natalie Chouinard's avatar Natalie Chouinard Committed by Commit Bot

ChromeActivity JB cleanup

Jelly Bean support has been deprecated. Removing conditions that are no
longer necessary to check.

Bug: 923477
Change-Id: Ic8fca66acd3199f990e89fb0375d5ce823348e42
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865687Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Commit-Queue: Natalie Chouinard <chouinard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707471}
parent 3bb08d4c
......@@ -40,7 +40,6 @@ import androidx.annotation.Nullable;
import org.chromium.base.ActivityState;
import org.chromium.base.ApiCompatibilityUtils;
import org.chromium.base.ApplicationStatus;
import org.chromium.base.BaseSwitches;
import org.chromium.base.Callback;
import org.chromium.base.CommandLine;
import org.chromium.base.ContextUtils;
......@@ -120,7 +119,6 @@ import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper.MenuButtonState;
import org.chromium.chrome.browser.omaha.UpdateNotificationController;
import org.chromium.chrome.browser.page_info.PageInfoController;
import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
import org.chromium.chrome.browser.preferences.PrefServiceBridge;
import org.chromium.chrome.browser.preferences.PreferencesLauncher;
import org.chromium.chrome.browser.printing.TabPrinter;
......@@ -227,8 +225,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
*/
static final int NO_TOOLBAR_LAYOUT = -1;
private static final int RECORD_MULTI_WINDOW_SCREEN_WIDTH_DELAY_MS = 5000;
/**
* Timeout in ms for reading PartnerBrowserCustomizations provider.
*/
......@@ -447,33 +443,14 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
mAssistStatusHandler.updateAssistState();
}
// This check is only applicable for JB since in KK svelte was supported from the start.
// See https://crbug.com/826460 for context.
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) {
// If a user had ALLOW_LOW_END_DEVICE_UI explicitly set to false then we manually
// override SysUtils.isLowEndDevice() with a switch so that they continue to see the
// normal UI. This is only the case for grandfathered-in svelte users. We no longer
// do
// so for newer users.
if (!ChromePreferenceManager.getInstance().readBoolean(
ChromePreferenceManager.ALLOW_LOW_END_DEVICE_UI, true)) {
CommandLine.getInstance().appendSwitch(
BaseSwitches.DISABLE_LOW_END_DEVICE_MODE);
}
}
AccessibilityManager manager = (AccessibilityManager) getBaseContext().getSystemService(
Context.ACCESSIBILITY_SERVICE);
manager.addAccessibilityStateChangeListener(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mTouchExplorationStateChangeListener = enabled -> {
AccessibilityUtil.resetAccessibilityEnabled();
checkAccessibility();
};
manager.addTouchExplorationStateChangeListener(
mTouchExplorationStateChangeListener);
}
mTouchExplorationStateChangeListener = enabled -> {
AccessibilityUtil.resetAccessibilityEnabled();
checkAccessibility();
};
manager.addTouchExplorationStateChangeListener(mTouchExplorationStateChangeListener);
// Make the activity listen to policy change events
CombinedPolicyProvider.get().addPolicyChangeListener(this);
......@@ -1329,9 +1306,7 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
AccessibilityManager manager = (AccessibilityManager)
getBaseContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
manager.removeAccessibilityStateChangeListener(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
manager.removeTouchExplorationStateChangeListener(mTouchExplorationStateChangeListener);
}
manager.removeTouchExplorationStateChangeListener(mTouchExplorationStateChangeListener);
if (mTabThemeColorProvider != null) {
mTabThemeColorProvider.destroy();
......
......@@ -115,11 +115,14 @@ public class ChromePreferenceManager {
"signin_promo_last_shown_account_names";
/**
* This value may have been explicitly set to false when we used to keep existing low-end
* devices on the normal UI rather than the simplified UI. We want to keep the existing device
* settings. For all new low-end devices they should get the simplified UI by default.
* This value was used prior to KitKat to keep existing low-end devices on the normal UI rather
* than the simplified UI.
*
* This value may still exist in shared preferences file. Do not reuse.
*/
@Deprecated
public static final String ALLOW_LOW_END_DEVICE_UI = "allow_low_end_device_ui";
private static final String PREF_WEBSITE_SETTINGS_FILTER = "website_settings_filter";
private static final String CONTEXTUAL_SEARCH_TAP_TRIGGERED_PROMO_COUNT =
"contextual_search_tap_triggered_promo_count";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment