• spiiroin's avatar
    [usb_moded] Refactor entering/leaving usb mode. JB#41748 · 64350689
    spiiroin authored
    Split mode switching to three layers: Tracking cable connection state,
    choosing target mode, and performing required actions to activate
    the chosen mode.
    
    Try to minimize places where layer borders are crossed - which should
    work also as an enabler for moving blocking actions to separate thread
    later on.
    
    Arrange logic in such manner that usb gadget is always configured as
    being able to serve some function - fallback being the dummy mass_storage
    function used for charging.
    
    Deprecate command line options that serve no useful purpose after the
    changes.
    Signed-off-by: spiiroin's avatarSimo Piiroinen <simo.piiroinen@jollamobile.com>
    64350689
usb_moded-dbus.c 33.6 KB