Export to GitHub

android-developer-preview - issue #2805

Removed BOOKMARKS_URI from Browser component in android M


Posted on Jul 23, 2015 by Helpful Dog

To expedite resolution of your issue, please provide as much relevant and specific information as possible. This will probably require some work from you. Most reports should include at least the following:

* Which version of the SDK are you using? Android M * Which Android build are you using? (e.g. MPZ44Q)

* What device are you using?

* What steps will reproduce the problem? (Please provide the minimal reproducible test case.) Is there any replacement for BOOKMARKS_URI in android M * What is the expected output?

* What do you see instead?

* Relevant logcat output.

* Optional: Link to any screenshot(s) that demonstrate the issue (shared privately in Drive.) * Optional: Link to captured Android bug report (shared privately in Drive.) * Optional: Link to your APK (either downloadable in Drive or in the Play Store.)

To avoid leaking private information, please share screenshots and downloads only in Google Drive. Share files with android-dev-preview- bugreport@google.com and include only links in your bug reports. Attachments can not be included directly in issue reports.

Comment #1

Posted on Jul 23, 2015 by Helpful Dog

Team,

May I know, what is the reason for removing BOOKMARKS_URI from browser component Is there any replacement for BOOKMARKS_URI in android M

Comment #2

Posted on Jul 23, 2015 by Massive Elephant

Hi, Thank you for reporting this issue. For us to be able to investigate this issue it would be helpful if you could provide the following additional information:

Android build Which Android build are you using? (e.g. KVT49L)

Device used Which device did you use to reproduce this issue?

Steps to reproduce What steps do others need to take in order to reproduce the issue themselves? or is it checked from android developer website?

Expected output What do you expect to occur?

Current output What do you see instead?

if the issue is seen on the device then please do share Screen record or video of the issue having reproduction steps for working case(if working on L) and non working case adb shell screenrecord /sdcard/video.mp4 adb pull /sdcard/video.mp4 . or if it is checked from any android website, then share the link.

The attachements can be shared to the id android-dev-preview-bugreport@google.com, and share the link here.

Comment #3

Posted on Jul 23, 2015 by Massive Elephant

(No comment was entered for this change.)

Comment #4

Posted on Jul 23, 2015 by Helpful Dog

Hi Amrutha,

When I tried to compile my existing project with android-MNC, i am facing compilation errors for BOOKMARKS_URI Property in android.provider.browser compoent. Can you please let me know why this was removed and is there any replacement for this.

Comment #5

Posted on Jul 23, 2015 by Massive Elephant

If you could provide as much information as possible from comment#2, then we can investigate it further in better way.

Comment #6

Posted on Jul 23, 2015 by Helpful Dog

Android build

Android MNC

Device used

Not able to build project. So, this not applicable

Steps to reproduce

Just 1) Create new project with Android-MNC 2) try to acess Browser.BOOKMARKS_URI.

Expected output

There, should not be an any compilation error. looks like Browser component updated

Current output

BOOKMARKS_URI cannot be resolved or is not a field - BOOKMARKS_URI cannot be resolved or is not a field

Comment #7

Posted on Jul 24, 2015 by Massive Elephant

I have tried with the below code snippet

import static android.provider.Browser.BOOKMARKS_URI;

if(Browser.BOOKMARKS_URI.equals(Browser.BOOKMARKS_URI)){ System.out.println("CAN BE ACCESSED"); }

with MNC preview 2 MPZ79M on emulator Nexus 5 Armeabi and x86_64. Also on Nexus 5 Device having MPZ79M

and I am seeing the log : 07-24 10:41:10.335 5746-5746/com.example.amruthavanibid.myapplication I/System.outīš• CAN BE ACCESSED

Neither seeing compilation nor runtime errors.

Please provide additional info on issue reproduction

Comment #8

Posted on Jul 24, 2015 by Helpful Dog

Thanks Amrutha for your reply.

Is your project build taget is :Android-MNC

//project.properties target=android-MNC

And also in API i am seeing it removed. Please check browser component by downloading preview API from http://developer.android.com/preview/download.html#top

/**  
 * @removed
 */
public static final Uri BOOKMARKS_URI = Uri.parse("content://browser/bookmarks");

Comment #9

Posted on Jul 24, 2015 by Massive Elephant

Thanks for the neccessary info given for issue reproduction. The issue is been tracked through bug id 19351071.

Comment #10

Posted on Jul 24, 2015 by Massive Elephant

Comment deleted

Comment #11

Posted on Jul 24, 2015 by Massive Elephant

Issue 2797 has been merged into this issue.

Comment #12

Posted on Jul 24, 2015 by Massive Elephant

Global bookmarks are no longer available. They haven't really done anything for a long time anyway, since browsers these days generally keep their own internal bookmarks data rather than putting them in the global provider. Apps using the global provider should likewise switch to maintaining them internally.

Comment #13

Posted on Aug 5, 2015 by Massive Cat

I just want to bring up that while most fields from android.provider.Browser have been removed the Content Provider is still shipped with Android M Preview 2.

Accessing it will throw a security exception even though the permission is in the manifest: java.lang.SecurityException: Permission Denial: opening provider com.android.browser.provider.BrowserProviderProxy from ProcessRecord{9b5ea73 31158:org.mozilla.firefox_beta/u0a96} (pid=31158, uid=10096) requires com.android.browser.permission.READ_HISTORY_BOOKMARKS or com.android.browser.permission.WRITE_HISTORY_BOOKMARKS

I see that the content provider has been moved to an own project some time ago: https://android.googlesource.com/platform/packages/providers/BookmarkProvider/

But it seems like the permission got lost and is no where defined in the system image of Android M Preview 2.

Actually if you go ahead and define the permission in your own project then you are actually able to access it again (Preview 2):

I'm just wondering whether the content provider will be completely removed in the final image?

Comment #14

Posted on Aug 7, 2015 by Massive Elephant

Comment deleted

Comment #15

Posted on Aug 7, 2015 by Massive Elephant

BookmarkProvider will be included in M in order to avoid crashing old apps which still try to access bookmarks. If you look in BookmarkProvider.java, you'll see it has a bunch of no-op implementations which don't actually provide any bookmarks. Apps targeting M should not try to access bookmarks and should not try to use the old bookmark permissions.

Comment #16

Posted on Sep 28, 2015 by Grumpy Hippo

This must be a mistake, the functionality is key to most security products in the market. Please reconsider.

Comment #17

Posted on Sep 28, 2015 by Quick Bear

I agree

Comment #18

Posted on Sep 30, 2015 by Happy Bird

Same here. This is an important feature.

Comment #19

Posted on Oct 14, 2015 by Quick Rabbit

Doesn't the most common browser - Chrome on Android still use it?

Comment #20

Posted on Oct 23, 2015 by Massive Bear

Try this alternative way for those who still didn't found a way to get browser history:

public static final Uri BOOKMARKS_URI = Uri.parse("content://browser/bookmarks");

Comment #21

Posted on Oct 26, 2015 by Grumpy Monkey

FYI : direct link to the source code of Android M release,

https://android.googlesource.com/platform/packages/providers/BookmarkProvider/+/marshmallow-release/src/com/android/bookmarkstore/BookmarkProvider.java

You can see that the provider is a dummy that return no information :-(

Status: Closed

Labels:
Type-Defect Release-M Defect-19351071