2 * Copyright (c) 2016 - 2017 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 <badge_setting.h>
31 #include <badge_setting_service.h>
32 #include <badge_error.h>
39 #define _E(fmt, arg...) fprintf(stderr, "[BADGE_INIT][E][%s,%d] "fmt"\n", \
40 __func__, __LINE__, ##arg)
42 static int __is_authorized(void)
46 if ((uid_t)OWNER_ROOT == uid)
52 int main(int argc, char *argv[])
55 uid_t uid = OWNER_ROOT;
57 if (!__is_authorized()) {
58 _E("You are not an authorized user!");
63 uid = (uid_t)atoi(argv[2]);
65 ret = badge_setting_refresh_setting_table(uid);
66 if (ret != BADGE_ERROR_NONE)
67 _E("badge setting table refresh fail.");