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.
27 #if !GLIB_CHECK_VERSION(2, 31, 0)
28 #include <glib/gmacros.h>
31 #include <app_context.h>
32 #include <app_manager_extension.h>
34 #include "../battery_monitor_stub.h"
35 #include "bm_power_engine.h"
36 #include "bm_private.h"
42 GQuark bm_error_quark(void);
44 int bm_check_privilege_battery(GDBusMethodInvocation *invocation);
46 int initialize_cynara(void);
48 void deinitialize_cynara(void);
50 int bm_calc_individual_consumption(int resource_val, int total_consumption);
52 double bm_calc_individual_mah_consumption(int resource_val, double mah_c);
54 GVariant* bm_marshal_serialized_data(const bm_total_consumption_h data);
56 const char *bm_get_resource_id_string(gint resource_id);
58 int bm_set_dbus_connection_obj(GDBusConnection* conn);
60 GDBusConnection* bm_get_dbus_connection_obj(void);
62 void bd_get_focussed_app_id(char **app_name);
64 void bm_get_name_for_pid(pid_t pid, char **pname);
66 void bm_data_free(gpointer data);
68 void bm_atm_free(gpointer data);
70 void bm_appid_usage_free(appid_usage_s *data);
72 void bm_resourceid_usage_free(resourceid_usage_s *data);
74 long int bm_get_log_time(int bias);
76 void bm_set_free_atm_st2_list(GSList *atm_list);
78 void bm_set_free_atm_st1_list(GSList *atm_list);
80 void bm_set_free_ble_data_handle(bm_bluetooth_st **bt_handle);
82 void bm_set_free_wifi_data_handle(bm_wifi_st **wifi_handle);
84 void bm_set_free_cpu_data_handle(bm_cpu_st **cpu_handle);
86 void bm_set_free_display_data_handle(bm_display_st **display_handle);
88 void bm_set_free_device_network_data_handle(bm_device_network_st **dn_handle);
90 #ifdef DISABLE_FEATURE_DATA_FROM_GPS_PLUGIN
91 void bm_set_free_gps_sensor_data_handle(bm_gps_st **gps_handle);
92 #endif /* DISABLE_FEATURE_DATA_FROM_GPS_PLUGIN */
94 void bm_set_free_data_handles(bm_feature_data_h* data_h);
96 void bm_set_free_gslist_appid_map(GSList *list);
101 #endif /* __BM_UTIL_H__ */