Projects >> packages_apps_Browser >>67832037dbba03f34873878d3f8080ded2ec1017

Chunk
Conflicting content
import android.content.Context;
>>>>>>> 7bf3f38c493642b181f0c7ddf30b8214e50fea3b
import android.content.Intent;
import android.content.Loader;
import android.content.ContentResolver;
<<<<<<< HEAD
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.CursorLoader;
=======
import android.app.Activity;
import android.app.LoaderManager;
import android.content.SharedPreferences;
Solution content
import android.app.Activity;
import android.app.LoaderManager;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Intent;
import android.content.Loader;
import android.content.SharedPreferences;
File
AddBookmarkPage.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
                Bookmarks.addBookmark(AddBookmarkPage.this, false, url,
                        title, thumbnail, true, mCurrentFolder);
                if (touchIconUrl != null) {
<<<<<<< HEAD
                    new DownloadTouchIcon(AddBookmarkPage.this, cr, url).execute(mTouchIconUrl);
=======
                    new DownloadTouchIcon(mContext, cr, url).execute(mTouchIconUrl);
>>>>>>> 7bf3f38c493642b181f0c7ddf30b8214e50fea3b
                }
                mMessage.arg1 = 1;
            } catch (IllegalStateException e) {
Solution content
                Bookmarks.addBookmark(AddBookmarkPage.this, false, url,
                        title, thumbnail, true, mCurrentFolder);
                if (touchIconUrl != null) {
                    new DownloadTouchIcon(mContext, cr, url).execute(mTouchIconUrl);
                }
                mMessage.arg1 = 1;
            } catch (IllegalStateException e) {
File
AddBookmarkPage.java
Developer's decision
Version 2
Kind of conflict
Method invocation
Chunk
Conflicting content
    private Cursor mCursor;
    private final String mOriginalUrl;
    private final String mUrl;
<<<<<<< HEAD
    private final String mUserAgent; // Sites may serve a different icon to different UAs
    private Message mMessage;

    private final Activity mActivity;
    /* package */ Tab mTab;

    /**
     * Use this ctor to store the touch icon in the bookmarks database for
     * the originalUrl so we take account of redirects. Used when the user
     * bookmarks a page from outside the bookmarks activity.
     */
    public DownloadTouchIcon(Tab tab, BrowserActivity activity, ContentResolver cr, WebView view) {
=======
    private final String mUserAgent;
    private final Context mContext;
    /* package */ Tab mTab;

    public DownloadTouchIcon(Tab tab, Context ctx, ContentResolver cr, WebView view) {
>>>>>>> 7bf3f38c493642b181f0c7ddf30b8214e50fea3b
        mTab = tab;
        mContext = ctx;
        mContentResolver = cr;
Solution content
     * bookmarks a page from outside the bookmarks activity.
     */
    private Cursor mCursor;
    private final String mOriginalUrl;
    private final String mUrl;
    private final String mUserAgent; // Sites may serve a different icon to different UAs
    private Message mMessage;

    private final Context mContext;
    /* package */ Tab mTab;

    /**
     * Use this ctor to store the touch icon in the bookmarks database for
     * the originalUrl so we take account of redirects. Used when the user
    public DownloadTouchIcon(Tab tab, Context ctx, ContentResolver cr, WebView view) {
        mTab = tab;
        mContext = ctx;
        mContentResolver = cr;
File
DownloadTouchIcon.java
Developer's decision
Combination
Kind of conflict
Attribute
Comment
Method signature
Chunk
Conflicting content
     * potential for the three different ctors here to return different icons.
     */
        mUserAgent = view.getSettings().getUserAgentString();
    }

<<<<<<< HEAD
    /**
     * Use this ctor to download the touch icon and update the bookmarks database
     * entry for the given url. Used when the user creates a bookmark from
     * within the bookmarks activity and there haven't been any redirects.
     * TODO: Would be nice to set the user agent here so that there is no
    public DownloadTouchIcon(AddBookmarkPage activity, ContentResolver cr, String url) {
        mTab = null;
        mActivity = activity;
=======
    public DownloadTouchIcon(Context ctx, ContentResolver cr, String url) {
        mTab = null;
        mContext = ctx;
>>>>>>> 7bf3f38c493642b181f0c7ddf30b8214e50fea3b
        mContentResolver = cr;
        mOriginalUrl = null;
        mUrl = url;
Solution content
        mUserAgent = view.getSettings().getUserAgentString();
    }

    /**
     * Use this ctor to download the touch icon and update the bookmarks database
     * entry for the given url. Used when the user creates a bookmark from
     * within the bookmarks activity and there haven't been any redirects.
     * 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(Context ctx, ContentResolver cr, String url) {
        mTab = null;
        mContext = ctx;
        mContentResolver = cr;
        mOriginalUrl = null;
        mUrl = url;
File
DownloadTouchIcon.java
Developer's decision
Combination
Kind of conflict
Attribute
Comment
Method signature
Variable
Chunk
Conflicting content
        String url = values[0];

<<<<<<< HEAD
        if (inDatabase || mMessage != null) {
            AndroidHttpClient client = AndroidHttpClient.newInstance(mUserAgent);
            HttpHost httpHost = Proxy.getPreferredHttpHost(mActivity, url);
=======
            AndroidHttpClient client = AndroidHttpClient.newInstance(
                    mUserAgent);
            HttpHost httpHost = Proxy.getPreferredHttpHost(mContext, url);
>>>>>>> 7bf3f38c493642b181f0c7ddf30b8214e50fea3b
            if (httpHost != null) {
                ConnRouteParams.setDefaultProxy(client.getParams(), httpHost);
            }
Solution content
        String url = values[0];

        if (inDatabase || mMessage != null) {
            AndroidHttpClient client = AndroidHttpClient.newInstance(mUserAgent);
            HttpHost httpHost = Proxy.getPreferredHttpHost(mContext, url);
            if (httpHost != null) {
                ConnRouteParams.setDefaultProxy(client.getParams(), httpHost);
            }
File
DownloadTouchIcon.java
Developer's decision
Combination
Kind of conflict
If statement
Method invocation
Variable