-
Notifications
You must be signed in to change notification settings - Fork 0
/
policydb.h
60 lines (49 loc) · 1.62 KB
/
policydb.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
/**
* Peter Hornyack
*/
/**
* Contains the policy database interface used only by the
* policyd server; all of this should be invisible to the "client"
* apps.
*/
#ifndef POLICYDB_H
#define POLICYDB_H
#include <policy_global.h>
/* File containing user-specified policy in XML format: */
const char *policydb_xmlfile = "/data/data/com.android.settings/policydb.xml";
/**
* Add an entry to the policy db.
* Returns: the number of added entries (should be 1) on success,
* -1 on error.
*/
int add_policydb_entry(policy_entry *entry);
/**
* Remove entries from the policy db. If the supplied entry contains
* wildcards, all matching entries will be removed from the db.
* Returns: the number of entries removed on success (0 is valid),
* or -1 on error.
*/
int remove_policydb_entries(policy_entry *entry);
/**
* Queries the policy db and returns the number of matching entries;
* it's the caller's choice what to do with this information. The
* supplied entry can contain wildcards.
* Returns: the number of matching entries on success (0 is valid),
* or -1 on error.
*/
int query_policydb(policy_entry *entry);
/**
* Tells the policy db to re-read its policy file that is stored on
* persistent storage (policydb_xmlfile). This function will create
* the table in the database if it does not already exist.
* Returns: 0 on success, -1 on error.
*/
int refresh_policydb();
/**
* Initialize the policy db for the first time. This function must
* be called exactly once, before any of the other functions in this
* interface are called.
* Returns: 0 on success, negative on error.
*/
int initialize_policydb();
#endif