[MediaContent] Remove deprecated APIs (#4977)
authorHaesu Gwon <haesu.gwon@samsung.com>
Fri, 10 Feb 2023 05:10:11 +0000 (14:10 +0900)
committerGitHub <noreply@github.com>
Fri, 10 Feb 2023 05:10:11 +0000 (14:10 +0900)
* [MediaContent] Remove deprecated APIs

12 files changed:
src/Tizen.Content.MediaContent/Interop/Interop.Filter.cs
src/Tizen.Content.MediaContent/Interop/Interop.Folder.cs
src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs
src/Tizen.Content.MediaContent/Interop/Interop.Storage.cs [deleted file]
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Columns.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/CommandHelper.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Folder.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfo.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/QueryArguments.cs
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Storage.cs [deleted file]
src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/StorageCommand.cs [deleted file]

index d265681..a64ea73 100644 (file)
@@ -38,9 +38,6 @@ internal static partial class Interop
 
         [DllImport(Libraries.MediaContent, EntryPoint = "media_filter_set_order_v2")]
         internal static extern MediaContentError SetOrder(FilterHandle filter, string orderExpression);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_filter_set_storage")]
-        internal static extern MediaContentError SetStorage(FilterHandle filter, string storageId);
     }
 
     internal class FilterHandle : MediaContentCriticalHandle
index af6049e..23c454f 100644 (file)
@@ -41,12 +41,6 @@ internal static partial class Interop
         [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_name")]
         internal static extern MediaContentError GetName(IntPtr folder, out IntPtr folder_name);
 
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_storage_type")]
-        internal static extern MediaContentError GetStorageType(IntPtr folder, out StorageType storage_type);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_storage_id")]
-        internal static extern MediaContentError GetStorageId(IntPtr folder, out IntPtr storage_id);
-
         [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_folder_from_db")]
         internal static extern MediaContentError GetFolderFromDb(string id, out IntPtr folder);
 
index baa7e33..d8a172d 100644 (file)
@@ -23,9 +23,6 @@ internal static partial class Interop
     internal static partial class MediaInfo
     {
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        internal delegate void ThumbnailCompletedCallback(MediaContentError error, string filePath, IntPtr userData);
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         internal delegate void FaceDetectionCompletedCallback(MediaContentError error, int count, IntPtr userData);
 
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
@@ -38,8 +35,6 @@ internal static partial class Interop
         internal static extern MediaContentError BatchInsert(string[] filePathArray, int arrayLength,
             InsertCompletedCallback callback, IntPtr userData = default(IntPtr));
 
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_info_delete_from_db")]
-        internal static extern MediaContentError Delete(string mediaId);
 
         [DllImport(Libraries.MediaContent, EntryPoint = "media_info_destroy")]
         internal static extern MediaContentError Destroy(IntPtr handle);
@@ -135,15 +130,9 @@ internal static partial class Interop
         [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_title")]
         internal static extern MediaContentError GetTitle(MediaInfoHandle mediaInformationHandle, out IntPtr title);
 
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_storage_id")]
-        internal static extern MediaContentError GetStorageId(MediaInfoHandle mediaInformationHandle, out IntPtr storageId);
-
         [DllImport(Libraries.MediaContent, EntryPoint = "media_info_is_drm")]
         internal static extern MediaContentError IsDrm(MediaInfoHandle mediaInformationHandle, out bool isDrm);
 
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_storage_type")]
-        internal static extern MediaContentError GetStorageType(MediaInfoHandle mediaInformationHandle, out StorageType storageType);
-
         [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_media_from_db")]
         internal static extern MediaContentError GetMediaFromDB(string mediaId, out MediaInfoHandle handle);
 
diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Storage.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Storage.cs
deleted file mode 100644 (file)
index c3eb7dc..0000000
+++ /dev/null
@@ -1,54 +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;
-using System.Runtime.InteropServices;
-using Tizen.Content.MediaContent;
-
-internal static partial class Interop
-{
-    internal static class Storage
-    {
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_storage_info_from_db")]
-        internal static extern MediaContentError GetStorageInfoFromDb(string id, out IntPtr storage);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_storage_count_from_db")]
-        internal static extern MediaContentError GetStorageCountFromDb(FilterHandle filter, out int count);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_media_count_from_db")]
-        internal static extern MediaContentError GetMediaCountFromDb(string id, FilterHandle filter, out int count);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_destroy")]
-        internal static extern MediaContentError Destroy(IntPtr storage);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_id")]
-        internal static extern MediaContentError GetId(IntPtr storage, out IntPtr id);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_path")]
-        internal static extern MediaContentError GetPath(IntPtr storage, out IntPtr path);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_type")]
-        internal static extern MediaContentError GetType(IntPtr storage, out StorageType type);
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_foreach_storage_from_db")]
-        internal static extern MediaContentError ForeachStorageFromDb(FilterHandle filter, Common.ItemCallback callback,
-            IntPtr userData = default(IntPtr));
-
-        [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_foreach_media_from_db")]
-        internal static extern MediaContentError ForeachMediaFromDb(string id, FilterHandle filter,
-            Common.ItemCallback callback, IntPtr userData = default(IntPtr));
-    }
-}
index 81066fb..920242c 100644 (file)
@@ -251,19 +251,6 @@ namespace Tizen.Content.MediaContent
         public static string DateRecorded => "MEDIA_RECORDED_DATE";
 
         /// <summary>
-        /// Gets the column name for the copyright of media.
-        /// </summary>
-        /// <value>The column name for the copyright of media.</value>
-        /// <remarks>
-        /// The value type is string.
-        /// </remarks>
-        /// <seealso cref="AudioInfo.Copyright"/>
-        /// <seealso cref="VideoInfo.Copyright"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string Copyright => "MEDIA_COPYRIGHT";
-
-        /// <summary>
         /// Gets the column name for the track number of media.
         /// </summary>
         /// <value>The column name for the track number of media.</value>
@@ -276,67 +263,6 @@ namespace Tizen.Content.MediaContent
         public static string TrackNumber => "MEDIA_TRACK_NUM";
 
         /// <summary>
-        /// Gets the column name for the description of media.
-        /// </summary>
-        /// <value>The column name for the description of media.</value>
-        /// <remarks>
-        /// The value type is string.
-        /// </remarks>
-        /// <seealso cref="MediaInfo.Description"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string Description => "MEDIA_DESCRIPTION";
-
-        /// <summary>
-        /// Gets the column name for the bit rate of media.
-        /// </summary>
-        /// <value>The column name for the bit rate of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// </remarks>
-        /// <seealso cref="AudioInfo.BitRate"/>
-        /// <seealso cref="VideoInfo.BitRate"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string BitRate => "MEDIA_BITRATE";
-
-        /// <summary>
-        /// Gets the column name for the bit per sample of media.
-        /// </summary>
-        /// <value>The column name for the bit per sample of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// </remarks>
-        /// <seealso cref="AudioInfo.BitPerSample"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string BitPerSample => "MEDIA_BITPERSAMPLE";
-
-        /// <summary>
-        /// Gets the column name for the sample rate of media.
-        /// </summary>
-        /// <value>The column name for the sample rate of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// </remarks>
-        /// <seealso cref="AudioInfo.SampleRate"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string SampleRate => "MEDIA_SAMPLERATE";
-
-        /// <summary>
-        /// Gets the column name for the channels of media.
-        /// </summary>
-        /// <value>The column name for the channels of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// </remarks>
-        /// <seealso cref="AudioInfo.Channels"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string Channels => "MEDIA_CHANNEL";
-
-        /// <summary>
         /// Gets the column name for the duration of media.
         /// </summary>
         /// <value>The column name for the duration of media.</value>
@@ -417,32 +343,6 @@ namespace Tizen.Content.MediaContent
         public static string DateTaken => "MEDIA_DATETAKEN";
 
         /// <summary>
-        /// Gets the column name for the orientation of media.
-        /// </summary>
-        /// <value>The column name for the orientation of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// The value should be an integer that is one of the <see cref="MediaContent.Orientation"/> values.
-        /// </remarks>
-        /// <seealso cref="MediaContent.Orientation"/>
-        /// <seealso cref="ImageInfo.Orientation"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string Orientation => "MEDIA_ORIENTATION";
-
-        /// <summary>
-        /// Gets the column name for the rating of media.
-        /// </summary>
-        /// <value>The column name for the rating of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// </remarks>
-        /// <seealso cref="MediaInfo.Rating"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string Rating => "MEDIA_RATING";
-
-        /// <summary>
         /// Gets the column name for the favorite status of media.
         /// </summary>
         /// <value>The column name for the favorite status of media.</value>
@@ -463,67 +363,6 @@ namespace Tizen.Content.MediaContent
         /// <seealso cref="MediaInfo.IsDrm"/>
         /// <since_tizen> 4 </since_tizen>
         public static string IsDrm => "MEDIA_IS_DRM";
-
-        /// <summary>
-        /// Gets the column name for the storage type of media.
-        /// </summary>
-        /// <value>The column name for the storage type of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// The value should be an integer that is one of the <see cref="MediaContent.StorageType"/> values.
-        /// </remarks>
-        /// <seealso cref="MediaInfo.StorageType"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string StorageType => "MEDIA_STORAGE_TYPE";
-
-        /// <summary>
-        /// Gets the column name for the exposure time of media.
-        /// </summary>
-        /// <value>The column name for the exposure time of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// </remarks>
-        /// <seealso cref="ImageInfo.ExposureTime"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string ExposureTime => "MEDIA_EXPOSURE_TIME";
-
-        /// <summary>
-        /// Gets the column name for the FNumber of media.
-        /// </summary>
-        /// <value>The column name for the FNumber of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// </remarks>
-        /// <seealso cref="ImageInfo.FNumber"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string FNumber => "MEDIA_FNUMBER";
-
-        /// <summary>
-        /// Gets the column name for the ISO of media.
-        /// </summary>
-        /// <value>The column name for the ISO of media.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// </remarks>
-        /// <seealso cref="ImageInfo.Iso"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string Iso => "MEDIA_ISO";
-
-        /// <summary>
-        /// Gets the column name for the model of media.
-        /// </summary>
-        /// <value>The column name for the model of media.</value>
-        /// <remarks>
-        /// The value type is string.
-        /// </remarks>
-        /// <seealso cref="ImageInfo.Model"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! This will be deprecated in level 6")]
-        public static string Model => "MEDIA_MODEL";
     }
 
     /// <summary>
@@ -605,19 +444,6 @@ namespace Tizen.Content.MediaContent
         /// <seealso cref="Folder.Name"/>
         /// <since_tizen> 4 </since_tizen>
         public static string Name => "FOLDER_NAME";
-
-        /// <summary>
-        /// Gets the column name for the storage type of folder.
-        /// </summary>
-        /// <value>The column name for the storage type of folder.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// The value should be an integer that is one of the <see cref="MediaContent.StorageType"/> values.
-        /// </remarks>
-        /// <seealso cref="Folder.StorageType"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public static string StorageType => "FOLDER_STORAGE_TYPE";
     }
 
     /// <summary>
@@ -812,55 +638,4 @@ namespace Tizen.Content.MediaContent
         /// <since_tizen> 4 </since_tizen>
         public static string Id => "MEDIA_FACE_ID";
     }
-
-    /// <summary>
-    /// Provides the storage column names that can be used for Select and Count commands.
-    /// </summary>
-    /// <seealso cref="SelectArguments"/>
-    /// <seealso cref="CountArguments"/>
-    /// <seealso cref="QueryArguments.FilterExpression"/>
-    /// <seealso cref="SelectArguments.SortOrder"/>
-    /// <seealso cref="StorageCommand.Count(CountArguments)"/>
-    /// <seealso cref="StorageCommand.Select(SelectArguments)"/>
-    /// <since_tizen> 4 </since_tizen>
-    [Obsolete("Please do not use! this will be deprecated in level 6")]
-    public static class StorageColumns
-    {
-        /// <summary>
-        /// Gets the column name for the ID of storage.
-        /// </summary>
-        /// <value>The column name for the ID of storage.</value>
-        /// <remarks>
-        /// The value type is string.
-        /// </remarks>
-        /// <seealso cref="Storage.Id"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public static string Id => "STORAGE_ID";
-
-        /// <summary>
-        /// Gets the column name for the path of storage.
-        /// </summary>
-        /// <value>The column name for the path of storage.</value>
-        /// <remarks>
-        /// The value type is string.
-        /// </remarks>
-        /// <seealso cref="Storage.Path"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public static string Path => "STORAGE_PATH";
-
-        /// <summary>
-        /// Gets the column name for the type of storage.
-        /// </summary>
-        /// <value>The column name for the type of storage.</value>
-        /// <remarks>
-        /// The value type is integer.
-        /// The value should be an integer that is one of the <see cref="MediaContent.StorageType"/> values.
-        /// </remarks>
-        /// <seealso cref="Storage.Type"/>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public static string Type => "MEDIA_STORAGE_TYPE";
-    }
 }
index b244cf5..e6a49f2 100644 (file)
@@ -180,4 +180,9 @@ namespace Tizen.Content.MediaContent
             }
         }
     }
+
+    static internal class MediaContentLog
+    {
+        internal const string Tag = "Tizen.Content.MediaContent";
+    }
 }
index e3af6eb..9eef8a5 100644 (file)
@@ -28,17 +28,13 @@ namespace Tizen.Content.MediaContent
     /// <since_tizen> 4 </since_tizen>
     public class Folder
     {
-#pragma warning disable CS0618 // Type or member is obsolete
         internal Folder(IntPtr handle)
         {
             Id = InteropHelper.GetString(handle, Interop.Folder.GetFolderId);
             Path = InteropHelper.GetString(handle, Interop.Folder.GetPath);
             Name = InteropHelper.GetString(handle, Interop.Folder.GetName);
-
-            StorageType = InteropHelper.GetValue<StorageType>(handle, Interop.Folder.GetStorageType);
-            StorageId = InteropHelper.GetString(handle, Interop.Folder.GetStorageId);
         }
-#pragma warning restore CS0618 // Type or member is obsolete
+
         internal static Folder FromHandle(IntPtr handle) => new Folder(handle);
 
         /// <summary>
@@ -63,29 +59,10 @@ namespace Tizen.Content.MediaContent
         public string Name { get; }
 
         /// <summary>
-        /// Gets the <see cref="StorageType"/> of the storage that the folder exists.
-        /// </summary>
-        /// <value>The <see cref="StorageType"/> of the storage that the folder exists.</value>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public StorageType StorageType { get; }
-
-        /// <summary>
-        /// Gets the storage ID of the storage that the folder exists.
-        /// </summary>
-        /// <value>The storage ID of the storage that the folder exists.</value>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public string StorageId { get; }
-
-#pragma warning disable CS0618 // Type or member is obsolete
-        /// <summary>
         /// Returns a string representation of the folder.
         /// </summary>
         /// <returns>A string representation of the current folder.</returns>
         /// <since_tizen> 4 </since_tizen>
-        public override string ToString() =>
-            $"Id={Id}, Name={Name}, Path={Path}, StorageType={StorageType}, StorageId={StorageType}";
-#pragma warning restore CS0618 // Type or member is obsolete
+        public override string ToString() => $"Id={Id}, Name={Name}, Path={Path}";
     }
 }
index 1ad0158..1aa2c45 100644 (file)
@@ -26,7 +26,6 @@ namespace Tizen.Content.MediaContent
     /// <since_tizen> 4 </since_tizen>
     public class MediaInfo
     {
-#pragma warning disable CS0618 // Type or member is obsolete
         internal MediaInfo(Interop.MediaInfoHandle handle)
         {
             Id = InteropHelper.GetString(handle, Interop.MediaInfo.GetMediaId);
@@ -54,12 +53,8 @@ namespace Tizen.Content.MediaContent
             Rating = InteropHelper.GetValue<int>(handle, Interop.MediaInfo.GetRating);
             IsFavorite = InteropHelper.GetValue<bool>(handle, Interop.MediaInfo.GetFavorite);
             Title = InteropHelper.GetString(handle, Interop.MediaInfo.GetTitle);
-            StorageId = InteropHelper.GetString(handle, Interop.MediaInfo.GetStorageId);
             IsDrm = InteropHelper.GetValue<bool>(handle, Interop.MediaInfo.IsDrm);
-
-            StorageType = InteropHelper.GetValue<StorageType>(handle, Interop.MediaInfo.GetStorageType);
         }
-#pragma warning restore CS0618 // Type or member is obsolete
 
         /// <summary>
         /// Gets the ID of media.
@@ -184,14 +179,6 @@ namespace Tizen.Content.MediaContent
         public string Title { get; }
 
         /// <summary>
-        /// Gets the storage ID of the storage that the media is stored on.
-        /// </summary>
-        /// <value>The storage ID of the storage that the media is stored on.</value>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public string StorageId { get; }
-
-        /// <summary>
         /// Gets the value indicating whether the media is DRM-protected.
         /// </summary>
         /// <value>A bool value indicating whether the media is DRM-protected.</value>
@@ -199,14 +186,6 @@ namespace Tizen.Content.MediaContent
         public bool IsDrm { get; }
 
         /// <summary>
-        /// Gets the storage type of the storage that the media is stored on.
-        /// </summary>
-        /// <value>The storage type of the storage that the media is stored on.</value>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public StorageType StorageType { get; }
-
-        /// <summary>
         /// Returns a string representation of the media information.
         /// </summary>
         /// <returns>A string representation of the current media information.</returns>
index d42cf4f..c17b08e 100644 (file)
@@ -872,7 +872,7 @@ namespace Tizen.Content.MediaContent
         /// <exception cref="UnsupportedContentException">
         ///     The thumbnail is not available for the given media.<br/>
         ///     -or-<br/>
-        ///     The media is in the external USB storage (<see cref="MediaInfo.StorageType"/> is <see cref="StorageType.ExternalUsb"/>).
+        ///     The media is in the external USB storage.
         /// </exception>
         /// <since_tizen> 4 </since_tizen>
         [Obsolete("Deprecated since API10; Will be removed in API12. Please use CreateThumbnail instead.")]
@@ -905,7 +905,7 @@ namespace Tizen.Content.MediaContent
         /// <exception cref="UnsupportedContentException">
         ///     The thumbnail is not available for the given media.<br/>
         ///     -or-<br/>
-        ///     The media is in the external USB storage (<see cref="MediaInfo.StorageType"/> is <see cref="StorageType.ExternalUsb"/>).
+        ///     The media is in the external USB storage.
         /// </exception>
         /// <since_tizen> 4 </since_tizen>
         [Obsolete("Deprecated since API10; Will be removed in API12. Please use CreateThumbnail instead.")]
@@ -989,7 +989,7 @@ namespace Tizen.Content.MediaContent
         /// <exception cref="UnsupportedContentException">
         ///     The thumbnail is not available for the given media.<br/>
         ///     -or-<br/>
-        ///     The media is in the external USB storage (<see cref="MediaInfo.StorageType"/> is <see cref="StorageType.ExternalUsb"/>).
+        ///     The media is in the external USB storage.
         /// </exception>
         /// <exception cref="UnauthorizedAccessException">The caller has no required privilege.</exception>
         /// <since_tizen> 10 </since_tizen>
@@ -1102,7 +1102,7 @@ namespace Tizen.Content.MediaContent
         /// <exception cref="UnsupportedContentException">
         ///     Face detection is not available for the given media.<br/>
         ///     -or-<br/>
-        ///     The media is in the external USB storage (<see cref="MediaInfo.StorageType"/> is <see cref="StorageType.ExternalUsb"/>).
+        ///     The media is in the external USB storage.
         /// </exception>
         /// <exception cref="NotSupportedException">The required feature is not supported.</exception>
         /// <since_tizen> 4 </since_tizen>
@@ -1134,11 +1134,6 @@ namespace Tizen.Content.MediaContent
 
             using (handle)
             {
-                if (InteropHelper.GetValue<StorageType>(handle, Interop.MediaInfo.GetStorageType) == StorageType.ExternalUsb)
-                {
-                    throw new UnsupportedContentException("The media is in external usb storage.");
-                }
-
                 if (InteropHelper.GetValue<MediaType>(handle, Interop.MediaInfo.GetMediaType) != MediaType.Image)
                 {
                     throw new UnsupportedContentException("Only image is supported.");
@@ -1162,7 +1157,13 @@ namespace Tizen.Content.MediaContent
                 using (RegisterCancelFaceDetection(cancellationToken, tcs, handle))
                 using (var cbKeeper = ObjectKeeper.Get(GetFaceDetectionCallback(tcs)))
                 {
-                    Interop.MediaInfo.StartFaceDetection(handle, cbKeeper.Target).ThrowIfError("Failed to detect faces");
+                    var ret = Interop.MediaInfo.StartFaceDetection(handle, cbKeeper.Target);
+                    if (ret == MediaContentError.InvalidParameter)
+                    {
+                        throw new UnsupportedContentException("The media is in external usb storage.");
+                    }
+
+                    ret.ThrowIfError("Failed to detect faces");
 
                     return await tcs.Task;
                 }
index 51c4a1f..163b9b8 100644 (file)
@@ -86,30 +86,6 @@ namespace Tizen.Content.MediaContent
             }
         }
 
-        private string _storageId;
-
-        /// <summary>
-        /// Gets or sets the storage ID for the given filter.
-        /// You can use this property when you want to search items only in the specific storage.
-        /// </summary>
-        /// <value>The storage ID to restrict storage to search, or null for all storages.</value>
-        /// <exception cref="ArgumentException"><paramref name="value"/> is a zero-length string, contains only white space.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public string StorageId
-        {
-            get => _storageId;
-            set
-            {
-                if (value != null)
-                {
-                    ValidationUtil.ValidateNotNullOrEmpty(value, nameof(value));
-                }
-
-                _storageId = value;
-            }
-        }
-
         internal static FilterHandle ToNativeHandle(QueryArguments arguments)
         {
             if (arguments == null || arguments.IsEmpty())
@@ -144,10 +120,9 @@ namespace Tizen.Content.MediaContent
             return handle;
         }
 
-#pragma warning disable CS0618 // Type or member is obsolete
         internal virtual bool IsEmpty()
         {
-            return StorageId == null && FilterExpression == null;
+            return FilterExpression == null;
         }
 
         internal virtual void FillHandle(FilterHandle handle)
@@ -157,15 +132,7 @@ namespace Tizen.Content.MediaContent
                 Interop.Filter.SetCondition(handle, FilterExpression, Collation.Default).
                     ThrowIfError("Failed to create filter handle(condition)");
             }
-
-            if (StorageId != null)
-            {
-                Interop.Filter.SetStorage(handle, StorageId).
-                    ThrowIfError("Failed to create filter handle(storage id)"); ;
-            }
         }
-#pragma warning restore CS0618 // Type or member is obsolete
-
     }
 
     /// <summary>
diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Storage.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Storage.cs
deleted file mode 100644 (file)
index 1428229..0000000
+++ /dev/null
@@ -1,70 +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.Content.MediaContent
-{
-    /// <summary>
-    /// Represents the storage information for media.
-    /// </summary>
-    /// <remarks>
-    /// The system generates the storage ID when the external storage is added and manages the media information
-    /// in each of the storage by using the storage ID.
-    /// </remarks>
-    /// <since_tizen> 3 </since_tizen>
-    [Obsolete("Please do not use! this will be deprecated in level 6")]
-    public class Storage
-    {
-        internal Storage(IntPtr handle)
-        {
-            Path = InteropHelper.GetString(handle, Interop.Storage.GetPath);
-            Id = InteropHelper.GetString(handle, Interop.Storage.GetId);
-            Type = InteropHelper.GetValue<StorageType>(handle, Interop.Storage.GetType);
-        }
-
-        internal static Storage FromHandle(IntPtr handle) => new Storage(handle);
-
-        /// <summary>
-        /// Gets the ID of the storage.
-        /// </summary>
-        /// <value>The unique ID of the storage.</value>
-        /// <since_tizen> 3 </since_tizen>
-        public string Id { get; }
-
-        /// <summary>
-        /// Gets the path of the storage.
-        /// </summary>
-        /// <value>The path of the storage.</value>
-        /// <since_tizen> 4 </since_tizen>
-        public string Path { get; }
-
-        /// <summary>
-        /// Gets the type of the storage.
-        /// </summary>
-        /// <value>The type of the storage.</value>
-        /// <since_tizen> 4 </since_tizen>
-        public StorageType Type { get; }
-
-        /// <summary>
-        /// Returns a string representation of the storage.
-        /// </summary>
-        /// <returns>A string representation of the current storage.</returns>
-        /// <since_tizen> 4 </since_tizen>
-        public override string ToString() =>
-            $"Id={Id}, Path={Path}, Type={Type}";
-    }
-}
diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/StorageCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/StorageCommand.cs
deleted file mode 100644 (file)
index 5653731..0000000
+++ /dev/null
@@ -1,224 +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.Content.MediaContent
-{
-    /// <summary>
-    /// Provides the commands to manage external storages in the database.
-    /// </summary>
-    /// <remarks>
-    /// The internal storage is not managed.
-    /// </remarks>
-    /// <seealso cref="Storage"/>
-    /// <since_tizen> 4 </since_tizen>
-    [Obsolete("Please do not use! this will be deprecated in level 6")]
-    public class StorageCommand : MediaCommand
-    {
-        /// <summary>
-        /// Initializes a new instance of the <see cref="StorageCommand"/> class with the specified <see cref="MediaDatabase"/>.
-        /// </summary>
-        /// <param name="database">The <see cref="MediaDatabase"/> that the commands run on.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="database"/> is null.</exception>
-        /// <exception cref="ObjectDisposedException"><paramref name="database"/> has already been disposed.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public StorageCommand(MediaDatabase database) : base(database)
-        {
-        }
-
-        /// <summary>
-        /// Retrieves the number of storages.
-        /// </summary>
-        /// <returns>The number of storages.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public int Count() => Count(arguments: null);
-
-        /// <summary>
-        /// Retrieves the number of storages with the <see cref="CountArguments"/>.
-        /// </summary>
-        /// <param name="arguments">The criteria to use to filter. This value can be null.</param>
-        /// <returns>The number of storages filtered.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public int Count(CountArguments arguments)
-        {
-            ValidateDatabase();
-
-            return CommandHelper.Count(Interop.Storage.GetStorageCountFromDb, arguments);
-        }
-
-        /// <summary>
-        /// Retrieves the storage with the specified ID.
-        /// </summary>
-        /// <param name="storageId">The storage ID to select.</param>
-        /// <returns>The <see cref="Storage"/> instance if the matched record was found in the database, otherwise null.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <exception cref="ArgumentNullException"><paramref name="storageId"/> is null.</exception>
-        /// <exception cref="ArgumentException"><paramref name="storageId"/> is a zero-length string, contains only white space.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public Storage Select(string storageId)
-        {
-            ValidateDatabase();
-
-            ValidationUtil.ValidateNotNullOrEmpty(storageId, nameof(storageId));
-
-            IntPtr handle = IntPtr.Zero;
-
-            try
-            {
-                Interop.Storage.GetStorageInfoFromDb(storageId, out handle).ThrowIfError("Failed to query");
-
-                return new Storage(handle);
-            }
-            catch (ArgumentException)
-            {
-                // Native FW returns ArgumentException when there's no matched record.
-                return null;
-            }
-            finally
-            {
-                if (handle != IntPtr.Zero)
-                {
-                    Interop.Storage.Destroy(handle);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Retrieves all the storages.
-        /// </summary>
-        /// <returns>The <see cref="MediaDataReader{TRecord}"/> containing the results.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public MediaDataReader<Storage> Select() => Select(arguments: null);
-
-        /// <summary>
-        /// Retrieves the storages with the <see cref="SelectArguments"/>.
-        /// </summary>
-        /// <param name="arguments">The criteria to use to filter. This value can be null.</param>
-        /// <returns>The <see cref="MediaDataReader{TRecord}"/> containing the results.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public MediaDataReader<Storage> Select(SelectArguments arguments)
-        {
-            ValidateDatabase();
-
-            return CommandHelper.Select(arguments, Interop.Storage.ForeachStorageFromDb, Storage.FromHandle);
-        }
-
-        private bool Exists(string storageId)
-        {
-            ValidateDatabase();
-
-            ValidationUtil.ValidateNotNullOrEmpty(storageId, nameof(storageId));
-
-            return Count(new CountArguments { FilterExpression = $"{StorageColumns.Id}='{storageId}'" }) != 0;
-        }
-
-        /// <summary>
-        /// Retrieves the number of media information of the storage.
-        /// </summary>
-        /// <param name="storageId">The storage ID.</param>
-        /// <returns>The number of media information.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <exception cref="ArgumentNullException"><paramref name="storageId"/> is null.</exception>
-        /// <exception cref="ArgumentException"><paramref name="storageId"/> is a zero-length string, contains only white space.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public int CountMedia(string storageId) => CountMedia(storageId, null);
-
-        /// <summary>
-        /// Retrieves the number of media information of the storage with the <see cref="CountArguments"/>.
-        /// </summary>
-        /// <param name="storageId">The storage ID to query with.</param>
-        /// <param name="arguments">The criteria to use to filter. This value can be null.</param>
-        /// <returns>The number of media information.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <exception cref="ArgumentNullException"><paramref name="storageId"/> is null.</exception>
-        /// <exception cref="ArgumentException"><paramref name="storageId"/> is a zero-length string, contains only white space.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public int CountMedia(string storageId, CountArguments arguments)
-        {
-            if (Exists(storageId) == false)
-            {
-                return 0;
-            }
-
-            return CommandHelper.Count(Interop.Storage.GetMediaCountFromDb, storageId, arguments);
-        }
-
-        /// <summary>
-        /// Retrieves the media information of the storage.
-        /// </summary>
-        /// <param name="storageId">The storage ID.</param>
-        /// <returns>The <see cref="MediaDataReader{TRecord}"/> containing the results.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <exception cref="ArgumentNullException"><paramref name="storageId"/> is null.</exception>
-        /// <exception cref="ArgumentException"><paramref name="storageId"/> is a zero-length string, contains only white space.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public MediaDataReader<MediaInfo> SelectMedia(string storageId) => SelectMedia(storageId, null);
-
-        /// <summary>
-        /// Retrieves the media information of the storage with the <see cref="SelectArguments"/>.
-        /// </summary>
-        /// <param name="storageId">The storage ID.</param>
-        /// <param name="filter">The criteria to use to filter. This value can be null.</param>
-        /// <returns>The <see cref="MediaDataReader{TRecord}"/> containing the results.</returns>
-        /// <exception cref="InvalidOperationException">The <see cref="MediaDatabase"/> is disconnected.</exception>
-        /// <exception cref="ObjectDisposedException">The <see cref="MediaDatabase"/> has already been disposed.</exception>
-        /// <exception cref="MediaDatabaseException">An error occurred while executing the command.</exception>
-        /// <exception cref="ArgumentNullException"><paramref name="storageId"/> is null.</exception>
-        /// <exception cref="ArgumentException"><paramref name="storageId"/> is a zero-length string, contains only white space.</exception>
-        /// <since_tizen> 4 </since_tizen>
-        [Obsolete("Please do not use! this will be deprecated in level 6")]
-        public MediaDataReader<MediaInfo> SelectMedia(string storageId, SelectArguments filter)
-        {
-            if (Exists(storageId) == false)
-            {
-                return new MediaDataReader<MediaInfo>(new MediaInfo[0]);
-            }
-
-            return CommandHelper.SelectMedia(Interop.Storage.ForeachMediaFromDb, storageId, filter);
-        }
-
-    }
-}