[AudioManager] Remove deprecated symbols (#1395)
authorSangchul Lee <sc11.lee@samsung.com>
Tue, 18 Feb 2020 02:05:47 +0000 (11:05 +0900)
committerGitHub <noreply@github.com>
Tue, 18 Feb 2020 02:05:47 +0000 (11:05 +0900)
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/Tizen.Multimedia/AudioManager/AudioDevice.cs
src/Tizen.Multimedia/AudioManager/AudioDeviceOptions.cs
src/Tizen.Multimedia/AudioManager/AudioDeviceRunningChangedEventArgs.cs [changed mode: 0755->0644]
src/Tizen.Multimedia/AudioManager/AudioDeviceState.cs [deleted file]
src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs [deleted file]
src/Tizen.Multimedia/AudioManager/AudioManager.cs
src/Tizen.Multimedia/Interop/Interop.Device.cs

index bf4ec24..773a04a 100644 (file)
@@ -78,23 +78,6 @@ namespace Tizen.Multimedia
         public AudioDeviceIoDirection IoDirection => _ioDirection;
 
         /// <summary>
-        /// Gets the state of the device.
-        /// </summary>
-        /// <value>The <see cref="AudioDeviceState"/> of the device.</value>
-        /// <since_tizen> 3 </since_tizen>
-        [Obsolete("Deprecated since API level 5. Please use the IsRunning property instead.")]
-        public AudioDeviceState State
-        {
-            get
-            {
-                Interop.AudioDevice.GetDeviceState(Id, out var state).
-                    ThrowIfError("Failed to get the state of the device");
-
-                return state;
-            }
-        }
-
-        /// <summary>
         /// Gets the running state of the device.
         /// </summary>
         /// <value>true if the audio stream of device is running actually; otherwise, false.</value>
index 8a32950..5500757 100644 (file)
@@ -53,18 +53,6 @@ namespace Tizen.Multimedia
         External = 0x0020,
 
         /// <summary>
-        /// Deactivated devices.
-        /// </summary>
-        [Obsolete("Deprecated since API level 5.")]
-        Deactivated = 0x1000,
-
-        /// <summary>
-        /// Activated devices.
-        /// </summary>
-        [Obsolete("Deprecated since API level 5.")]
-        Activated = 0x2000,
-
-        /// <summary>
         /// All devices.
         /// </summary>
         All = 0xFFFF
diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceState.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceState.cs
deleted file mode 100644 (file)
index 85991d4..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-namespace Tizen.Multimedia
-{
-    /// <summary>
-    /// Specifies the audio device states.
-    /// </summary>
-    /// <since_tizen> 3 </since_tizen>
-    [Obsolete("Deprecated since API level 5.")]
-    public enum AudioDeviceState
-    {
-        /// <summary>
-        /// Deactivated state.
-        /// </summary>
-        Deactivated,
-
-        /// <summary>
-        /// Activated state.
-        /// </summary>
-        Activated
-    }
-}
diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs
deleted file mode 100644 (file)
index 34eb612..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-
-namespace Tizen.Multimedia
-{
-    /// <summary>
-    /// Provides data for the <see cref="AudioManager.DeviceStateChanged"/> event.
-    /// </summary>
-    /// <since_tizen> 3 </since_tizen>
-    [Obsolete("Deprecated since API level 5. Please use the AudioDeviceRunningChangedEventArgs class instead.")]
-    public class AudioDeviceStateChangedEventArgs : EventArgs
-    {
-        internal AudioDeviceStateChangedEventArgs(AudioDevice device, AudioDeviceState changedState)
-        {
-            Device = device;
-            State = changedState;
-        }
-
-        /// <summary>
-        /// Gets the device.
-        /// </summary>
-        /// <value>The <see cref="AudioDevice"/>.</value>
-        /// <since_tizen> 3 </since_tizen>
-        public AudioDevice Device { get; }
-
-        /// <summary>
-        /// Gets the state of the device.
-        /// </summary>
-        /// <value>The <see cref="AudioDeviceState"/> of the device.</value>
-        /// <since_tizen> 4 </since_tizen>
-        public AudioDeviceState State { get; }
-    }
-}
index 890c319..2f566bf 100644 (file)
@@ -152,78 +152,6 @@ namespace Tizen.Multimedia
         }
         #endregion
 
-        #region DeviceStateChanged event
-        private static int _deviceStateChangedCallbackId = -1;
-
-#pragma warning disable CS0618 // Type or member is obsolete
-
-        private static Interop.AudioDevice.StateChangedCallback _audioDeviceStateChangedCallback;
-        private static EventHandler<AudioDeviceStateChangedEventArgs> _audioDeviceStateChanged;
-        private static readonly object _audioDeviceStateLock = new object();
-
-        /// <summary>
-        /// Occurs when the state of an audio device changes.
-        /// </summary>
-        /// <since_tizen> 3 </since_tizen>
-        [Obsolete("Deprecated since API level 5. Please use the DeviceRunningStateChanged property instead.")]
-        public static event EventHandler<AudioDeviceStateChangedEventArgs> DeviceStateChanged
-        {
-            add
-            {
-                if (value == null)
-                {
-                    return;
-                }
-
-                lock (_audioDeviceStateLock)
-                {
-                    if (_audioDeviceStateChanged == null)
-                    {
-                        RegisterDeviceStateChangedEvent();
-                    }
-                    _audioDeviceStateChanged += value;
-                }
-            }
-            remove
-            {
-                if (value == null)
-                {
-                    return;
-                }
-
-                lock (_audioDeviceStateLock)
-                {
-                    if (_audioDeviceStateChanged == value)
-                    {
-                        UnregisterDeviceStateChangedEvent();
-                    }
-                    _audioDeviceStateChanged -= value;
-                }
-            }
-        }
-
-        private static void RegisterDeviceStateChangedEvent()
-        {
-            _audioDeviceStateChangedCallback = (device, changedState, _) =>
-            {
-                _audioDeviceStateChanged?.Invoke(null,
-                    new AudioDeviceStateChangedEventArgs(new AudioDevice(device), changedState));
-            };
-
-            Interop.AudioDevice.AddDeviceStateChangedCallback(AudioDeviceOptions.All,
-                _audioDeviceStateChangedCallback, IntPtr.Zero, out _deviceStateChangedCallbackId).
-                ThrowIfError("Failed to add device state changed event");
-        }
-
-#pragma warning restore CS0618 // Type or member is obsolete
-
-        private static void UnregisterDeviceStateChangedEvent()
-        {
-            Interop.AudioDevice.RemoveDeviceStateChangedCallback(_deviceStateChangedCallbackId).
-                ThrowIfError("Failed to remove device state changed event");
-        }
-        #endregion
-
         #region DeviceRunningStateChanged event
         private static int _deviceRunningChangedCallbackId = -1;
         private static Interop.AudioDevice.RunningChangedCallback _audioDeviceRunningChangedCallback;
index 00e0459..17f92f3 100755 (executable)
@@ -26,11 +26,6 @@ namespace Tizen.Multimedia
             [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
             internal delegate void ConnectionChangedCallback(IntPtr device, bool isConnected, IntPtr userData);
 
-#pragma warning disable CS0618 // Type or member is obsolete
-            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-            internal delegate void StateChangedCallback(IntPtr device, AudioDeviceState changedState, IntPtr userData);
-#pragma warning restore CS0618 // Type or member is obsolete
-
             [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
             internal delegate void RunningChangedCallback(IntPtr device, bool isRunning, IntPtr userData);
 
@@ -56,11 +51,6 @@ namespace Tizen.Multimedia
             [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_name")]
             internal static extern int GetDeviceName(IntPtr device, out IntPtr name);
 
-#pragma warning disable CS0618 // Type or member is obsolete
-            [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_state_by_id")]
-            internal static extern AudioManagerError GetDeviceState(int deviceId, out AudioDeviceState state);
-#pragma warning restore CS0618 // Type or member is obsolete
-
             [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_is_device_running_by_id")]
             internal static extern AudioManagerError IsDeviceRunning(int deviceId, out bool isRunning);
 
@@ -101,13 +91,6 @@ namespace Tizen.Multimedia
             [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_connection_changed_cb")]
             internal static extern AudioManagerError RemoveDeviceConnectionChangedCallback(int id);
 
-            [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_state_changed_cb")]
-            internal static extern AudioManagerError AddDeviceStateChangedCallback(AudioDeviceOptions deviceMask,
-                StateChangedCallback callback, IntPtr userData, out int id);
-
-            [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_state_changed_cb")]
-            internal static extern AudioManagerError RemoveDeviceStateChangedCallback(int id);
-
             [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_running_changed_cb")]
             internal static extern AudioManagerError AddDeviceRunningChangedCallback(AudioDeviceOptions deviceMask,
                 RunningChangedCallback callback, IntPtr userData, out int id);