summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2011-04-25 15:16:58 -0700
committerMichael Kolb <kolby@google.com>2011-04-25 15:16:58 -0700
commit6cd8f6b6ad2733f71d81de1188d830d010c1b4b6 (patch)
treee268e20f832fdf4e8e529f7aee38ce63b757a8b4
parent5e17ca2266abd4852468a66f911adcdfec721289 (diff)
downloadpackages_apps_Browser-6cd8f6b6ad2733f71d81de1188d830d010c1b4b6.zip
packages_apps_Browser-6cd8f6b6ad2733f71d81de1188d830d010c1b4b6.tar.gz
packages_apps_Browser-6cd8f6b6ad2733f71d81de1188d830d010c1b4b6.tar.bz2
remove async capture
Change-Id: I3a621487d35eabe519d54411f392e16918c0af00
-rw-r--r--src/com/android/browser/NavScreen.java26
-rw-r--r--src/com/android/browser/PhoneUi.java14
2 files changed, 4 insertions, 36 deletions
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java
index 8cc2271..edbaa3b 100644
--- a/src/com/android/browser/NavScreen.java
+++ b/src/com/android/browser/NavScreen.java
@@ -40,7 +40,6 @@ import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
-import java.util.concurrent.Semaphore;
public class NavScreen extends LinearLayout implements OnClickListener {
@@ -65,7 +64,6 @@ public class NavScreen extends LinearLayout implements OnClickListener {
int mTabHeight;
TabAdapter mAdapter;
ListPopupWindow mPopup;
- Semaphore mLock;
public NavScreen(Activity activity, UiController ctl, PhoneUi ui) {
super(activity);
@@ -85,30 +83,6 @@ public class NavScreen extends LinearLayout implements OnClickListener {
requestLayout();
}
- protected synchronized void startTask(Runnable r) {
- Thread task = new Thread(r);
- mLock = new Semaphore(1);
- try {
- mLock.acquire();
- } catch (InterruptedException e) {
- }
- task.start();
- }
-
- protected synchronized void finishTask() {
- mLock.release();
- }
-
- protected synchronized void waitForTask() {
- if (mLock != null) {
- try {
- mLock.acquire();
- } catch (InterruptedException e) {
- }
- }
- mLock = null;
- }
-
protected void showMenu() {
Menu menu = mUi.getMenu();
menu.setGroupVisible(R.id.NAV_MENU, false);
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index 063fcb9..fe13139 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -298,15 +298,6 @@ public class PhoneUi extends BaseUi {
if (mAnimating) return;
mAnimating = true;
mNavScreen = new NavScreen(mActivity, mUiController, this);
- mNavScreen.startTask(new Runnable() {
- public void run() {
- BrowserWebView web = (BrowserWebView) getWebView();
- if (web != null) {
- mActiveTab.setScreenshot(web.capture());
- }
- mNavScreen.finishTask();
- }
- });
WebView web = getWebView();
if (web != null) {
int w = web.getWidth();
@@ -352,7 +343,10 @@ public class PhoneUi extends BaseUi {
mContentView.setVisibility(View.GONE);
mContentView.setScaleX(1.0f);
mContentView.setScaleY(1.0f);
- mNavScreen.waitForTask();
+ BrowserWebView web = (BrowserWebView) getWebView();
+ if (web != null) {
+ mActiveTab.setScreenshot(web.capture());
+ }
// Finally show the custom view container.
mCustomViewContainer.setVisibility(View.VISIBLE);
mCustomViewContainer.bringToFront();