Upgrade libmtp to 'libmtp-1-1-16' Exempt-From-Owner-Approval: Update library Test: build Change-Id: Iaadb56cf6614bb9838b5fa903b8127ffe1708355
diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index b9115f0..0000000 --- a/.cvsignore +++ /dev/null
@@ -1,30 +0,0 @@ -*.tar.gz -Makefile -Makefile.in -aclocal.m4 -autom4te.cache -build-stamp -config.cache -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -configure-stamp -hotplug.sh -libmtp-* -libmtp.pc -libtool -libmtp.sh -stamp-h1 -libmtp.rules -libmtp.usermap -libmtp.fdi -ltmain.sh -.cdtproject -.project -depcomp -install-sh -missing \ No newline at end of file
diff --git a/METADATA b/METADATA new file mode 100644 index 0000000..6be42c5 --- /dev/null +++ b/METADATA
@@ -0,0 +1,14 @@ +name: "libmtp" +description: "A library to access MTP (Media Transfer Protocol) Devices." +third_party { + url { + type: GIT + value: "https://github.com/libmtp/libmtp.git" + } + version: "libmtp-1-1-16" + last_upgrade_date { + year: 2019 + month: 7 + day: 10 + } +}
diff --git a/MODULE_LICENSE_LGPL b/MODULE_LICENSE_LGPL new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/MODULE_LICENSE_LGPL
diff --git a/NOTICE b/NOTICE new file mode 120000 index 0000000..d24842f --- /dev/null +++ b/NOTICE
@@ -0,0 +1 @@ +COPYING \ No newline at end of file
diff --git a/OWNERS b/OWNERS new file mode 100644 index 0000000..bf7de3e --- /dev/null +++ b/OWNERS
@@ -0,0 +1,5 @@ +# Default code reviewers picked from top 3 or more developers. +# Please update this list if you find better candidates. +# [email protected] +# [email protected] [email protected]
diff --git a/src/libmtp.c b/src/libmtp.c index 23bb3d2..c3d9c3a 100644 --- a/src/libmtp.c +++ b/src/libmtp.c
@@ -131,6 +131,7 @@ // This holds the global property mapping table static propertymap_t *g_propertymap = NULL; +static int load_cache_on_demand = 0; /* * Forward declarations of local (static) functions. */ @@ -2583,6 +2584,18 @@ } } +void LIBMTP_Set_Device_Timeout(LIBMTP_mtpdevice_t *device, int milliseconds) +{ + PTP_USB *ptp_usb = (PTP_USB*) device->usbinfo; + set_usb_device_timeout(ptp_usb, milliseconds); +} + +void LIBMTP_Get_Device_Timeout(LIBMTP_mtpdevice_t *device, int *milliseconds) +{ + PTP_USB *ptp_usb = (PTP_USB*) device->usbinfo; + get_usb_device_timeout(ptp_usb, milliseconds); +} + /** * This command gets all handles and stuff by FAST directory retrieveal * which is available by getting all metadata for object @@ -2797,6 +2810,10 @@ return; } + if (load_cache_on_demand) { + return; + } + if (params->objects != NULL) { for (i=0;i<params->nrofobjects;i++) ptp_free_object (¶ms->objects[i]); @@ -4553,6 +4570,10 @@ return retfiles; } +void LIBMTP_Set_Load_Cache_On_Demand(int flag) +{ + load_cache_on_demand = flag; +} /** * This creates a new track metadata structure and allocates memory
diff --git a/src/libmtp.h.in b/src/libmtp.h.in index 89d39d9..9e61089 100644 --- a/src/libmtp.h.in +++ b/src/libmtp.h.in
@@ -58,6 +58,7 @@ #include <stdint.h> /* We use time_t */ #include <time.h> +#include <utime.h> /** * @defgroup types libmtp global type definitions @@ -867,6 +868,9 @@ void LIBMTP_Clear_Errorstack(LIBMTP_mtpdevice_t*); void LIBMTP_Dump_Errorstack(LIBMTP_mtpdevice_t*); +void LIBMTP_Set_Device_Timeout(LIBMTP_mtpdevice_t *device, int milliseconds); +void LIBMTP_Get_Device_Timeout(LIBMTP_mtpdevice_t *device, int *milliseconds); + #define LIBMTP_STORAGE_SORTBY_NOTSORTED 0 #define LIBMTP_STORAGE_SORTBY_FREESPACE 1 #define LIBMTP_STORAGE_SORTBY_MAXSPACE 2 @@ -963,6 +967,8 @@ int LIBMTP_Get_Thumbnail(LIBMTP_mtpdevice_t *, uint32_t const, unsigned char **data, unsigned int *size); +void LIBMTP_Set_Load_Cache_On_Demand(int flag); + /** * @} * @defgroup tracks The track management API.
diff --git a/src/libmtp.sym b/src/libmtp.sym index 20d9195..90cf821 100644 --- a/src/libmtp.sym +++ b/src/libmtp.sym
@@ -1,4 +1,7 @@ LIBMTP_Set_Debug +LIBMTP_Set_Device_Timeout +LIBMTP_Get_Device_Timeout +LIBMTP_Set_Load_Cache_On_Demand LIBMTP_Init LIBMTP_Get_Supported_Devices_List LIBMTP_Detect_Raw_Devices