* @pre
* @post
*/
-int _uam_enable_low_power_mode(void);
+int _uam_enable_low_power_mode(unsigned int bitmask);
/**
* @brief Disables low-power mode.
* @pre
* @post
*/
-int _uam_disable_low_power_mode(void);
+int _uam_disable_low_power_mode(unsigned int bitmask);
/**
* @brief Gets default service info.
Name: ua-manager
Summary: User awareness manager
-Version: 0.11.6
+Version: 0.11.7
Release: 1
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
return ret;
}
-UAM_EXPORT_API int _uam_enable_low_power_mode(void)
+UAM_EXPORT_API int _uam_enable_low_power_mode(unsigned int bitmask)
{
FUNC_ENTRY;
int ret;
UAM_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
g_array_append_vals(in_param1, &mode, sizeof(gboolean));
+ g_array_append_vals(in_param2, &bitmask, sizeof(unsigned int));
ret = _uam_sync_request(UAM_REQUEST_SET_LOW_POWER_MODE,
in_param1, in_param2, in_param3, in_param4, &out_param);
return ret;
}
-UAM_EXPORT_API int _uam_disable_low_power_mode(void)
+UAM_EXPORT_API int _uam_disable_low_power_mode(unsigned int bitmask)
{
FUNC_ENTRY;
int ret;
UAM_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
g_array_append_vals(in_param1, &mode, sizeof(gboolean));
+ g_array_append_vals(in_param2, &bitmask, sizeof(unsigned int));
ret = _uam_sync_request(UAM_REQUEST_SET_LOW_POWER_MODE,
in_param1, in_param2, in_param3, in_param4, &out_param);
int _uam_core_stop_absence_detection(const char *svc_name, char *sender, unsigned int sensors);
-int _uam_core_set_low_power_mode(gboolean mode);
+int _uam_core_set_low_power_mode(gboolean mode, unsigned int sensors);
int _uam_core_get_detection_window(unsigned int *window);
int _uam_pm_set_registered_devices(GSList *devices);
-int _uam_pm_set_low_power_mode(gboolean mode);
+int _uam_pm_set_low_power_mode(gboolean mode, unsigned int bitmask);
int _uam_pm_set_detection_window(unsigned int detection_window);
return ret;
}
-int _uam_pm_set_low_power_mode(gboolean mode)
+int _uam_pm_set_low_power_mode(gboolean mode, unsigned int bitmask)
{
FUNC_ENTRY;
int id;
for (id = UAS_PLUGIN_ID_BLE; id < UAS_PLUGIN_ID_MAX; id++) {
uam_sensor_plugin_info_t *plugin = plugins[id];
+ unsigned int sensor = _pm_util_uas_plugin_id_to_sensor_bitmask(id);
+
+ if (!(sensor & bitmask))
+ continue;
if (!plugin || !plugin->api || !plugin->api->set_low_power_mode)
continue;
return UAP_STATUS_FAIL;
}
- ret = _uam_pm_set_low_power_mode(FALSE);
+ ret = _uam_pm_set_low_power_mode(FALSE, sensors);
if (UAM_ERROR_NONE != ret) {
UAM_ERR("Failed with error: %s (0x%4.4X)",
_uam_manager_error_to_str(ret), ret);
UAM_ERR("Failed with error: %s (0x%4.4X)",
_uam_manager_error_to_str(ret), ret);
- ret = _uam_pm_set_low_power_mode(TRUE);
+ ret = _uam_pm_set_low_power_mode(TRUE, sensors);
if (UAM_ERROR_NONE != ret)
UAM_ERR("Failed with error: %s (0x%4.4X)",
_uam_manager_error_to_str(ret), ret);
int ret;
UAM_INFO("lpm_mode = %s", ((mode != 0) ? "TRUE" : "FALSE"));
- ret = _uam_pm_set_low_power_mode((mode == 0) ? FALSE : TRUE);
+ ret = _uam_pm_set_low_power_mode((mode == 0) ? FALSE : TRUE, UAM_SENSOR_ALL);
if (UAM_ERROR_NONE != ret)
UAM_ERR("Failed with error: %s (0x%4.4X)",
_uam_manager_error_to_str(ret), ret);
return ret;
}
-int _uam_core_set_low_power_mode(gboolean mode)
+int _uam_core_set_low_power_mode(gboolean mode, unsigned int sensors)
{
FUNC_ENTRY;
int ret;
- ret = _uam_pm_set_low_power_mode(mode);
+ ret = _uam_pm_set_low_power_mode(mode, sensors);
if (UAM_ERROR_NONE != ret) {
UAM_ERR("_uam_pm_set_low_power_mode failed with %s",
_uam_manager_error_to_str(ret));
}
case UAM_REQUEST_SET_LOW_POWER_MODE: {
gboolean mode = FALSE;
+ unsigned int sensors;
__uam_manager_copy_params(in_param1,
&mode, sizeof(gboolean));
+ __uam_manager_copy_params(in_param2,
+ &sensors, sizeof(unsigned int));
- result = _uam_core_set_low_power_mode(mode);
+ result = _uam_core_set_low_power_mode(mode, sensors);
break;
}
case UAM_REQUEST_START_SEARCH_ACTIVE_DEVICES: {