Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4419)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java

Issue 2397903003: Speculative fix for libPowerStretch.so crash. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
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 acf3559a026ef34b51393cb78933b40af4807620..28c902fe08807281e836dfc1af4af76359cd12b8 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -1795,9 +1795,21 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
mContextMenuCloseObservers.removeObserver(callback);
}
+ private boolean shouldDisableHardwareAcceleration() {
+ // Low end devices should disable hardware acceleration for memory gains.
+ if (SysUtils.isLowEndDevice()) return true;
+ // GT-S7580 on JDQ39 accounts for 42% of crashes in libPowerStretch.so. Speculative fix to
+ // see if turning off hardware acceleration fixes this. See http://crbug.com/651918.
+ if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR1
+ && Build.MODEL.equals("GT-S7580")) {
+ return true;
+ }
+ return false;
+ }
+
private void enableHardwareAcceleration() {
- // HW acceleration is disabled in the manifest. Enable it only on high-end devices.
- if (!SysUtils.isLowEndDevice()) {
+ // HW acceleration is disabled in the manifest and may be re-enabled here.
+ if (!shouldDisableHardwareAcceleration()) {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
// When HW acceleration is enabled manually for an activity, child windows (e.g.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698