summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-19 00:34:58 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-11-19 00:43:52 +0000
commit285eb1d81de6887ae4e7a8b725a7dd7038b6b231 (patch)
tree77821a6f00686a14817f444d31886824fdbd671f
parentbf5e496dc1f5f69b6c24a03828e89849a5587235 (diff)
downloadpackages_apps_browser-285eb1d81de6887ae4e7a8b725a7dd7038b6b231.zip
packages_apps_browser-285eb1d81de6887ae4e7a8b725a7dd7038b6b231.tar.gz
packages_apps_browser-285eb1d81de6887ae4e7a8b725a7dd7038b6b231.tar.bz2
Revert "Multimedia feature port from ICS"
This reverts commit 9aa4a1b524d567c70967565bce2636f01c298d84.
-rw-r--r--res/values/strings.xml23
-rw-r--r--res/xml/bandwidth_preferences.xml9
-rw-r--r--src/com/android/browser/BaseUi.java26
-rw-r--r--src/com/android/browser/BrowserSettings.java17
-rw-r--r--src/com/android/browser/Controller.java10
-rw-r--r--src/com/android/browser/NetworkStateHandler.java18
-rw-r--r--src/com/android/browser/PreferenceKeys.java2
-rw-r--r--src/com/android/browser/preferences/BandwidthPreferencesFragment.java10
8 files changed, 6 insertions, 109 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c420e4a..411aefb 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
- Copyright (c) 2011, 2012, Code Aurora Forum. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -700,28 +699,6 @@
<string name="pref_link_prefetch_summary">Allow browser to preload linked web pages in the background</string>
<!-- Title of dialog for link prefetching [CHAR LIMIT=40] -->
<string name="pref_link_prefetch_dialogtitle">Web page preloading</string>
- <!-- Title for video preloading [CHAR LIMIT=40] -->
- <string name="pref_video_preload_title">Video preloading</string>
- <!-- Video preloading options [CHAR LIMIT=20] -->
- <string-array name="pref_video_preload_choices">
- <item>Never</item>
- <item>Only on WiFi</item>
- <item>Always</item>
- </string-array>
- <!-- Do not translate -->
- <string name="pref_video_preload_value_never" translatable="false">NEVER</string>
- <string name="pref_video_preload_value_wifi_only" translatable="false">WIFI_ONLY</string>
- <string name="pref_video_preload_value_always" translatable="false">ALWAYS</string>
- <string name="pref_video_preload_default_value" translatable="false">@string/pref_video_preload_value_wifi_only</string>
- <string-array name="pref_video_preload_values" translatable="false">
- <item><xliff:g>@string/pref_video_preload_value_never</xliff:g></item>
- <item><xliff:g>@string/pref_video_preload_value_wifi_only</xliff:g></item>
- <item><xliff:g>@string/pref_video_preload_value_always</xliff:g></item>
- </string-array>
- <!-- Summary for video preloading [CHAR LIMIT=80] -->
- <string name="pref_video_preload_summary">Allow browser to preload video when server allows</string>
- <!-- Title of dialog for video preloading [CHAR LIMIT=40] -->
- <string name="pref_video_preload_dialogtitle">Video preloading</string>
<!-- Title for a dialog displayed when the browser has a data connectivity
problem -->
<string name="browserFrameNetworkErrorLabel">Connection problem</string>
diff --git a/res/xml/bandwidth_preferences.xml b/res/xml/bandwidth_preferences.xml
index 709d9da..9946b48 100644
--- a/res/xml/bandwidth_preferences.xml
+++ b/res/xml/bandwidth_preferences.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 The Android Open Source Project
- Copyright (c) 2012, Code Aurora Forum. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -33,14 +32,6 @@
android:entryValues="@array/pref_link_prefetch_values"
android:dialogTitle="@string/pref_link_prefetch_dialogtitle" />
- <ListPreference
- android:key="preload_video"
- android:title="@string/pref_video_preload_title"
- android:summary="@string/pref_video_preload_summary"
- android:entries="@array/pref_video_preload_choices"
- android:entryValues="@array/pref_video_preload_values"
- android:dialogTitle="@string/pref_video_preload_dialogtitle" />
-
<CheckBoxPreference
android:key="load_images"
android:defaultValue="true"
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index 1165c53..b555621 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -77,9 +76,7 @@ public abstract class BaseUi implements UI {
Gravity.CENTER);
private static final int MSG_HIDE_TITLEBAR = 1;
- private static final int MSG_HIDE_CUSTOM_VIEW = 2;
public static final int HIDE_TITLEBAR_DELAY = 1500; // in ms
- public static final int HIDE_CUSTOM_VIEW_DELAY = 750; // in ms
Activity mActivity;
UiController mUiController;
@@ -543,31 +540,22 @@ public abstract class BaseUi implements UI {
mActivity.setRequestedOrientation(requestedOrientation);
}
- private void hideCustomViewAfterDuration() {
- Message msg = Message.obtain(mHandler, MSG_HIDE_CUSTOM_VIEW);
- mHandler.sendMessageDelayed(msg, HIDE_CUSTOM_VIEW_DELAY);
- }
-
- private void hideCustomView() {
+ @Override
+ public void onHideCustomView() {
+ ((BrowserWebView) getWebView()).setVisibility(View.VISIBLE);
+ if (mCustomView == null)
+ return;
setFullscreen(false);
FrameLayout decor = (FrameLayout) mActivity.getWindow().getDecorView();
decor.removeView(mFullscreenContainer);
mFullscreenContainer = null;
mCustomView = null;
+ mCustomViewCallback.onCustomViewHidden();
// Show the content view.
mActivity.setRequestedOrientation(mOriginalOrientation);
}
@Override
- public void onHideCustomView() {
- ((BrowserWebView) getWebView()).setVisibility(View.VISIBLE);
- if (mCustomView == null)
- return;
- mCustomViewCallback.onCustomViewHidden();
- hideCustomViewAfterDuration();
- }
-
- @Override
public boolean isCustomViewShowing() {
return mCustomView != null;
}
@@ -846,8 +834,6 @@ public abstract class BaseUi implements UI {
public void handleMessage(Message msg) {
if (msg.what == MSG_HIDE_TITLEBAR) {
suggestHideTitleBar();
- } else if (msg.what == MSG_HIDE_CUSTOM_VIEW) {
- hideCustomView();
}
BaseUi.this.handleMessage(msg);
}
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/browser/BrowserSettings.java
index cec3b30..4073f1c 100644
--- a/src/com/android/browser/BrowserSettings.java
+++ b/src/com/android/browser/BrowserSettings.java
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2011 The Android Open Source Project
- * Copyright (c) 2011, 2012, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -918,22 +917,6 @@ public class BrowserSettings implements OnSharedPreferenceChangeListener,
return mPrefs.getString(PREF_LINK_PREFETCH, getDefaultLinkPrefetchSetting());
}
- public String getVideoPreloadOnWifiOnlyPreferenceString() {
- return mContext.getResources().getString(R.string.pref_video_preload_value_wifi_only);
- }
-
- public String getVideoPreloadAlwaysPreferenceString() {
- return mContext.getResources().getString(R.string.pref_video_preload_value_always);
- }
-
- public String getDefaultVideoPreloadSetting() {
- return mContext.getResources().getString(R.string.pref_video_preload_default_value);
- }
-
- public String getVideoPreloadEnabled() {
- return mPrefs.getString(PREF_VIDEO_PRELOAD, getDefaultVideoPreloadSetting());
- }
-
// -----------------------------
// getter/setters for browser recovery
// -----------------------------
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 2b449ec..77ceb95 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (c) 2011, 2012, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -834,15 +833,6 @@ public class Controller
view.setNetworkAvailable(false);
}
- WebSettings settings = view.getSettings();
- String preload = mSettings.getVideoPreloadEnabled();
- if (mSettings.getVideoPreloadAlwaysPreferenceString().equals(preload))
- settings.setMediaPreloadEnabled(true);
- else if (mSettings.getVideoPreloadOnWifiOnlyPreferenceString().equals(preload))
- settings.setMediaPreloadEnabled(mNetworkHandler.isWifiUp());
- else
- settings.setMediaPreloadEnabled(false);
-
// when BrowserActivity just starts, onPageStarted may be called before
// onResume as it is triggered from onCreate. Call resumeWebViewTimers
// to start the timer. As we won't switch tabs while an activity is in
diff --git a/src/com/android/browser/NetworkStateHandler.java b/src/com/android/browser/NetworkStateHandler.java
index f3c46aa..4480664 100644
--- a/src/com/android/browser/NetworkStateHandler.java
+++ b/src/com/android/browser/NetworkStateHandler.java
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -113,23 +112,6 @@ public class NetworkStateHandler {
return mIsNetworkUp;
}
- boolean isWifiUp() {
- ConnectivityManager cm = (ConnectivityManager) mActivity
- .getSystemService(Context.CONNECTIVITY_SERVICE);
- NetworkInfo info = cm.getActiveNetworkInfo();
- if (info != null) {
- switch (info.getType()) {
- case ConnectivityManager.TYPE_WIFI:
- case ConnectivityManager.TYPE_ETHERNET:
- case ConnectivityManager.TYPE_BLUETOOTH:
- return true;
- default:
- return false;
- }
- } else
- return false;
- }
-
private void sendNetworkType(String type, String subtype) {
WebView w = mController.getCurrentWebView();
if (w != null) {
diff --git a/src/com/android/browser/PreferenceKeys.java b/src/com/android/browser/PreferenceKeys.java
index 405d893..1828032 100644
--- a/src/com/android/browser/PreferenceKeys.java
+++ b/src/com/android/browser/PreferenceKeys.java
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2011 The Android Open Source Project
- * Copyright (c) 2011, 2012, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -105,7 +104,6 @@ public interface PreferenceKeys {
// ----------------------
static final String PREF_DATA_PRELOAD = "preload_when";
static final String PREF_LINK_PREFETCH = "link_prefetch_when";
- static final String PREF_VIDEO_PRELOAD = "preload_video";
static final String PREF_LOAD_IMAGES = "load_images";
// ----------------------
diff --git a/src/com/android/browser/preferences/BandwidthPreferencesFragment.java b/src/com/android/browser/preferences/BandwidthPreferencesFragment.java
index 36d1689..0cb064a 100644
--- a/src/com/android/browser/preferences/BandwidthPreferencesFragment.java
+++ b/src/com/android/browser/preferences/BandwidthPreferencesFragment.java
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2011 The Android Open Source Project
- * Copyright (c) 2012, Code Aurora Forum. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -59,15 +58,6 @@ public class BandwidthPreferencesFragment extends PreferenceFragment {
prefetch.setValue(BrowserSettings.getInstance().getDefaultLinkPrefetchSetting());
}
}
- if (!getPreferenceScreen().getSharedPreferences()
- .contains(PreferenceKeys.PREF_VIDEO_PRELOAD)) {
- // set default value for preload setting
- ListPreference preload = (ListPreference) getPreferenceScreen().findPreference(
- PreferenceKeys.PREF_VIDEO_PRELOAD);
- if (preload != null) {
- preload.setValue(BrowserSettings.getInstance().getDefaultVideoPreloadSetting());
- }
- }
}
}