Add low power mode optimization
- In low power mode UI will no longer try
to color the status bar based on the favicon
- Fixed titlebar not translating fully. This
was resulting in the view not hiding completely
and causing a higher power draw.
- Removed previous change to hide dropshadow
when playing fullscreen content. Not needed now.
Change-Id: I7943737429f22e105aa2315a97c018bce75c839c
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index af2fbfa..7032029 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -23,6 +23,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
+import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.PowerManager;
@@ -38,6 +39,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
+import android.view.WindowManager;
import org.chromium.base.VisibleForTesting;
import com.android.browser.R;
@@ -219,6 +221,13 @@
@Override
protected void onResume() {
+ // Checking for Lollipop or above as only those builds will use the v21/styles(material)
+ if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
+ BrowserSettings.getInstance().isPowerSaveModeEnabled()) {
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ } else if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
+ }
super.onResume();
if (LOGV_ENABLED) {
Log.v(LOGTAG, "BrowserActivity.onResume: this=" + this);