From e2b969edfca4d7f1961139249a9e41b45b9d2b50 Mon Sep 17 00:00:00 2001 From: aurimas Date: Tue, 14 Jul 2015 19:19:01 -0700 Subject: [PATCH] Add a workaround for Android Support Library bug on Android M. There is a bug in Android Support Library on Android M devices when user brings up the ActionMode (cut, copy, paste) bar as it breaks BACK button. This change forces Android Support library not to handle action mode and let the system handle it instead. BUG=510128 Review URL: https://codereview.chromium.org/1235253005 Cr-Commit-Position: refs/heads/master@{#338804} --- .../android/java/src/org/chromium/chrome/browser/ChromeActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java index 117b21845282..38f3cb475f02 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java @@ -39,6 +39,7 @@ import android.view.accessibility.AccessibilityManager.TouchExplorationStateChan import org.chromium.base.ApiCompatibilityUtils; import org.chromium.base.BaseSwitches; +import org.chromium.base.BuildInfo; import org.chromium.base.CommandLine; import org.chromium.base.Log; import org.chromium.base.ThreadUtils; @@ -460,6 +461,10 @@ public abstract class ChromeActivity extends AsyncInitializationActivity @Override public void onStartWithNative() { super.onStartWithNative(); + if (BuildInfo.isMncOrLater()) { + // Android support library workaround for Android M. See crbug.com/510128 + getDelegate().setHandleNativeActionModesEnabled(false); + } getChromeApplication().onStartWithNative(); Tab tab = getActivityTab(); if (tab != null) tab.onActivityStart(); -- 2.11.4.GIT