2

I am trying to open a specific Settings page in a Chromebook using my Android app (Settings -> Device -> Storage Management -> External storage preferences).

My app reads/writes the USB drive, and I need to ensure that this is enabled. If this is enabled, everything works great, but I need an easy way to point the user to this setting.

If I open chrome://os-settings/storage/externalStoragePreferences in a Chrome browser it takes me to the correct setting.

I've tried using opening in a browser using:

val uri = Uri.parse("http://chrome://ossettings/storage/externalStoragePreferences")

val browserIntent = Intent(Intent.ACTION_VIEW, uri)

startActivity(browserIntent)

This gives a 'site can't be reached' error.

If I try without http - just using chrome://ossettings/storage/externalStoragePreferences as the uri, I get the following error:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.VIEW dat=chrome://os-settings/storage/externalStoragePreferences cmp=org.chromium.arc.intent_helper/.OpenChromeMultideviceSettingsActivity } from ProcessRecord{cc19980 19710:com.simplifieditproducts.picturekeeperconnect/u0a69} (pid=19710, uid=10069) requires com.google.android.apps.multidevice.client.permission.INITIALIZE_SCAN

This is my first time working with Chrome OS, and there doesn't seem to be a lot of documentation available. Any help would greatly be appreciated!

Shawney
  • 143
  • 11
  • Please post the used intent code. – blackapps Apr 14 '20 at 07:38
  • Also post the code for an intent to open a browser to display a certain page. – blackapps Apr 14 '20 at 07:41
  • I updated my question to include the intent code. Thanks! – Shawney Apr 14 '20 at 13:07
  • `This gives a 'site can't be reached' error.`. Who is telling you that? Android? Chrome? Is Chrome started? – blackapps Apr 14 '20 at 13:57
  • `com.google.android.apps.multidevice.client.permission.INITIALIZE_SCAN`. What have you done to obtain that permission? – blackapps Apr 14 '20 at 14:01
  • Yea Chrome is launched, but it won't open the page if the url is prefixed with http. If it's not prefixed with http then it crashes giving that permissions error. I tried adding it to the manifest file, but it made no difference. I also can't find it anywhere in the documentation so I'm not quite sure what it's referencing or how I would properly request it. – Shawney Apr 14 '20 at 14:31
  • So the settings are opened if you type that url (without http://) in the address bar of Crome? Or how do you otherwise open those settings? – blackapps Apr 14 '20 at 15:18
  • Make a html page with a link for your url. Maybe it works. – blackapps Apr 14 '20 at 15:20
  • Thanks for the suggestion. I just tried with an html page and get the webpage about:blank#blocked when I try to open chrome://ossettings/storage/externalStoragePreferences. – Shawney Apr 14 '20 at 19:40

0 Answers0