Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db674fb4 authored by Grace Kloba's avatar Grace Kloba
Browse files

Not all WebView's host have permission to read the history.

Add a security catch and return an empty list.

We don't use tab in the code.

Fix http://b/viewIssue?id=2144339
parent 43f99202
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -281,11 +281,11 @@ public class Browser {
     */
    public static final String[] getVisitedHistory(ContentResolver cr) {
        try {
	    String[] projection = new String[] { "url" };
	    Cursor c = cr.query(BOOKMARKS_URI,
				projection,
				"visits > 0",
				null, null);
            String[] projection = new String[] {
                "url"
            };
            Cursor c = cr.query(BOOKMARKS_URI, projection, "visits > 0", null,
                    null);
            String[] str = new String[c.getCount()];
            int i = 0;
            while (c.moveToNext()) {
+3 −1
Original line number Diff line number Diff line
@@ -312,7 +312,9 @@ final class WebViewCore {
    }

    protected String[] populateVisitedLinks() {
	return Browser.getVisitedHistory(mContext.getContentResolver());
        // FIXME: getVisitedHistory needs permission and host may not have.
//        return Browser.getVisitedHistory(mContext.getContentResolver());
        return new String[0];
    }

    /**