问题
I am trying to use Android Browser.BOOKMARKS_URI in Android Marshmallow. Until Lollipop, there is a way to read the history from the Chrome Browser using the permission. But in Marshmallow the permission is removed. Does any other alternative available for reading the browser history on a Marshmallow device?
I referred This Official Android Documentation, But not get a clear idea.
Thanks.
回答1:
Due to security reason the browser history read/write are now not accessible by to the app. This step was taken by Google after API >= 23
.
query()
calls hasReadAccess()
, which calls hasPermission("com.android.browser.permission.READ_HISTORY_BOOKMARKS")
, which on API >= M
ignores the permission argument and instead checks for com.android.chrome.permission.READ_WRITE_BOOKMARK_FOLDERS.
This permission is limited to system apps and apps signed with Google's key.
https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser
来源:https://stackoverflow.com/questions/41444771/read-browser-history-in-marshmallow-and-nougat-android