2 * Copyright (c) 2019 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License")
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
26 #if !GLIB_CHECK_VERSION(2, 31, 0)
27 #include <glib/gmacros.h>
30 #include "../battery_monitor_stub.h"
31 #include "bm_power_engine.h"
32 #include "bm_private.h"
38 GQuark bm_error_quark(void);
40 int bm_check_privilege_battery(GDBusMethodInvocation *invocation);
42 int initialize_cynara(void);
44 void deinitialize_cynara(void);
46 int bm_calc_individual_consumption(int resource_val, int total_consumption);
48 double bm_calc_individual_mah_consumption(int resource_val, double mah_c);
50 GVariant* bm_marshal_serialized_data(const bm_total_consumption_h data);
52 const char *bm_get_resource_id_string(gint resource_id);
54 int bm_set_dbus_connection_obj(GDBusConnection* conn);
56 GDBusConnection* bm_get_dbus_connection_obj(void);
58 void bm_data_free(gpointer data);
60 void bm_atm_free(gpointer data);
62 void bm_appid_usage_free(appid_usage_s *data);
64 void bm_resourceid_usage_free(resourceid_usage_s *data);
66 long int bm_get_log_time(int bias);
68 void bm_set_free_atm_st2_list(GSList *atm_list);
70 void bm_set_free_atm_st1_list(GSList *atm_list);
72 void bm_set_free_ble_data_handle(bm_bluetooth_st **bt_handle);
74 void bm_set_free_wifi_data_handle(bm_wifi_st **wifi_handle);
76 void bm_set_free_cpu_data_handle(bm_cpu_st **cpu_handle);
78 void bm_set_free_display_data_handle(bm_display_st **display_handle);
80 void bm_set_free_device_network_data_handle(bm_device_network_st **dn_handle);
82 #ifdef DISABLE_FEATURE_DATA_FROM_GPS_PLUGIN
83 void bm_set_free_gps_sensor_data_handle(bm_gps_st **gps_handle);
84 #endif /* DISABLE_FEATURE_DATA_FROM_GPS_PLUGIN */
86 void bm_set_free_data_handles(bm_feature_data_h* data_h);
88 void bm_set_free_gslist_appid_map(GSList *list);
93 #endif /* __BM_UTIL_H__ */