Fix NPEs after merge of d159ec534823b87f9896843e95912b0df8c27e16 from open
source master.
Change-Id: Ief98236102983698e4b753ec9649142761c86607
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java
index 104a495..10c91f8 100644
--- a/src/com/android/browser/AddBookmarkPage.java
+++ b/src/com/android/browser/AddBookmarkPage.java
@@ -150,7 +150,7 @@
final ContentResolver cr = getContentResolver();
Bookmarks.addBookmark(null, cr, url, title, thumbnail, true);
if (touchIconUrl != null) {
- new DownloadTouchIcon(cr, url).execute(mTouchIconUrl);
+ new DownloadTouchIcon(AddBookmarkPage.this, cr, url).execute(mTouchIconUrl);
}
mMessage.arg1 = 1;
} catch (IllegalStateException e) {
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index dde0765..6a7c79e 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -3782,7 +3782,7 @@
b.putParcelable("favicon", current.getFavicon());
Message msg = mHandler.obtainMessage(TOUCH_ICON_DOWNLOADED);
msg.setData(b);
- new DownloadTouchIcon(msg,
+ new DownloadTouchIcon(BrowserActivity.this, msg,
mTabControl.getCurrentWebView().getSettings()
.getUserAgentString()).execute(touchIconUrl);
} else {
diff --git a/src/com/android/browser/DownloadTouchIcon.java b/src/com/android/browser/DownloadTouchIcon.java
index 98e14fb..765d288 100644
--- a/src/com/android/browser/DownloadTouchIcon.java
+++ b/src/com/android/browser/DownloadTouchIcon.java
@@ -16,6 +16,7 @@
package com.android.browser;
+import android.app.Activity;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
@@ -49,7 +50,7 @@
private final String mUserAgent; // Sites may serve a different icon to different UAs
private Message mMessage;
- private final BrowserActivity mActivity;
+ private final Activity mActivity;
/* package */ Tab mTab;
/**
@@ -74,9 +75,9 @@
* TODO: Would be nice to set the user agent here so that there is no
* potential for the three different ctors here to return different icons.
*/
- public DownloadTouchIcon(ContentResolver cr, String url) {
+ public DownloadTouchIcon(AddBookmarkPage activity, ContentResolver cr, String url) {
mTab = null;
- mActivity = null;
+ mActivity = activity;
mContentResolver = cr;
mOriginalUrl = null;
mUrl = url;
@@ -88,9 +89,9 @@
* the passed Message's data bundle with the key "touchIcon" and then send
* the message.
*/
- public DownloadTouchIcon(Message msg, String userAgent) {
+ public DownloadTouchIcon(BrowserActivity activity, Message msg, String userAgent) {
mMessage = msg;
- mActivity = null;
+ mActivity = activity;
mContentResolver = null;
mOriginalUrl = null;
mUrl = null;