Commit 931f01a2 authored by spiiroin's avatar spiiroin

[appsync] Remove unneeded tag based enumeration trigger filtering

Since enumeration timers are not left running anymore when enumeration
occurs / appsync is canceled, the increment at activate_sync() and
check at enumerate_usb() based tag code filtering is no longer needed.

Remove the tag variables and code related to them.
Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
parent 206c9573
......@@ -49,8 +49,6 @@ static void cancel_enumerate_usb_timer(void);
static GList *sync_list = NULL;
static guint enumerate_usb_id = 0;
static unsigned sync_tag = 0;
static unsigned enum_tag = 0;
static struct timeval sync_tv;
#ifdef APP_SYNC_DBUS
static int no_dbus = 0;
......@@ -199,8 +197,8 @@ int activate_sync(const char *mode)
log_debug("activate sync");
/* Bump tag, see enumerate_usb() */
++sync_tag; gettimeofday(&sync_tv, 0);
/* Get start of activation timestamp */
gettimeofday(&sync_tv, 0);
if( sync_list == 0 )
{
......@@ -422,30 +420,15 @@ static void enumerate_usb(void)
/* Stop the timer in case of explicit enumeration call */
cancel_enumerate_usb_timer();
/* We arrive here twice: when app sync is done
* and when the app sync timeout gets triggered.
* The tags are used to filter out these repeats.
*/
if( enum_tag == sync_tag )
{
log_debug("ignoring enumeration trigger");
}
else
{
enum_tag = sync_tag;
/* Debug: how long it took from sync start to get here */
gettimeofday(&tv, 0);
timersub(&tv, &sync_tv, &tv);
log_debug("sync to enum: %.3f seconds", tv.tv_sec + tv.tv_usec * 1e-6);
/* Debug: how long it took from sync start to get here */
gettimeofday(&tv, 0);
timersub(&tv, &sync_tv, &tv);
log_debug("sync to enum: %.3f seconds", tv.tv_sec + tv.tv_usec * 1e-6);
#ifdef APP_SYNC_DBUS
/* remove dbus service */
usb_moded_appsync_cleanup();
/* remove dbus service */
usb_moded_appsync_cleanup();
#endif /* APP_SYNC_DBUS */
}
}
static void appsync_stop_apps(int post)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment