blob: a52a5e92a84008ed7896a69ec0c26380095c9df9 [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
Keun-young Park721c9dc2017-05-19 17:13:04 -070019#include <stdint.h>
20#include <inttypes.h>
21
Mathias Agopianac31a3b2009-05-21 19:59:24 -070022#include <binder/IPCThreadState.h>
23#include <binder/ProcessState.h>
24#include <binder/IServiceManager.h>
Yabin Cui16104862015-01-26 19:43:58 -080025#include <cutils/properties.h>
26#include <sys/resource.h>
Mathias Agopian627e7b52009-05-21 19:21:59 -070027#include <utils/Log.h>
Keun-young Park721c9dc2017-05-19 17:13:04 -070028#include <utils/SystemClock.h>
Mathias Agopian627e7b52009-05-21 19:21:59 -070029
Mathias Agopian627e7b52009-05-21 19:21:59 -070030#include "BootAnimation.h"
Ed Coyne7464ac92017-06-08 12:26:48 -070031#include "BootAnimationUtil.h"
Ed Coyne2c9e94a2017-05-31 10:08:28 -070032#include "audioplay.h"
Mathias Agopian627e7b52009-05-21 19:21:59 -070033
34using namespace android;
35
Andreas Gampecfedceb2014-09-30 21:48:18 -070036int main()
Mathias Agopian627e7b52009-05-21 19:21:59 -070037{
Mathias Agopian627e7b52009-05-21 19:21:59 -070038 setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY);
Mathias Agopian627e7b52009-05-21 19:21:59 -070039
Ed Coyne7464ac92017-06-08 12:26:48 -070040 bool noBootAnimation = bootAnimationDisabled();
Steve Block6215d3f2012-01-04 20:05:49 +000041 ALOGI_IF(noBootAnimation, "boot animation disabled");
Mathias Agopiande363132009-07-28 15:27:39 -070042 if (!noBootAnimation) {
Mathias Agopian627e7b52009-05-21 19:21:59 -070043
Mathias Agopiande363132009-07-28 15:27:39 -070044 sp<ProcessState> proc(ProcessState::self());
45 ProcessState::self()->startThreadPool();
Mathias Agopian627e7b52009-05-21 19:21:59 -070046
Ed Coyne7464ac92017-06-08 12:26:48 -070047 waitForSurfaceFlinger();
Ed Coyne2c9e94a2017-05-31 10:08:28 -070048
Mathias Agopiande363132009-07-28 15:27:39 -070049 // create the boot animation object
Ed Coyne33f4b7d2018-04-10 13:39:09 -070050 sp<BootAnimation> boot = new BootAnimation(audioplay::createAnimationCallbacks());
Kalle Raita88efa562017-07-14 16:18:16 -070051 ALOGV("Boot animation set up. Joining pool.");
Mathias Agopiande363132009-07-28 15:27:39 -070052
53 IPCThreadState::self()->joinThreadPool();
Mathias Agopiande363132009-07-28 15:27:39 -070054 }
Kalle Raita88efa562017-07-14 16:18:16 -070055 ALOGV("Boot animation exit");
Mathias Agopian627e7b52009-05-21 19:21:59 -070056 return 0;
57}