Skip to content
Permalink
Browse files
[charger] do not let devicelock interfere with setting dedicated char…
…ger mode

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Dec 10, 2014
1 parent fe5aa79 commit d223c27cb746b1ce564c2da99a0c43fb4555797c
Showing with 12 additions and 5 deletions.
  1. +12 −5 src/usb_moded.c
@@ -307,6 +307,8 @@ void set_usb_mode(const char *mode)
int export = 1;
#endif

log_debug("Setting %s\n", mode);

/* CHARGING AND FALLBACK CHARGING are always ok to set, so this can be done
before the optional second device lock check */
if(!strcmp(mode, MODE_CHARGING) || !strcmp(mode, MODE_CHARGING_FALLBACK))
@@ -325,6 +327,13 @@ void set_usb_mode(const char *mode)
goto end;
}

/* Dedicated charger mode needs nothing to be done and no user interaction */
if(!strcmp(mode, MODE_CHARGER))
{
ret = 0;
goto end;
}

#ifdef MEEGOLOCK
/* check if we are allowed to export system contents 0 is unlocked */
/* In ACTDEAD export is always ok */
@@ -340,11 +349,9 @@ void set_usb_mode(const char *mode)
}
#endif /* MEEGOLOCK */

log_debug("Setting %s\n", mode);

/* nothing needs to be done for these modes, apart from the
signalling at the end */
if(!strcmp(mode, MODE_ASK) || !strcmp(mode, MODE_CHARGER))
/* nothing needs to be done for this mode but signalling.
Handled here to avoid issues with ask menu and devicelock */
if(!strcmp(mode, MODE_ASK))
{
ret = 0;
goto end;

0 comments on commit d223c27

Please sign in to comment.