Add notification to power save mode
Add small notification when mode is toggled and also disable web refiner
and edge navigation.
Change-Id: I166897c0e396b53884e05dac8189f049f34851f7
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 0a4bc34..a4cc47f 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -643,7 +643,7 @@
@Override
public void beforeNavigation(WebView view, String url) {
mTouchIconUrl = null;
- if (BrowserCommandLine.hasSwitch("ui-low-power-mode")) {
+ if (BaseUi.isUiLowPowerMode()) {
return;
}
@@ -677,7 +677,7 @@
@Override
public void onHistoryItemCommit(WebView view, int index) {
- if (BrowserCommandLine.hasSwitch("ui-low-power-mode")) {
+ if (BaseUi.isUiLowPowerMode()) {
return;
}
@@ -1414,8 +1414,7 @@
// save the WebView to call destroy() after detach it from the tab
final WebView webView = mMainView;
setWebView(null);
- if (!mWebViewDestroyedByMemoryMonitor &&
- !BrowserCommandLine.hasSwitch("ui-low-power-mode")) {
+ if (!mWebViewDestroyedByMemoryMonitor && !BaseUi.isUiLowPowerMode()) {
// Tabs can be reused with new instance of WebView so delete the snapshots
webView.getSnapshotIds(new ValueCallback<List<Integer>>() {
@Override