Merge remote-tracking branch 'origin/master' into tizen
authorTizenAPI-Bot <tizenapi@samsung.com>
Thu, 7 Sep 2023 15:12:44 +0000 (15:12 +0000)
committerTizenAPI-Bot <tizenapi@samsung.com>
Thu, 7 Sep 2023 15:12:44 +0000 (15:12 +0000)
src/Tizen.Applications.Service/Tizen.Applications.CoreBackend/ServiceCoreBackend.cs
src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs
src/Tizen.Maps/doc/api/Tizen.Maps.md

index bc1a096..dfdf1dd 100755 (executable)
@@ -28,12 +28,14 @@ namespace Tizen.Applications.CoreBackend
         private IntPtr _localeChangedEventHandle = IntPtr.Zero;
         private IntPtr _regionChangedEventHandle = IntPtr.Zero;
         private IntPtr _deviceOrientationChangedEventHandle = IntPtr.Zero;
+        private IntPtr _timeZoneChangedEventHandle = IntPtr.Zero;
         private bool _disposedValue = false;
         private Interop.Service.AppEventCallback _onLowMemoryNative;
         private Interop.Service.AppEventCallback _onLowBatteryNative;
         private Interop.Service.AppEventCallback _onLocaleChangedNative;
         private Interop.Service.AppEventCallback _onRegionChangedNative;
         private Interop.Service.AppEventCallback _onDeviceOrientationChangedNative;
+        private Interop.Service.AppEventCallback _onTimeZoneChangedNative;
 
         public ServiceCoreBackend()
         {
@@ -46,6 +48,7 @@ namespace Tizen.Applications.CoreBackend
             _onLocaleChangedNative = new Interop.Service.AppEventCallback(OnLocaleChangedNative);
             _onRegionChangedNative = new Interop.Service.AppEventCallback(OnRegionChangedNative);
             _onDeviceOrientationChangedNative = new Interop.Service.AppEventCallback(OnDeviceOrientationChangedNative);
+            _onTimeZoneChangedNative = new Interop.Service.AppEventCallback(OnTimeZoneChangedNative);
         }
 
         public override void Exit()
@@ -87,6 +90,12 @@ namespace Tizen.Applications.CoreBackend
                 Log.Error(LogTag, "Failed to add event handler for DeviceOrientationChanged event. Err = " + err);
             }
 
+            err = Interop.Service.AddEventHandler(out _timeZoneChangedEventHandle, AppEventType.TimeZoneChanged, _onTimeZoneChangedNative, IntPtr.Zero);
+            if (err != ErrorCode.None)
+            {
+                Log.Error(LogTag, "Failed to add event handler for TimeZoneChanged event. Err = " + err);
+            }
+
             err = Interop.Service.Main(args.Length, args, ref _callbacks, IntPtr.Zero);
             if (err != ErrorCode.None)
             {
@@ -107,14 +116,17 @@ namespace Tizen.Applications.CoreBackend
                 {
                     Interop.Service.RemoveEventHandler(_lowMemoryEventHandle);
                 }
+
                 if (_lowBatteryEventHandle != IntPtr.Zero)
                 {
                     Interop.Service.RemoveEventHandler(_lowBatteryEventHandle);
                 }
+
                 if (_localeChangedEventHandle != IntPtr.Zero)
                 {
                     Interop.Service.RemoveEventHandler(_localeChangedEventHandle);
                 }
+
                 if (_regionChangedEventHandle != IntPtr.Zero)
                 {
                     Interop.Service.RemoveEventHandler(_regionChangedEventHandle);
@@ -125,6 +137,11 @@ namespace Tizen.Applications.CoreBackend
                     Interop.Service.RemoveEventHandler(_deviceOrientationChangedEventHandle);
                 }
 
+                if (_timeZoneChangedEventHandle != IntPtr.Zero)
+                {
+                    Interop.Service.RemoveEventHandler(_timeZoneChangedEventHandle);
+                }
+
                 _disposedValue = true;
             }
         }
@@ -154,10 +171,11 @@ namespace Tizen.Applications.CoreBackend
             {
                 // Create a SafeAppControlHandle but the ownsHandle is false,
                 // because the appControlHandle will be closed by native appfw after this method automatically.
-                SafeAppControlHandle safeHandle = new SafeAppControlHandle(appControlHandle, false);
-
-                var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;
-                handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(safeHandle)));
+                using (SafeAppControlHandle safeHandle = new SafeAppControlHandle(appControlHandle, false))
+                {
+                    var handler = Handlers[EventType.AppControlReceived] as Action<AppControlReceivedEventArgs>;
+                    handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(safeHandle)));
+                }
             }
         }
 
@@ -186,5 +204,9 @@ namespace Tizen.Applications.CoreBackend
             base.OnDeviceOrientationChangedNative(infoHandle, data);
         }
 
+        protected override void OnTimeZoneChangedNative(IntPtr infoHandle, IntPtr data)
+        {
+            base.OnTimeZoneChangedNative(infoHandle, data);
+        }
     }
 }
index 109c1d7..91babc5 100755 (executable)
@@ -29,7 +29,9 @@ namespace Tizen.Applications
         /// Initializes the ServiceApplication class.
         /// </summary>
         /// <since_tizen> 3 </since_tizen>
+#pragma warning disable CA2000
         public ServiceApplication() : base(new ServiceCoreBackend())
+#pragma warning restore CA2000
         {
         }
 
index d898af7..e131075 100644 (file)
@@ -4,6 +4,9 @@ remarks: *content
 ---
 ## Overview
 
+[!NOTE]
+All maps-service APIs have been deprecated since Tizen 8.0 and will be removed after two releases without any alternatives.
+
 Maps API provides a developer with a set of functions, helping to create Maps aware applications.
 
 Maps API comprises of following features: