Fix 'frequency' statistics for the trigger to emit proper results
[platform/core/context/statistics-context-provider.git] / src / app / app_stats_types.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef __CONTEXT_APP_STATS_TYPES_H__
18 #define __CONTEXT_APP_STATS_TYPES_H__
19
20 #include <common_types.h>
21
22 #define APP_SUBJ_RECENTLY_USED          "app/history/recently_used"
23 #define APP_SUBJ_FREQUENTLY_USED        "app/history/frequently_used"
24 #define APP_SUBJ_RARELY_USED            "app/history/rarely_used"
25 #define APP_SUBJ_PEAK_TIME                      "app/history/peak_time"
26 #define APP_SUBJ_COMMON_SETTING         "app/history/common_setting"
27 #define APP_SUBJ_FREQUENCY                      "app/history/use_freq"
28
29 #define APP_TABLE_REMOVABLE_APP "Log_RemovableApp"
30 #define APP_TABLE_REMOVABLE_APP_COLUMNS \
31         "AppId TEXT NOT NULL UNIQUE"
32
33 #define APP_TABLE_USAGE_LOG             "Log_AppLaunch"
34 #define APP_TABLE_USAGE_LOG_COLUMNS \
35         "AppId TEXT NOT NULL, Duration INTEGER NOT NULL DEFAULT 0, " \
36         "SystemVolume INTEGER, MediaVolume INTEGER, AudioJack INTEGER, " \
37         "BSSID TEXT, " \
38         "UTC TIMESTAMP DEFAULT (strftime('%s', 'now')), " \
39         "LocalTime TIMESTAMP DEFAULT (strftime('%s', 'now', 'localtime'))"
40
41 #define APP_TEMP_USAGE_FREQ             "Temp_AppLaunchFreq"
42 #define APP_TEMP_USAGE_FREQ_SQL \
43         "CREATE TABLE IF NOT EXISTS " APP_TEMP_USAGE_FREQ \
44         " (AppId TEXT NOT NULL UNIQUE, TotalCount INTEGER DEFAULT 0);"
45
46 #endif