Frage

From what I read, I need the bookmarks URI from each browser:

private final Uri CHROME_URI = Uri.parse("content://com.android.chrome.browser/bookmarks");
private final Uri MOZILLA_URI = Uri.parse("content://org.mozilla.firefox.db.browser/bookmarks");
private final Uri OPERA_URI = ?;

I managed to find chrome's bookmarks uri, I have not tested mozilla's bookmarks uri yet, but that seems to be it and as far as opera I did not find anything.

Any thoughts on what it might be?

UPDATE:

I'm using this code:

private final Uri MOZILLA_URI = Uri.parse("content://org.mozilla.firefox.db.browser/bookmarks");
private final String MOZILLA_PACKAGE = "org.mozilla.firefox";

grantUriPermission(MOZILLA_PACKAGE, MOZILLA_URI, Intent.FLAG_GRANT_READ_URI_PERMISSION);

But I get:

java.lang.SecurityException: Permission Denial: reading org.mozilla.firefox.db.BrowserProvider uri content://org.mozilla.firefox.db.browser/bookmarks from pid=3222, uid=10094 requires org.mozilla.firefox.permissions.BROWSER_PROVIDER, or grantUriPermission()

although I requested permission with grantUriPermission().

War es hilfreich?

Lösung

Yes you are right, it will give SecurityException as in manifest of Firefox this permission i.e. org.mozilla.firefox.permissions.BROWSER_PROVIDER is declared with signature protection level, and system will not grant this permission to your application since your application's signature is different from that Firefox signature.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top