Projects >> platform_packages_apps_browser >>fbbd2aced9ace1d063ad166d96a605446a9d2f7e

Chunk
Conflicting content
                    new String[] { Browser.BookmarkColumns.URL, Browser.BookmarkColumns.TITLE,
                    Browser.BookmarkColumns.FAVICON }, "bookmark = 1", null, null);

<<<<<<< HEAD
            if ((c != null) && c.moveToFirst()) {
                int urlIndex = c.getColumnIndex(Browser.BookmarkColumns.URL);
                int titleIndex = c.getColumnIndex(Browser.BookmarkColumns.TITLE);
                int faviconIndex = c.getColumnIndex(Browser.BookmarkColumns.FAVICON);
                do {
                    String url = c.getString(urlIndex);
                    String host = Uri.parse(url).getHost();
                    if (hosts.containsKey(host)) {
                        String title = c.getString(titleIndex);
                        Bitmap bmp = null;
                        byte[] data = c.getBlob(faviconIndex);
                        if (data != null) {
                            bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
                        }
                        Set matchingSites = (Set) hosts.get(host);
                        Iterator sitesIter = matchingSites.iterator();
                        while (sitesIter.hasNext()) {
                            Site site = sitesIter.next();
                            // We should only set the title if the bookmark is for the root
                            // (i.e. www.google.com), as website settings act on the origin
                            // as a whole rather than a single page under that origin. If the
                            // user has bookmarked a page under the root but *not* the root,
                            // then we risk displaying the title of that page which may or
                            // may not have any relevance to the origin.
                            if (url.equals(site.getOrigin()) ||
                                    (new String(site.getOrigin()+"/")).equals(url)) {
                                site.setTitle(title);
                            }
                            if (bmp != null) {
                                site.setIcon(bmp);
=======
            if (c != null) {
                if(c.moveToFirst()) {
                    int urlIndex = c.getColumnIndex(Browser.BookmarkColumns.URL);
                    int titleIndex = c.getColumnIndex(Browser.BookmarkColumns.TITLE);
                    int faviconIndex = c.getColumnIndex(Browser.BookmarkColumns.FAVICON);
                    do {
                        String url = c.getString(urlIndex);
                        String host = Uri.parse(url).getHost();
                        if (hosts.containsKey(host)) {
                            String title = c.getString(titleIndex);
                            Bitmap bmp = null;
                            byte[] data = c.getBlob(faviconIndex);
                            if (data != null) {
                                bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
                            }
                            Set matchingSites = (Set)hosts.get(host);
                            Iterator sitesIter = matchingSites.iterator();
                            while (sitesIter.hasNext()) {
                                Site site = sitesIter.next();
                                site.setTitle(title);
                                if (bmp != null) {
                                    site.setIcon(bmp);
                                }
>>>>>>> 2ceb570ad3b37fca2169ea9f453984cebf8c372c
                            }
                        }
                    } while (c.moveToNext());
Solution content
                    new String[] { Browser.BookmarkColumns.URL, Browser.BookmarkColumns.TITLE,
                    Browser.BookmarkColumns.FAVICON }, "bookmark = 1", null, null);

            if (c != null) {
                if (c.moveToFirst()) {
                    int urlIndex = c.getColumnIndex(Browser.BookmarkColumns.URL);
                    int titleIndex = c.getColumnIndex(Browser.BookmarkColumns.TITLE);
                    int faviconIndex = c.getColumnIndex(Browser.BookmarkColumns.FAVICON);
                    do {
                        String url = c.getString(urlIndex);
                        String host = Uri.parse(url).getHost();
                        if (hosts.containsKey(host)) {
                            String title = c.getString(titleIndex);
                            Bitmap bmp = null;
                            byte[] data = c.getBlob(faviconIndex);
                            if (data != null) {
                                bmp = BitmapFactory.decodeByteArray(data, 0, data.length);
                            }
                            Set matchingSites = (Set) hosts.get(host);
                            Iterator sitesIter = matchingSites.iterator();
                            while (sitesIter.hasNext()) {
                                Site site = sitesIter.next();
                                // We should only set the title if the bookmark is for the root
                                // (i.e. www.google.com), as website settings act on the origin
                                // as a whole rather than a single page under that origin. If the
                                // user has bookmarked a page under the root but *not* the root,
                                // then we risk displaying the title of that page which may or
                                // may not have any relevance to the origin.
                                if (url.equals(site.getOrigin()) ||
                                        (new String(site.getOrigin()+"/")).equals(url)) {
                                    site.setTitle(title);
                                }
                                if (bmp != null) {
                                    site.setIcon(bmp);
                                }
                            }
                        }
                    } while (c.moveToNext());
File
WebsiteSettingsActivity.java
Developer's decision
Combination
Kind of conflict
Cast expression
Comment
Do statement
If statement
Method invocation
Variable
While statement