[WatchApplication] Add feature key 26/150626/9 preview1-00249
authorSukHyung, Kang <shine.kang@samsung.com>
Mon, 18 Sep 2017 05:56:11 +0000 (14:56 +0900)
committerSukHyung Kang <shine.kang@samsung.com>
Mon, 25 Sep 2017 09:00:32 +0000 (09:00 +0000)
Change-Id: I8da40b64adcd7a4b88802f9ad261fdff7a3f1d02
Signed-off-by: SukHyung, Kang <shine.kang@samsung.com>
src/Tizen.Applications.WatchApplication/Interop/Interop.Watch.cs
src/Tizen.Applications.WatchApplication/Tizen.Applications.WatchApplication.csproj [changed mode: 0644->0755]
src/Tizen.Applications.WatchApplication/Tizen.Applications.WatchApplication.sln
src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchApplication.cs
src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchTime.cs

index b4ffa33..2177e6e 100755 (executable)
@@ -39,6 +39,7 @@ internal static partial class Interop
             OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory,
             InvalidContext = -0x01100000 | 0x01,
             NoSuchFile = Tizen.Internals.Errors.ErrorCode.NoSuchFile,
+            NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported,
             AlreadyRunning = Tizen.Internals.Errors.ErrorCode.AlreadyInProgress
         }
 
@@ -153,6 +154,5 @@ internal static partial class Interop
 
         [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_region_format")]
         internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetRegionFormat(IntPtr handle, out string region);
-
     }
-}
+}
\ No newline at end of file
old mode 100644 (file)
new mode 100755 (executable)
index e56b74e..d0d923b
@@ -7,6 +7,7 @@
   <ItemGroup>
     <ProjectReference Include="..\Tizen.Applications.Common\Tizen.Applications.Common.csproj" />
     <ProjectReference Include="..\ElmSharp\ElmSharp.csproj" />
+    <ProjectReference Include="..\Tizen.System.Information\Tizen.System.Information.csproj" />
   </ItemGroup>
 
 </Project>
index 63347eb..9ede788 100755 (executable)
@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
-VisualStudioVersion = 15.0.26430.12
+VisualStudioVersion = 15.0.26730.10
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.WatchApplication", "Tizen.Applications.WatchApplication.csproj", "{8BF860DC-DCBC-4889-938F-7515C5282D95}"
 EndProject
@@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common",
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{66EC3D92-AD41-4906-A1A9-3C414B2107F5}"
 EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{F3138394-755D-4055-9561-999823C76BD2}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Any CPU = Debug|Any CPU
@@ -39,8 +41,15 @@ Global
                {66EC3D92-AD41-4906-A1A9-3C414B2107F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
                {66EC3D92-AD41-4906-A1A9-3C414B2107F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
                {66EC3D92-AD41-4906-A1A9-3C414B2107F5}.Release|Any CPU.Build.0 = Release|Any CPU
+               {F3138394-755D-4055-9561-999823C76BD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+               {F3138394-755D-4055-9561-999823C76BD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+               {F3138394-755D-4055-9561-999823C76BD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+               {F3138394-755D-4055-9561-999823C76BD2}.Release|Any CPU.Build.0 = Release|Any CPU
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
        EndGlobalSection
+       GlobalSection(ExtensibilityGlobals) = postSolution
+               SolutionGuid = {C24ED662-71DD-4A20-8F6E-C0A16FC8DE1C}
+       EndGlobalSection
 EndGlobal
index 43cdbca..b02f1a4 100755 (executable)
@@ -159,8 +159,10 @@ namespace Tizen.Applications
         /// Gets the current time
         /// </summary>
         /// <returns>WatchTime</returns>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to get current time because of invalid parameter.</exception>
         /// <exception cref="OutOfMemoryException">Thrown when failed to get current time because memory is not enough.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -191,6 +193,8 @@ namespace Tizen.Applications
                     throw new InvalidOperationException("Failed to get current time. err : " + err);
                 else if (err == Interop.Watch.ErrorCode.OutOfMemory)
                     throw new OutOfMemoryException("Failed to get current time. err : " + err);
+                else if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to get current time. err : " + err);
             }
             return new WatchTime(handle);
         }
@@ -199,7 +203,9 @@ namespace Tizen.Applications
         /// Gets the type of periodic ambient tick.
         /// </summary>
         /// <returns>AmbientTickType</returns>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to get ambient tick type.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -227,7 +233,10 @@ namespace Tizen.Applications
 
             if(err != Interop.Watch.ErrorCode.None)
             {
-                throw new InvalidOperationException("Failed to get ambient tick type. err : " + err);
+                if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to get ambient tick type. err : " + err);
+                else
+                    throw new InvalidOperationException("Failed to get ambient tick type. err : " + err);
             }
 
             return ambientTickType;
@@ -239,7 +248,9 @@ namespace Tizen.Applications
         /// If SetAmbientTickType is not called, OnAmbientTick will be called every minute.
         /// </summary>
         /// <param name="ambientTickType">the type of ambient tick</param>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to set ambient tick type.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -264,7 +275,10 @@ namespace Tizen.Applications
 
             if(err != Interop.Watch.ErrorCode.None)
             {
-                throw new InvalidOperationException("Failed to set ambient tick type. err : " + err);
+                if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to set ambient tick type. err : " + err);
+                else
+                    throw new InvalidOperationException("Failed to set ambient tick type. err : " + err);
             }
         }
 
@@ -275,7 +289,9 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="ticks">Ticks the number of ticks per given resolution type</param>
         /// <param name="type">Type of the resolution type</param>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to set time tick frequency.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -300,7 +316,10 @@ namespace Tizen.Applications
 
             if (err != Interop.Watch.ErrorCode.None)
             {
-                throw new InvalidOperationException("Failed to set time tick frequency. err : " + err);
+                if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to set time tick frequency. err : " + err);
+                else
+                    throw new InvalidOperationException("Failed to set time tick frequency. err : " + err);
             }
         }
 
@@ -309,7 +328,9 @@ namespace Tizen.Applications
         /// </summary>
         /// <param name="ticks">Ticks the number of ticks per given resolution type</param>
         /// <param name="type">Type of the resolution type</param>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
         /// <exception cref="InvalidOperationException">Thrown when failed to get time tick frequency.</exception>
+        /// <exception cref="NotSupportedException">Thrown when the method is not supported.</exception>
         /// <example>
         /// <code>
         /// class MyApp : WatchApplication
@@ -336,7 +357,10 @@ namespace Tizen.Applications
 
             if (err != Interop.Watch.ErrorCode.None)
             {
-                throw new InvalidOperationException("Failed to get time tick frequency. err : " + err);
+                if (err == Interop.Watch.ErrorCode.NotSupported)
+                    throw new NotSupportedException("Failed to get time tick frequency. err : " + err);
+                else
+                    throw new InvalidOperationException("Failed to get time tick frequency. err : " + err);
             }
         }
     }
index 94ce435..e39434c 100755 (executable)
@@ -34,6 +34,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of year
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int Year
         {
             get
@@ -43,7 +45,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Year err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get Year. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get Year err : " + err);
                 }
                 return year;
             }
@@ -52,6 +57,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information fo month
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int Month
         {
             get
@@ -61,7 +68,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Month err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get Month. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get Month err : " + err);
                 }
                 return month;
             }
@@ -70,6 +80,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of day
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int Day
         {
             get
@@ -79,7 +91,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Day err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get Day. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get Day err : " + err);
                 }
                 return day;
             }
@@ -88,6 +103,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of day of week
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int DayOfWeek
         {
             get
@@ -97,7 +114,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Second err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get DayOfWeek. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get DayOfWeek err : " + err);
                 }
                 return dayOfWeek;
             }
@@ -106,6 +126,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of hour
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int Hour
         {
             get
@@ -115,7 +137,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Hour err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get Hour. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get Hour err : " + err);
                 }
                 return hour;
             }
@@ -124,6 +149,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of hour for 24 hour form
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int Hour24
         {
             get
@@ -133,7 +160,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Hour24 err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get Hour24. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get Hour24 err : " + err);
                 }
                 return hour24;
             }
@@ -142,6 +172,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of Minute
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int Minute
         {
             get
@@ -151,7 +183,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Minute err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get Minute. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get Minute err : " + err);
                 }
                 return minute;
             }
@@ -160,6 +195,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of second
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int Second
         {
             get
@@ -169,7 +206,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Second err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get Second. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get Second err : " + err);
                 }
                 return second;
             }
@@ -178,6 +218,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of millisecond
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public int Millisecond
         {
             get
@@ -187,7 +229,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Second err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get Millisecond. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get Millisecond err : " + err);
                 }
                 return ms;
             }
@@ -196,6 +241,8 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of timezone
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public string TimeZone
         {
             get
@@ -205,7 +252,10 @@ namespace Tizen.Applications
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get Second err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get TimeZone. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get TimeZone err : " + err);
                 }
                 return zone;
             }
@@ -214,19 +264,22 @@ namespace Tizen.Applications
         /// <summary>
         /// The information of UTC time stamp
         /// </summary>
+        /// <feature>http://tizen.org/feature/watch_app</feature>
+        /// <exception cref="NotSupportedException">Thrown when the property is not supported.</exception>
         public DateTime UtcTimestamp
         {
             get
             {
                 long ts = 0;
-
                 Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetUtcTimestamp(_handle, out ts);
 
                 if (err != Interop.Watch.ErrorCode.None)
                 {
-                    Log.Error(LOGTAG, "Failed to get UtcTimestamp err : " + err);
+                    if (err == Interop.Watch.ErrorCode.NotSupported)
+                        throw new NotSupportedException("Failed to get UtcTimestamp. err : " + err);
+                    else
+                        Log.Error(LOGTAG, "Failed to get UtcTimestamp err : " + err);
                 }
-
                 return (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(ts).ToLocalTime();
             }
         }