diff options
-rw-r--r-- | api/current.xml | 11 | ||||
-rw-r--r-- | core/java/android/provider/Browser.java | 26 | ||||
-rw-r--r-- | core/java/android/provider/Settings.java | 14 | ||||
-rw-r--r-- | core/java/android/webkit/WebViewCore.java | 5 |
4 files changed, 56 insertions, 0 deletions
diff --git a/api/current.xml b/api/current.xml index b5352d111deb..9de4797486fa 100644 --- a/api/current.xml +++ b/api/current.xml @@ -118785,6 +118785,17 @@ visibility="public" > </field> +<field name="ACTION_PRIVACY_SETTINGS" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.settings.PRIVACY_SETTINGS"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="ACTION_QUICK_LAUNCH_SETTINGS" type="java.lang.String" transient="false" diff --git a/core/java/android/provider/Browser.java b/core/java/android/provider/Browser.java index 028d3d7b2d09..4600b49c3b82 100644 --- a/core/java/android/provider/Browser.java +++ b/core/java/android/provider/Browser.java @@ -274,6 +274,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 * of them. This is used to keep our history table to a diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 8d10fde39329..e3fc72d8ee60 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -148,6 +148,20 @@ public final class Settings { "android.settings.SECURITY_SETTINGS"; /** + * Activity Action: Show settings to allow configuration of privacy options. + * <p> + * In some cases, a matching Activity may not exist, so ensure you + * safeguard against this. + * <p> + * Input: Nothing. + * <p> + * Output: Nothing. + */ + @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) + public static final String ACTION_PRIVACY_SETTINGS = + "android.settings.PRIVACY_SETTINGS"; + + /** * Activity Action: Show settings to allow configuration of Wi-Fi. * <p> diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index c87e5a591573..f617401f5e3e 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -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; @@ -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. |