Loading core/java/android/provider/Browser.java +26 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,32 @@ public class Browser { } } /** * Returns all the URLs in the history. * Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS} * @param cr The ContentResolver used to access the database. * @hide pending API council approval */ 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[] str = new String[c.getCount()]; int i = 0; while (c.moveToNext()) { str[i] = c.getString(0); i++; } c.deactivate(); return str; } catch (IllegalStateException e) { return new String[0]; } } /** * If there are more than MAX_HISTORY_COUNT non-bookmark history * items in the bookmark/history table, delete TRUNCATE_N_OLDEST Loading core/java/android/webkit/WebViewCore.java +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.Process; import android.provider.Browser; import android.util.Log; import android.util.SparseBooleanArray; import android.view.KeyEvent; Loading Loading @@ -310,6 +311,10 @@ final class WebViewCore { }); } protected String[] populateVisitedLinks() { return Browser.getVisitedHistory(mContext.getContentResolver()); } /** * Shows a prompt to ask the user to set the Geolocation permission state * for the given origin. Loading Loading
core/java/android/provider/Browser.java +26 −0 Original line number Diff line number Diff line Loading @@ -273,6 +273,32 @@ public class Browser { } } /** * Returns all the URLs in the history. * Requires {@link android.Manifest.permission#READ_HISTORY_BOOKMARKS} * @param cr The ContentResolver used to access the database. * @hide pending API council approval */ 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[] str = new String[c.getCount()]; int i = 0; while (c.moveToNext()) { str[i] = c.getString(0); i++; } c.deactivate(); return str; } catch (IllegalStateException e) { return new String[0]; } } /** * If there are more than MAX_HISTORY_COUNT non-bookmark history * items in the bookmark/history table, delete TRUNCATE_N_OLDEST Loading
core/java/android/webkit/WebViewCore.java +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.Process; import android.provider.Browser; import android.util.Log; import android.util.SparseBooleanArray; import android.view.KeyEvent; Loading Loading @@ -310,6 +311,10 @@ final class WebViewCore { }); } protected String[] populateVisitedLinks() { return Browser.getVisitedHistory(mContext.getContentResolver()); } /** * Shows a prompt to ask the user to set the Geolocation permission state * for the given origin. Loading