usb_moded
0.86.0+mer57
|
Go to the source code of this file.
Macros | |
#define | USB_MODED_WAKELOCK_STATE_CHANGE "usb_moded_state" |
#define | USB_MODED_WAKELOCK_PROCESS_INPUT "usb_moded_input" |
#define | USB_MODED_SUSPEND_DELAY_DEFAULT_MS 5000 |
#define | USB_MODED_SUSPEND_DELAY_MAXIMUM_MS (USB_MODED_SUSPEND_DELAY_DEFAULT_MS * 2) |
Functions | |
GList * | usbmoded_get_modelist (void) |
void | usbmoded_load_modelist (void) |
void | usbmoded_free_modelist (void) |
const modedata_t * | usbmoded_get_modedata (const char *modename) |
modedata_t * | usbmoded_dup_modedata (const char *modename) |
void | usbmoded_set_cable_connection_delay (int delay_ms) |
int | usbmoded_get_cable_connection_delay (void) |
void | usbmoded_allow_suspend (void) |
void | usbmoded_delay_suspend (void) |
bool | usbmoded_in_usermode (void) |
bool | usbmoded_in_shutdown (void) |
uid_t | usbmoded_get_current_user (void) |
bool | usbmoded_can_export (void) |
bool | usbmoded_init_done_p (void) |
void | usbmoded_set_init_done (bool reached) |
void | usbmoded_probe_init_done (void) |
void | usbmoded_exit_mainloop (int exitcode) |
Copyright (c) 2010 Nokia Corporation. All rights reserved. Copyright (c) 2012 - 2021 Jolla Ltd. Copyright (c) 2020 Open Mobile Platform LLC.
This program is free software; you can redistribute it and/or modify it under the terms of the Lesser GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the Lesser GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file usb_moded.h.
#define USB_MODED_SUSPEND_DELAY_DEFAULT_MS 5000 |
How long usb_moded will delay suspend by default [ms]
Definition at line 53 of file usb_moded.h.
#define USB_MODED_SUSPEND_DELAY_MAXIMUM_MS (USB_MODED_SUSPEND_DELAY_DEFAULT_MS * 2) |
How long usb_moded is allowed to block suspend [ms]
Definition at line 56 of file usb_moded.h.
#define USB_MODED_WAKELOCK_PROCESS_INPUT "usb_moded_input" |
Name of the wakelock usb_moded uses for input processing
Definition at line 50 of file usb_moded.h.
#define USB_MODED_WAKELOCK_STATE_CHANGE "usb_moded_state" |
Name of the wakelock usb_moded uses for temporary suspend delay
Definition at line 47 of file usb_moded.h.
void usbmoded_allow_suspend | ( | void | ) |
Release wakelock acquired via usbmoded_delay_suspend()
Meant to be called on usb-moded exit so that wakelocks are not left behind.
Definition at line 481 of file usb_moded.c.
bool usbmoded_can_export | ( | void | ) |
Check if exposing device data is currently allowed
Definition at line 591 of file usb_moded.c.
void usbmoded_delay_suspend | ( | void | ) |
Block suspend briefly
Meant to be called in situations usb activity might have woken up the device (cable connect while display is off), or could allow device to suspend (cable disconnect while display is off).
Allows usb moded some time to finish asynchronous activity and other processes to receive and process state changes broadcast by usb-moded.
Definition at line 506 of file usb_moded.c.
modedata_t* usbmoded_dup_modedata | ( | const char * | modename | ) |
Lookup and clone dynamic mode data by name
Note: This function is safe to call from worker thread too.
Caller must release the returned object via modedata_free().
modename | Name of mode to lookup |
Definition at line 279 of file usb_moded.c.
void usbmoded_exit_mainloop | ( | int | exitcode | ) |
Request orderly exit from mainloop
Definition at line 664 of file usb_moded.c.
void usbmoded_free_modelist | ( | void | ) |
Free dynamic mode data items
Note: This function should be called only from the main thread.
Definition at line 228 of file usb_moded.c.
int usbmoded_get_cable_connection_delay | ( | void | ) |
Helper for getting allowed cable detection delay
Definition at line 442 of file usb_moded.c.
uid_t usbmoded_get_current_user | ( | void | ) |
Return current user id
If MEEGOLOCK and SAILFISH_ACCESS_CONTROL are selected, returns uid of user session at seat0 / UID_UNKNOWN.
Otherwise always returns 0 (root user).
Definition at line 572 of file usb_moded.c.
const modedata_t* usbmoded_get_modedata | ( | const char * | modename | ) |
Lookup dynamic mode data by name
Note: This function should be called only from the main thread.
modename | Name of mode to lookup |
Definition at line 252 of file usb_moded.c.
GList* usbmoded_get_modelist | ( | void | ) |
Get list of dynamic mode data items
Note: This function should be called only from the main thread.
Definition at line 197 of file usb_moded.c.
bool usbmoded_in_shutdown | ( | void | ) |
Checks if the device is shutting down
Definition at line 549 of file usb_moded.c.
bool usbmoded_in_usermode | ( | void | ) |
Checks if the device is in USER state
Definition at line 533 of file usb_moded.c.
bool usbmoded_init_done_p | ( | void | ) |
Check if system has already been successfully booted up
Definition at line 625 of file usb_moded.c.
void usbmoded_load_modelist | ( | void | ) |
Load dynamic mode data items
Note: This function should be called only from the main thread.
Definition at line 209 of file usb_moded.c.
void usbmoded_probe_init_done | ( | void | ) |
Check whether init-done flag file exists
Definition at line 651 of file usb_moded.c.
void usbmoded_set_cable_connection_delay | ( | int | delay_ms | ) |
Helper for setting allowed cable detection delay
Used for implementing –max-cable-delay=delay_ms option.
Definition at line 422 of file usb_moded.c.
void usbmoded_set_init_done | ( | bool | reached | ) |
Update cached init-done-reached state
Definition at line 633 of file usb_moded.c.