From: hjhun <36876573+hjhun@users.noreply.github.com> Date: Tue, 18 Apr 2023 02:12:52 +0000 (+0900) Subject: [Applications.Common] Add an internal API (#5183) X-Git-Tag: submit/tizen/20230418.151037~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1afa56ebc2d67ac499f6f0f81c4cd26552ed05d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [Applications.Common] Add an internal API (#5183) Adds: - AppControl.UnsetAutoRestart() Signed-off-by: Hwankyu Jhun --- diff --git a/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs b/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs index c0dbfaa6a..eb6986e95 100755 --- a/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs +++ b/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs @@ -169,5 +169,8 @@ internal static partial class Interop [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_window_position")] internal static extern ErrorCode GetWindowPosition(SafeAppControlHandle handle, out int x, out int y, out int w, out int h); + + [DllImport(Libraries.AppControl, EntryPoint = "app_control_unset_auto_restart")] + internal static extern ErrorCode UnsetAutoRestart(); } } diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs index da9bbc25f..193e427ab 100755 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs +++ b/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs @@ -942,6 +942,34 @@ namespace Tizen.Applications } } + /// + /// Unsets the auto restart. + /// + /// + /// The functionality of this method only applies to the caller application. + /// This method is only available for platform level signed applications. + /// + /// Thrown when the permission is denied. + /// Thrown when the memory is insufficient. + /// Thrown when the memory is insufficient. + [EditorBrowsable(EditorBrowsableState.Never)] + public static void UnsetAutoRestart() + { + Interop.AppControl.ErrorCode err = Interop.AppControl.UnsetAutoRestart(); + if (err != Interop.AppControl.ErrorCode.None) + { + switch (err) + { + case Interop.AppControl.ErrorCode.PermissionDenied: + throw new Exceptions.PermissionDeniedException("Permission denied"); + case Interop.AppControl.ErrorCode.OutOfMemory: + throw new Exceptions.OutOfMemoryException("Out of memory"); + default: + throw new InvalidOperationException("err = " + err); + } + } + } + /// /// Gets all default applications. ///