2 * Copyright (c) 2009-2015 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.
23 #include "animation.h"
26 #include "boot_sound.h"
33 void(*boot_exit)(void);
35 static int __check_on_off_type(void *user_data)
41 int type = TYPE_UNKNOWN;
42 struct args *args = user_data;
43 static struct option long_options[] = {
44 {"start", no_argument, 0, 's' },
45 {"off", no_argument, 0, 'o' },
46 {"stop", no_argument, 0, 'p' },
47 {"clear", no_argument, 0, 'c' },
53 for (i = 0; i < argc; i++) {
54 __D("argc %d [%s]", i, argv[i]);
57 while ((c = getopt_long(argc, argv, "sopc", long_options, NULL)) >= 0) {
64 type = TYPE_OFF_NOEXIT;
70 type = TYPE_OFF_NOEXIT;
74 __D("[Boot-ani] unknown arg [%s]", optarg);
84 int main(int argc, char *argv[])
88 setenv("HOME", "/home/root", 1);
91 printf("Usage) %s {--start|--stop}\n", argv[0]);
93 printf(" # %s --start\n", argv[0]);
94 printf(" # %s --stop\n", argv[0]);
95 printf(" # %s --off\n", argv[0]);
103 static int invoked_flag = 0;
104 if (invoked_flag == 1) {
110 fd = open("/tmp/myfile.txt", O_CREAT|O_RDWR, S_IRWXU|S_IRWXO);
111 __D("Result of log file open: %d", fd);
113 elm_init(argc, argv);
114 boot_exit = elm_exit;
117 boot_type = __check_on_off_type(&args);
119 __E("Failed to get on off type or UNKNOWN_TYPE: %d", boot_type);
123 if (animation_init(boot_type) != EXIT_SUCCESS) {
124 __E("Exit boot-animation");
128 if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 0) != 0) {
129 __D("Failed to set finished value to 0\n");
132 play_boot_sound(boot_type);
145 int __t__check_on_off_type(void *user_data)
147 return __check_on_off_type(user_data);