From e98e4e03996c4fd1fdbcff612f90f2a713b41f43 Mon Sep 17 00:00:00 2001 From: Hyihong Chae Date: Thu, 15 Jun 2017 14:10:20 +0900 Subject: fix for security ACR review. Signed-off-by: HyiHong Chae --- Tizen.Network.Mtp/Tizen.Network.Mtp.csproj | 2 +- Tizen.Network.Mtp/Tizen.Network.Mtp/MtpDevice.cs | 16 +++++-- Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManager.cs | 14 +++++-- Tizen.Network.Mtp/Tizen.Network.Mtp/MtpObject.cs | 51 +++++++++++++++-------- Tizen.Network.Mtp/Tizen.Network.Mtp/MtpStorage.cs | 23 +++++++--- packaging/csapi-network-mtp.spec | 2 +- 6 files changed, 77 insertions(+), 31 deletions(-) diff --git a/Tizen.Network.Mtp/Tizen.Network.Mtp.csproj b/Tizen.Network.Mtp/Tizen.Network.Mtp.csproj index 2956854..f9b1038 100644 --- a/Tizen.Network.Mtp/Tizen.Network.Mtp.csproj +++ b/Tizen.Network.Mtp/Tizen.Network.Mtp.csproj @@ -1,7 +1,7 @@  - 1.0.0 + 1.0.1 Samsung Electronics © Samsung Electronics Co., Ltd All Rights Reserved Provides the Mtp API for Tizen .NET diff --git a/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpDevice.cs b/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpDevice.cs index fd62713..20639b7 100644 --- a/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpDevice.cs +++ b/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpDevice.cs @@ -30,8 +30,9 @@ namespace Tizen.Network.Mtp private List _storageList = new List(); /// - /// The manufacturer name. + /// Gets the manufacturer name. /// + /// Manufacture name of device. public string ManufacturerName { get @@ -48,8 +49,9 @@ namespace Tizen.Network.Mtp } /// - /// The model name. + /// Gets the model name. /// + /// Model name of device. public string ModelName { get @@ -66,8 +68,9 @@ namespace Tizen.Network.Mtp } /// - /// The serial number. + /// Gets the serial number. /// + /// Serial number of device. public string SerialNumber { get @@ -84,8 +87,9 @@ namespace Tizen.Network.Mtp } /// - /// The device version. + /// Gets the device version. /// + /// Version number of device. public string DeviceVersion { get @@ -144,6 +148,10 @@ namespace Tizen.Network.Mtp /// Gets the list of storages. /// /// List of storage objects. + /// http://tizen.org/feature/network.mtp + /// Thrown when Mtp is not supported. + /// Thrown when method is failed due to an invalid parameter. + /// Thrown when the method failed due to invalid operation. public IEnumerable GetStorages() { IntPtr storagePtr; diff --git a/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManager.cs b/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManager.cs index 8cde515..b00691c 100644 --- a/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManager.cs +++ b/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManager.cs @@ -23,12 +23,20 @@ namespace Tizen.Network.Mtp /// /// A class for MTP management. It allows applications to use MTP service. /// + /// + /// http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. + /// http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. + /// static public class MtpManager { /// - /// Gets the list of available Secure Element readers. + /// Gets the list of MTP devices. /// - /// List of SmartcardReader objects. + /// List of MtpDevice objects. + /// http://tizen.org/feature/network.mtp + /// Thrown when Mtp is not supported. + /// Thrown when method is failed due to an invalid parameter. + /// Thrown when the method failed due to invalid operation. static public IEnumerable GetDevices() { try @@ -42,7 +50,7 @@ namespace Tizen.Network.Mtp } /// - /// The Activation changed event. + /// MtpStateChanged is raised when the Mtp device state is changed. /// static public event EventHandler MtpStateChanged { diff --git a/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpObject.cs b/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpObject.cs index d129cbf..6982815 100644 --- a/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpObject.cs +++ b/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpObject.cs @@ -30,8 +30,9 @@ namespace Tizen.Network.Mtp private bool disposed = false; /// - /// The file name. + /// Gets the file name. /// + /// File name of object. public string FileName { get @@ -48,8 +49,9 @@ namespace Tizen.Network.Mtp } /// - /// The keywords. + /// Gets the keywords. /// + /// Keywords of object. public string Keywords { get @@ -66,8 +68,9 @@ namespace Tizen.Network.Mtp } /// - /// The association description. + /// Gets the association description. /// + /// Association description of object. public int AssociationDescription { get @@ -83,8 +86,9 @@ namespace Tizen.Network.Mtp } /// - /// The association type. + /// Gets the association type. /// + /// Association type of object. public int AssociationType { get @@ -100,8 +104,9 @@ namespace Tizen.Network.Mtp } /// - /// The size. + /// Gets the size. /// + /// Size of object. public int Size { get @@ -117,8 +122,9 @@ namespace Tizen.Network.Mtp } /// - //TODO /// The parent object handle. + /// Gets the parent object handle. /// + /// Handle of Parent object. public int ParentObjectHandle { get @@ -134,8 +140,9 @@ namespace Tizen.Network.Mtp } /// - //TODO /// The storage. + /// Gets the storage. /// + /// Storage of object. public int Storage { get @@ -151,8 +158,9 @@ namespace Tizen.Network.Mtp } /// - /// The date created + /// Gets the date created. /// + /// Date created of object. public int DateCreated { get @@ -168,8 +176,9 @@ namespace Tizen.Network.Mtp } /// - /// The date modified. + /// Gets the date modified. /// + /// Date modified of object. public int DateModified { get @@ -185,8 +194,9 @@ namespace Tizen.Network.Mtp } /// - /// The file type. + /// Gets the file type. /// + /// File type of object. public MtpFileType FileType { get @@ -202,8 +212,9 @@ namespace Tizen.Network.Mtp } /// - /// The image bit depth. + /// Gets the image bit depth. /// + /// Bit depth of image. public int ImageBitDepth { get @@ -219,8 +230,9 @@ namespace Tizen.Network.Mtp } /// - /// The image pixel width. + /// Gets the image pixel width. /// + /// Pixel width of image. public int ImagePixelWidth { get @@ -236,8 +248,9 @@ namespace Tizen.Network.Mtp } /// - /// The image pixel height. + /// Gets the image pixel height. /// + /// Pixel height of image. public int ImagePixelHeight { get @@ -253,8 +266,9 @@ namespace Tizen.Network.Mtp } /// - /// The thumbnail size. + /// Gets the thumbnail size. /// + /// Size of thumbnail. public int ThumbnailSize { get @@ -270,8 +284,9 @@ namespace Tizen.Network.Mtp } /// - /// The thumbnail file type. + /// Gets the thumbnail file type. /// + /// File type of thumbnail. public int ThumbnailFileType { get @@ -287,8 +302,9 @@ namespace Tizen.Network.Mtp } /// - /// The thumbnail pixel width. + /// Gets the thumbnail pixel width. /// + /// Pixel width of thumbnail. public int ThumbnailPixelWidth { get @@ -304,8 +320,9 @@ namespace Tizen.Network.Mtp } /// - /// The thumbnail pixel height. + /// Gets the thumbnail pixel height. /// + /// Pixel height of thumbnail. public int ThumbnailPixelHeight { get diff --git a/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpStorage.cs b/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpStorage.cs index 6cee673..3f15c6c 100644 --- a/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpStorage.cs +++ b/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpStorage.cs @@ -33,8 +33,9 @@ namespace Tizen.Network.Mtp //private int _objectHandle = 0; /// - /// The description. + /// Gets the description. /// + /// Description of storage. public string Description { get @@ -51,8 +52,9 @@ namespace Tizen.Network.Mtp } /// - /// The free space. + /// Gets the free space. /// + /// Free space of storage. public UInt64 FreeSpace { get @@ -68,8 +70,9 @@ namespace Tizen.Network.Mtp } /// - /// The max capacity. + /// Gets the max capacity. /// + /// Max capacity of storage. public UInt64 MaxCapacity { get @@ -85,8 +88,9 @@ namespace Tizen.Network.Mtp } /// - /// The storage type. + /// Gets the storage type. /// + /// Type of storage. public MtpStorageType StorageType { get @@ -102,8 +106,9 @@ namespace Tizen.Network.Mtp } /// - /// The volume identifier. + /// Gets the volume identifier. /// + /// Volume identifier of stroage. public string VolumeIdentifier { get @@ -169,6 +174,14 @@ namespace Tizen.Network.Mtp /// Gets the list of storages. /// /// List of storage objects. + /// http://tizen.org/feature/network.mtp + /// + /// http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. + /// http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. + /// + /// Thrown when Mtp is not supported. + /// Thrown when method is failed due to an invalid parameter. + /// Thrown when the method failed due to invalid operation. public IEnumerable GetObjectHandles(int parentHandle, MtpFileType fileType) { IntPtr objectPtr; diff --git a/packaging/csapi-network-mtp.spec b/packaging/csapi-network-mtp.spec index e735389..a809150 100644 --- a/packaging/csapi-network-mtp.spec +++ b/packaging/csapi-network-mtp.spec @@ -1,6 +1,6 @@ Name: csapi-network-mtp Summary: Tizen Mtp API for C# -Version: 1.0.0 +Version: 1.0.1 Release: 1 Group: Development/Libraries License: Apache-2.0 -- cgit v1.2.3