blob: a8359c40d0d275eaa3b9a2fd39b94f14f8d6399d [file] [log] [blame]
Mathias Agopian627e7b52009-05-21 19:21:59 -07001/*
2 * Copyright (C) 2007 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17#define LOG_TAG "BootAnimation"
18
Mathias Agopiande363132009-07-28 15:27:39 -070019#include <cutils/properties.h>
20
Mathias Agopian627e7b52009-05-21 19:21:59 -070021#include <utils/IPCThreadState.h>
22#include <utils/ProcessState.h>
23#include <utils/IServiceManager.h>
24#include <utils/Log.h>
25#include <utils/threads.h>
26
27#include <ui/ISurfaceComposer.h>
28
29#if defined(HAVE_PTHREADS)
30# include <pthread.h>
31# include <sys/resource.h>
32#endif
33
34#include "BootAnimation.h"
35
36using namespace android;
37
38// ---------------------------------------------------------------------------
39
40int main(int argc, char** argv)
41{
42#if defined(HAVE_PTHREADS)
43 setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY);
44#endif
45
Mathias Agopiande363132009-07-28 15:27:39 -070046 char value[PROPERTY_VALUE_MAX];
47 property_get("debug.sf.nobootanimation", value, "0");
48 int noBootAnimation = atoi(value);
49 LOGI_IF(noBootAnimation, "boot animation disabled");
50 if (!noBootAnimation) {
Mathias Agopian627e7b52009-05-21 19:21:59 -070051
Mathias Agopiande363132009-07-28 15:27:39 -070052 sp<ProcessState> proc(ProcessState::self());
53 ProcessState::self()->startThreadPool();
Mathias Agopian627e7b52009-05-21 19:21:59 -070054
Mathias Agopiande363132009-07-28 15:27:39 -070055 // create the boot animation object
56 sp<BootAnimation> boot = new BootAnimation();
57
58 IPCThreadState::self()->joinThreadPool();
59
60 }
Mathias Agopian627e7b52009-05-21 19:21:59 -070061 return 0;
62}