Skip to content

Commit

Permalink
Merge pull request #38 from nemomobile/adbd
Browse files Browse the repository at this point in the history
[adb] Adapt to the new adbd functionfs. Contributes: JB#30264
  • Loading branch information
philippedeswert committed Jul 2, 2015
2 parents 03020ea + 1edcb57 commit 32776a5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
3 changes: 3 additions & 0 deletions config/dyn-modes/adb_mode.ini
Expand Up @@ -8,8 +8,11 @@ network_interface = rndis0
[options]
sysfs_path = /sys/class/android_usb/android0/functions
sysfs_value = rndis,adb
android_extra_sysfs_path = /sys/class/android_usb/android0/f_ffs/aliases
android_extra_sysfs_value = adb
sysfs_reset_value = none
softconnect_path = /sys/class/android_usb/android0/enable
softconnect = 1
softconnect_disconnect = 0
idProduct = 0A03
dhcp_server = 1
2 changes: 1 addition & 1 deletion configure.ac
@@ -1,4 +1,4 @@
AC_INIT([usb_moded], [0.82.1])
AC_INIT([usb_moded], [0.82.2])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

AM_CONFIG_HEADER([config.h])
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
@@ -1,3 +1,9 @@
usb-moded (0.82.2) unstable; urgency=low

* [adb] Adapt to the new adbd functionfs. Contributes: JB#30264

-- Philippe De Swert <philippe.deswert@jolla.com> Mon, 29 Jun 2015 13:36:05 +0300

usb-moded (0.82.1) unstable; urgency=low

* [config] Clean-up and add function to check for value changes
Expand Down
4 changes: 2 additions & 2 deletions rpm/usb-moded.spec
@@ -1,6 +1,6 @@
Name: usb-moded
Version: 0.70
Release: 0
Version: 0.82
Release: 2
Summary: USB mode controller
Group: System/System Control
License: LGPLv2
Expand Down
22 changes: 12 additions & 10 deletions src/usb_moded-modesetting.c
Expand Up @@ -367,11 +367,22 @@ int set_dynamic_mode(void)
ret = write_to_file(data->softconnect_path, data->softconnect);
}

/* Needs to be called before application post synching so
that the dhcp server has the right config */
if(data->nat || data->dhcp_server)
ret = usb_network_set_up_dhcpd(data);

#ifdef APP_SYNC
/* no need to execute the post sync if there was an error setting the mode */
if(data->appsync && !ret)
activate_sync_post(data->mode_name);
#endif

/* functionality should be enabled, so we can enable the network now */
if(data->network)
{
#ifdef DEBIAN
char command[256];
char command[256];

g_snprintf(command, 256, "ifdown %s ; ifup %s", data->network_interface, data->network_interface);
system(command);
Expand All @@ -381,15 +392,6 @@ int set_dynamic_mode(void)
#endif /* DEBIAN */
}

/* Needs to be called before application post synching so
that the dhcp server has the right config */
if(data->nat || data->dhcp_server)
ret = usb_network_set_up_dhcpd(data);

/* no need to execute the post sync if there was an error setting the mode */
if(data->appsync && !ret)
activate_sync_post(data->mode_name);

#ifdef CONNMAN
if(data->connman_tethering)
connman_set_tethering(data->connman_tethering, TRUE);
Expand Down

0 comments on commit 32776a5

Please sign in to comment.