Check if the feature key is supported at AutoRotationSensor. (#2068)
authorMuHong Byun <mh.byun@samsung.com>
Mon, 5 Oct 2020 05:54:36 +0000 (14:54 +0900)
committerGitHub <noreply@github.com>
Mon, 5 Oct 2020 05:54:36 +0000 (14:54 +0900)
* AutoRotationSensor is an algorithmic sensor, whether it is supported or not must be determined through the key.

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
src/Tizen.Sensor/Tizen.Sensor/Plugins/AutoRotationSensor.cs

index 4c77232..c1d567e 100644 (file)
@@ -71,6 +71,10 @@ namespace Tizen.Sensor
         /// </param>
         public AutoRotationSensor(uint index = 0) : base(index)
         {
+            if (!IsSupported)
+            {
+                throw new NotSupportedException("Not Supported: " + "AutoRotationSensor is not supported");
+            }
             Log.Info(Globals.LogTag, "Creating AutoRotationSensor object");
         }