Add a new API to resume the running application 75/144675/1
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 4 Aug 2017 02:59:52 +0000 (11:59 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Thu, 17 Aug 2017 10:55:59 +0000 (19:55 +0900)
Change-Id: Ie8340df1d5284a21524c352fe2fc773c4b9194f8
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs

index 0220424..5438a56 100644 (file)
@@ -245,6 +245,30 @@ namespace Tizen.Applications
         }
 
         /// <summary>
+        /// Resumes the running application.
+        /// </summary>
+        /// <exception cref="ArgumentException">Thrown when failed of invalid argument.</exception>
+        /// <exception cref="UnauthorizedAccessException">Thrown when failed because of permission denied.</exception>
+        /// <exception cref="InvalidOperationException">Thrown when failed because of system error.</exception>
+        /// <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
+        public void Resume()
+        {
+            err = Interop.ApplicationManager.AppManagerResumeApp(_contextHandle);
+            if (err != Interop.ApplicationManager.ErrorCode.None)
+            {
+                switch (err)
+                {
+                    case Interop.ApplicationManager.ErrorCode.InvalidParameter:
+                        throw new ArgumentException("Invalid argument.");
+                    case Interop.ApplicationManager.ErrorCode.PermissionDenied:
+                        throw new UnauthorizedAccessException("Permission denied.");
+                    default:
+                        throw new InvalidOperationException("Invalid Operation.");
+                }
+            }
+        }
+
+        /// <summary>
         /// Releases all resources used by the ApplicationRunningContext class.
         /// </summary>
         public void Dispose()
@@ -266,4 +290,4 @@ namespace Tizen.Applications
             _disposed = true;
         }
     }
-}
\ No newline at end of file
+}