Bug 46087 - Unable to set Android Manifest permissions
Summary: Unable to set Android Manifest permissions
Status: RESOLVED FIXED
Alias: None
Product: Workbooks & Inspector
Classification: Xamarin
Component: Agent: Android ()
Version: master
Hardware: PC Windows
: --- normal
Target Milestone: 1.0
Assignee: xamarininteractive
URL:
Depends on:
Blocks:
 
Reported: 2016-10-27 21:17 UTC by Mark McLemore
Modified: 2016-11-08 19:33 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Resulting of running WebView in a workbook. (32.43 KB, image/png)
2016-10-27 21:17 UTC, Mark McLemore
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Mark McLemore 2016-10-27 21:17:43 UTC
Created attachment 18254 [details]
Resulting of running WebView in a workbook.

The inability to set Android manifest permissions in a Workbook severely limits the Workbook content we can write. For example, I'm trying to write a Workbook for Android WebView (which requires INTERNET permissions). I have the following code in a workbook:

  using Android.App;
  using Android.Widget;
  using Android.OS;
  using Android.Webkit;

  var rootActivity = StartedActivities.First ();
  var layout = new LinearLayout (rootActivity);
  layout.Orientation = Orientation.Vertical;
  rootActivity.SetContentView(layout);

  WebView myWebView = new WebView (rootActivity);
  layout.AddView (myWebView);
  myWebView.Settings.JavaScriptEnabled = true;
  myWebView.LoadUrl ("http://www.google.com");

Running this code in a workbook produces the ERR_NAME_NOT_RESOLVED error (see screenshot) because of the lack of Internet permissions.  (This is true regardless of which version of Xamarin.Workbook I try.) As a possible workaround, perhaps INTERNET permission can be enabled by default?
Comment 2 Mark McLemore 2016-10-31 17:27:30 UTC
Tom O. and I put together a list of the permissions that we think could be used by Android Workbooks (and therefore should by enabled default):

INTERNET
ACCESS_COURSE_LOCATION
ACCESS_FINE_LOCATION
ACCESS_NETWORK_STATE
BIND_NOTIFICATION_LISTENER_SERVICE
READ_EXTERNAL_STORAGE
READ_LOGS
RECEIVE_BOOT_COMPLETED
WRITE_EXTERNAL_STORAGE
WRITE_SECURE_SETTINGS
WRITE_SETTINGS
RECORD_AUDIO
MODIFY_AUDIO_SETTINGS
CAMERA
READ_CONTACTS
WRITE_CONTACTS
SET_ALARM
SET_WALLPAPER
USE_FINGERPRINT
Comment 3 Sandy Armstrong [MSFT] 2016-10-31 17:48:54 UTC
Sounds good.
Comment 4 Bojan Rajkovic [MSFT] 2016-11-08 18:54:05 UTC
Fixed in https://github.com/xamarin/inspector/pull/946.
Comment 5 Sandy Armstrong [MSFT] 2016-11-08 19:33:25 UTC
That being said, the original complaint was lack of INTERNET permission, but that permission has always been present.

So this may not fix whatever the original bug was.