fix various NPEs
Bugs: 4597115
4580514
4580511
4560889
4545346
Monkey proofing nav screen;
disabled pause/resume during scroll
Change-Id: I4e24b91fc0b6c008cb4e2df113316c0063f0c915
diff --git a/src/com/android/browser/NavTabScroller.java b/src/com/android/browser/NavTabScroller.java
index bd26df7..312e2b8 100644
--- a/src/com/android/browser/NavTabScroller.java
+++ b/src/com/android/browser/NavTabScroller.java
@@ -197,17 +197,7 @@
int bottom = child.getBottom();
if (top <= midy && bottom >= midy) {
sel = i;
- } else {
- // check if on screen
- if (top > getScrollY() + getHeight() || bottom < getScrollY()) {
- if (!child.isPaused()) {
- child.pause();
- }
- } else {
- if (child.isPaused()) {
- child.resume();
- }
- }
+ break;
}
}
if (sel != -1) {
diff --git a/src/com/android/browser/NavTabView.java b/src/com/android/browser/NavTabView.java
index 061e024..f170b0f 100644
--- a/src/com/android/browser/NavTabView.java
+++ b/src/com/android/browser/NavTabView.java
@@ -198,7 +198,9 @@
@Override
public void onDetachedFromWindow() {
- mWebView.setProxyView(null);
+ if (mWebView != null) {
+ mWebView.setProxyView(null);
+ }
}
private static void removeFromParent(View v) {
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 0aaf3d6..1e21431 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -286,7 +286,11 @@
}
}
outState.putLongArray(POSITIONS, ids);
- final long cid = getCurrentTab().getId();
+ Tab current = getCurrentTab();
+ long cid = -1;
+ if (current != null) {
+ cid = current.getId();
+ }
outState.putLong(CURRENT, cid);
}