2 * Copyright (c) 2016 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 #include <sys/types.h>
30 #include <notification_setting.h>
32 /* For multi-user support */
33 #include <tzplatform_config.h>
40 #define _E(fmt, arg...) fprintf(stderr, "[NOTIFICATION_INIT][E][%s,%d] "fmt"\n", \
41 __FUNCTION__, __LINE__, ##arg);
43 static int _is_authorized()
45 /* pkg_init db should be called by as root privilege. */
48 if ((uid_t) OWNER_ROOT == uid)
54 int main(int argc, char *argv[])
59 if (!_is_authorized()) {
60 _E("You are not an authorized user!");
65 uid = (uid_t)atoi(argv[2]);
66 ret = notification_setting_refresh_setting_table(uid);
67 if (ret != NOTIFICATION_ERROR_NONE) {
68 _E("notification setting table refresh fail.");
72 ret = notification_system_setting_init_system_setting_table(uid);
73 if (ret != NOTIFICATION_ERROR_NONE) {
74 _E("notification system setting table init fail.");