Bug 10785 - Android.Hardware.SensorType enum missing values
Summary: Android.Hardware.SensorType enum missing values
Status: VERIFIED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.2.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2013-02-28 18:53 UTC by Bryan Moulton
Modified: 2013-05-13 23:00 UTC (History)
2 users (show)

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

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 or GitHub 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:
VERIFIED INVALID

Description Bryan Moulton 2013-02-28 18:53:09 UTC
Android.Hardware.SensorType.LinearAcceleration exists in the docs API, but not in the Android runtime library.
Comment 1 Peter Collins 2013-05-13 18:59:22 UTC
Googles documentation [1], as well as our own [2], suggests we are missing a few values for this enum.
Inspecting the assembly browser for this enum displays the following [0].

Missing enum values:
> AmbientTemperature (Temperature was deprecated in API 14)
> Gravity
> LinearAcceleration
> RelativeHumidity
> RotationVector


[0]: public enum SensorType
	{
		Accelerometer = 1,
		All = -1,
		Gyroscope = 4,
		Light,
		MagneticField = 2,
		Orientation,
		Pressure = 6,
		Proximity = 8,
		Temperature = 7
	}

[1]: http://developer.android.com/reference/android/hardware/Sensor.html
[2]: http://androidapi.xamarin.com/?link=T%3aAndroid.Hardware.SensorType

Environment Details:
OSX 10.8.3
X.S. 4.0.5 -  5c86fd4a
X.A. 4.6.04000 (03814ac5)
Mono 2.10.12 (mono-2-10/c9b270d)
Comment 2 Jonathan Pryor 2013-05-13 22:29:50 UTC
Sensor.TYPE_GRAVITY, Sensor.TYPE_AMBIENT_TEMPERATURE, Sensor.TYPE_LINEAR_ACCELERATION, Sensor.TYPE_RELATIVE_HUMIDITY, and Sensor.TYPE_ROTATION_VECTOR are all on the Android.Hardware.SensorType enum.

The mapping was done in monodroid/c2023f98, though eno didn't state why he chose the SensorType enum for those values.
Comment 3 Peter Collins 2013-05-13 22:41:59 UTC
@jonp I can't seem to find these values on the Android.Hardware.SensorType enum in our current stable (bs1 - 03814ac5), or the current HEAD of master (640c9871). What branch did this commit(c2023f98) land on?
Comment 4 Jonathan Pryor 2013-05-13 22:49:48 UTC
monodroid/c2023f98 is on master, Mon Nov 21 00:20:35 2011.

18 months ago.

They're also listed in the online docs:

http://androidapi.xamarin.com/?link=T%3aAndroid.Hardware.SensorType

_All_ of the "missing" values are listed there:

> AmbientTemperature (Temperature was deprecated in API 14)
> Gravity
> LinearAcceleration
> RelativeHumidity
> RotationVector

However, those enum values are API-level dependent, e.g. SensorType.Gravity will only be present when $(TargetFrameworkVersion) is >= API-9 (Android v2.3+), SensorType.AmbientTemperature is only present in Android v4.0+, etc.

What's your $(TargetFrameworkVersion) set to?
Comment 5 Peter Collins 2013-05-13 23:00:26 UTC
That would be my issue. I didn't realize these were API level specific, sorry about that.