Skip to content

Commit

Permalink
[usb-moded] Only report diag mode when started in diag mode with -d. …
Browse files Browse the repository at this point in the history
…Contributes: JB#13491

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Mar 21, 2014
1 parent 22fc744 commit 1fa145d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/usb_moded-modes.h
Expand Up @@ -31,3 +31,4 @@
#define MODE_CHARGER "dedicated_charger"
#define MODE_HOST "host_mode"
#define MODE_CONNECTION_SHARING "connection_sharing"
#define MODE_DIAG "qa_diag_mode"
10 changes: 8 additions & 2 deletions src/usb_moded.c
Expand Up @@ -409,7 +409,7 @@ gchar *get_mode_list(void)

{
/* check dynamic modes */
if(modelist)
if(modelist && !diag_mode)
{
GList *iter;

Expand All @@ -420,6 +420,12 @@ gchar *get_mode_list(void)
modelist_str = g_string_append(modelist_str, ", ");
}
}
else
{
/* diag mode. there is only one active mode */
g_string_append(modelist_str, MODE_DIAG);
return(g_string_free(modelist_str, FALSE));
}
}
/* end with charging mode */
g_string_append(modelist_str, MODE_CHARGING);
Expand Down Expand Up @@ -622,7 +628,7 @@ static void sigint_handler(int signum)
free_mode_list(modelist);
modelist = read_mode_list(0);

send_supported_modes_signal();
send_supported_modes_signal();
}
}

Expand Down

0 comments on commit 1fa145d

Please sign in to comment.