summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/Tab.java
diff options
context:
space:
mode:
authorPankaj Garg <pgarg@codeaurora.org>2015-06-22 11:06:12 -0700
committerjrizzoli <joey@cyanogenmoditalia.it>2015-08-28 13:15:45 +0200
commit18aa0a1af6f8b2aead6d0ab5870c56055d732782 (patch)
treef4c1b039ef75b6506e5d7564ed7cc4680321c369 /src/com/android/browser/Tab.java
parent32e1b940b71a96d55bd7b9cedf31fc4aacdbfec1 (diff)
downloadandroid_packages_apps_Gello-18aa0a1af6f8b2aead6d0ab5870c56055d732782.tar.gz
android_packages_apps_Gello-18aa0a1af6f8b2aead6d0ab5870c56055d732782.tar.bz2
android_packages_apps_Gello-18aa0a1af6f8b2aead6d0ab5870c56055d732782.zip
Command line flag to disable edge navigation
Added ui-low-power-mode command line flag. If present, it disables the edge navigation feature in SWE browser. In future this flag can be used to disable other features that need high CPU utilization. Change-Id: I2e987be7edc4afa87ea138c9b602c3208fa88515
Diffstat (limited to 'src/com/android/browser/Tab.java')
-rw-r--r--src/com/android/browser/Tab.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index a7157d07..64be2891 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -64,6 +64,7 @@ import com.android.browser.mynavigation.MyNavigationUtil;
import com.android.browser.provider.MyNavigationProvider;
import com.android.browser.provider.SnapshotProvider.Snapshots;
+import org.codeaurora.swe.BrowserCommandLine;
import org.codeaurora.swe.BrowserDownloadListener;
import org.codeaurora.swe.ClientCertRequestHandler;
import org.codeaurora.swe.HttpAuthHandler;
@@ -633,6 +634,10 @@ class Tab implements PictureListener {
@Override
public void beforeNavigation(WebView view, String url) {
+ if (BrowserCommandLine.hasSwitch("ui-low-power-mode")) {
+ return;
+ }
+
if (isPrivateBrowsingEnabled()) {
return;
}
@@ -663,6 +668,10 @@ class Tab implements PictureListener {
@Override
public void onHistoryItemCommit(WebView view, int index) {
+ if (BrowserCommandLine.hasSwitch("ui-low-power-mode")) {
+ return;
+ }
+
mTabHistoryUpdateObservable.set(index);
final int maxIdx = view.copyBackForwardList().getSize();
final WebView wv = view;
@@ -1382,7 +1391,8 @@ class Tab implements PictureListener {
dismissSubWindow();
// save the WebView to call destroy() after detach it from the tab
final WebView webView = mMainView;
- if (!mWebViewDestroyedByMemoryMonitor) {
+ if (!mWebViewDestroyedByMemoryMonitor &&
+ !BrowserCommandLine.hasSwitch("ui-low-power-mode")) {
webView.getSnapshotIds(new ValueCallback<List<Integer>>() {
@Override
public void onReceiveValue(List<Integer> ids) {