-
Notifications
You must be signed in to change notification settings - Fork 9
/
mce-setting.h
97 lines (80 loc) · 4.56 KB
/
mce-setting.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
* @file mce-setting.h
* Headers for the runtime setting handling code for the Mode Control Entity
* <p>
* Copyright © 2004-2007 Nokia Corporation and/or its subsidiary(-ies).
* Copyright © 2014-2016 Jolla Ltd.
* <p>
* @author David Weinehall <david.weinehall@nokia.com>
* @author Simo Piiroinen <simo.piiroinen@jollamobile.com>
*
* mce is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* mce 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with mce. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MCE_SETTING_H_
# define MCE_SETTING_H_
# include "builtin-gconf.h"
/* ========================================================================= *
* Fingerprint Scanner Settings
* ========================================================================= */
/** Fingerprint wakeup enable modes */
typedef enum
{
/** Fingerprint wakeups disabled */
FPWAKEUP_ENABLE_NEVER = 0,
/** Fingerprint wakeups always enabled */
FPWAKEUP_ENABLE_ALWAYS = 1,
/** Fingerprint wakeups enabled when PS is not covered */
FPWAKEUP_ENABLE_NO_PROXIMITY = 2,
} fpwakeup_mode_t;
/** Prefix for fingerprint setting keys */
# define MCE_SETTING_FINGERPRINT_PATH "/system/osso/dsm/fingerprint"
/** When fingerprint wakeup is allowed */
# define MCE_SETTING_FPWAKEUP_MODE MCE_SETTING_FINGERPRINT_PATH "/mode"
# define MCE_DEFAULT_FPWAKEUP_MODE 0 // = FPWAKEUP_ENABLE_NEVER
/** Delay between policy change and activating fingerprint daemon [ms] */
# define MCE_SETTING_FPWAKEUP_ALLOW_DELAY MCE_SETTING_FINGERPRINT_PATH "/allow_delay"
# define MCE_DEFAULT_FPWAKEUP_ALLOW_DELAY 500
/** Delay between getting identified fingerprint and acting on it [ms] */
# define MCE_SETTING_FPWAKEUP_TRIGGER_DELAY MCE_SETTING_FINGERPRINT_PATH "/trigger_delay"
# define MCE_DEFAULT_FPWAKEUP_TRIGGER_DELAY 100
/** Delay between ipc attempts with fingerprint daemon [ms] */
# define MCE_SETTING_FPWAKEUP_THROTTLE_DELAY MCE_SETTING_FINGERPRINT_PATH "/throttle_delay"
# define MCE_DEFAULT_FPWAKEUP_THROTTLE_DELAY 250
/* ========================================================================= *
* Button Backlight Settings
* ========================================================================= */
/** Prefix for fingerprint setting keys */
# define MCE_SETTING_BUTTONBACKLIGHT_PATH "/system/osso/dsm/buttonbacklight"
/** When fingerprint wakeup is allowed */
# define MCE_SETTING_BUTTONBACKLIGHT_OFF_DELAY MCE_SETTING_BUTTONBACKLIGHT_PATH "/off_delay"
# define MCE_DEFAULT_BUTTONBACKLIGHT_OFF_DELAY 5000 // = 5 seconds
/* ========================================================================= *
* Functions
* ========================================================================= */
gboolean mce_setting_has_key (const gchar *const key);
gboolean mce_setting_set_bool (const gchar *const key, const gboolean value);
gboolean mce_setting_set_int (const gchar *const key, const gint value);
gboolean mce_setting_set_string (const gchar *const key, const gchar *const value);
gboolean mce_setting_get_bool (const gchar *const key, gboolean *value);
gboolean mce_setting_get_int (const gchar *const key, gint *value);
gboolean mce_setting_get_int_list (const gchar *const key, GSList **values);
gboolean mce_setting_get_string (const gchar *const key, gchar **value);
gboolean mce_setting_notifier_add (const gchar *path, const gchar *key, const GConfClientNotifyFunc callback, guint *cb_id);
void mce_setting_notifier_remove (guint id);
void mce_setting_notifier_remove_cb(gpointer cb_id, gpointer user_data);
void mce_setting_track_int (const gchar *key, gint *val, gint def, GConfClientNotifyFunc cb, guint *cb_id);
void mce_setting_track_bool (const gchar *key, gboolean *val, gint def, GConfClientNotifyFunc cb, guint *cb_id);
void mce_setting_track_string (const gchar *key, gchar **val, const gchar *def, GConfClientNotifyFunc cb, guint *cb_id);
gboolean mce_setting_init (void);
void mce_setting_exit (void);
#endif /* MCE_SETTING_H_ */