Skip to content

Commit

Permalink
[usb_moded] Drop --android-bootup-function option. JB#41748
Browse files Browse the repository at this point in the history
The target is to always have android usb enabled with valid function, so
this workaround is not relevant anymore.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Aug 24, 2018
1 parent 7a386e3 commit 4f53cf4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 48 deletions.
17 changes: 0 additions & 17 deletions src/usb_moded-android.c
Expand Up @@ -178,23 +178,6 @@ bool android_init_values(void)
/* For rndis to be discovered correctly in M$ Windows (vista and later) */
write_to_file("/sys/class/android_usb/f_rndis/wceis", "1");

/* Some devices can have enumeration issues due to incomplete
* configuration on the 1st connect after bootup. Briefly setting
* up for example mass_storage function can be utilized as a
* workaround in such cases. */
if(!usbmoded_init_done_p()) {
const char *function = usbmoded_get_android_bootup_function();
if(function) {
write_to_file(ANDROID0_FUNCTIONS, function);
write_to_file(ANDROID0_ENABLE, "1");
write_to_file(ANDROID0_ENABLE, "0");
}
}

/* Clear functions and enable */
write_to_file(ANDROID0_FUNCTIONS, "none");
write_to_file(ANDROID0_ENABLE, "1");

EXIT:
return android_in_use();
}
Expand Down
30 changes: 1 addition & 29 deletions src/usb_moded.c
Expand Up @@ -203,9 +203,6 @@ void usbmoded_set_charger_connected (bool state);

// ----------------------------------------------------------------
// internal movements
// ...
const char *usbmoded_get_android_bootup_function (void);
void usbmoded_set_android_bootup_function (const char *function);

static void usbmoded_set_cable_connection_delay (int delay_ms);

Expand Down Expand Up @@ -273,9 +270,6 @@ static bool android_ignore_next_udev_disconnect_event = false;
static bool systemd_notify = false;
#endif

/** Optional android usb function to setup during bootup */
static gchar *android_bootup_function = 0;

/** Currently allowed cable detection delay
*/
int usbmoded_cable_connection_delay = CABLE_CONNECTION_DELAY_DEFAULT;
Expand Down Expand Up @@ -888,26 +882,6 @@ void usbmoded_set_charger_connected(bool state)
return;
}

/** Get android usb function to setup during bootup
*
* @returns function name, or NULL if no function was requested
*/
const char *usbmoded_get_android_bootup_function(void)
{
return android_bootup_function;
}

/** Set android usb function to setup during bootup
*
* @param function usb function name, or NULL
*/
void usbmoded_set_android_bootup_function(const char *function)
{
char *value = function ? g_strdup(function) : 0;
g_free(android_bootup_function);
android_bootup_function = value;
}

/** Helper for setting allowed cable detection delay
*
* Used for implementing --max-cable-delay=<ms> option.
Expand Down Expand Up @@ -1787,7 +1761,7 @@ int main(int argc, char* argv[])
break;

case 'b':
usbmoded_set_android_bootup_function(optarg);
log_warning("Deprecated option: --android-bootup-function");
break;

default:
Expand Down Expand Up @@ -1995,8 +1969,6 @@ int main(int argc, char* argv[])
# endif
#endif

usbmoded_set_android_bootup_function(0);

/* Must be done just before exit to make sure no more wakelocks
* are taken and left behind on exit path */
usbmoded_allow_suspend();
Expand Down
2 changes: 0 additions & 2 deletions src/usb_moded.h
Expand Up @@ -115,8 +115,6 @@ bool usbmoded_get_connection_state (void);
void usbmoded_set_usb_connected_state (void);
void usbmoded_set_usb_connected (bool connected);
void usbmoded_set_charger_connected (bool state);
const char *usbmoded_get_android_bootup_function (void);
void usbmoded_set_android_bootup_function (const char *function);
int usbmoded_valid_mode (const char *mode);
gchar *usbmoded_get_mode_list (mode_list_type_t type);
const char *usbmoded_get_usb_module (void);
Expand Down

0 comments on commit 4f53cf4

Please sign in to comment.