Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 1 | /* |
| 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 Park | 721c9dc | 2017-05-19 17:13:04 -0700 | [diff] [blame] | 19 | #include <stdint.h> |
| 20 | #include <inttypes.h> |
| 21 | |
Mathias Agopian | ac31a3b | 2009-05-21 19:59:24 -0700 | [diff] [blame] | 22 | #include <binder/IPCThreadState.h> |
| 23 | #include <binder/ProcessState.h> |
| 24 | #include <binder/IServiceManager.h> |
Yabin Cui | 1610486 | 2015-01-26 19:43:58 -0800 | [diff] [blame] | 25 | #include <cutils/properties.h> |
| 26 | #include <sys/resource.h> |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 27 | #include <utils/Log.h> |
Keun-young Park | 721c9dc | 2017-05-19 17:13:04 -0700 | [diff] [blame] | 28 | #include <utils/SystemClock.h> |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 29 | |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 30 | #include "BootAnimation.h" |
Ed Coyne | 7464ac9 | 2017-06-08 12:26:48 -0700 | [diff] [blame] | 31 | #include "BootAnimationUtil.h" |
Ed Coyne | 2c9e94a | 2017-05-31 10:08:28 -0700 | [diff] [blame] | 32 | #include "audioplay.h" |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 33 | |
| 34 | using namespace android; |
| 35 | |
Andreas Gampe | cfedceb | 2014-09-30 21:48:18 -0700 | [diff] [blame] | 36 | int main() |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 37 | { |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 38 | setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY); |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 39 | |
Ed Coyne | 7464ac9 | 2017-06-08 12:26:48 -0700 | [diff] [blame] | 40 | bool noBootAnimation = bootAnimationDisabled(); |
Steve Block | 6215d3f | 2012-01-04 20:05:49 +0000 | [diff] [blame] | 41 | ALOGI_IF(noBootAnimation, "boot animation disabled"); |
Mathias Agopian | de36313 | 2009-07-28 15:27:39 -0700 | [diff] [blame] | 42 | if (!noBootAnimation) { |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 43 | |
Mathias Agopian | de36313 | 2009-07-28 15:27:39 -0700 | [diff] [blame] | 44 | sp<ProcessState> proc(ProcessState::self()); |
| 45 | ProcessState::self()->startThreadPool(); |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 46 | |
Ed Coyne | 7464ac9 | 2017-06-08 12:26:48 -0700 | [diff] [blame] | 47 | waitForSurfaceFlinger(); |
Ed Coyne | 2c9e94a | 2017-05-31 10:08:28 -0700 | [diff] [blame] | 48 | |
Mathias Agopian | de36313 | 2009-07-28 15:27:39 -0700 | [diff] [blame] | 49 | // create the boot animation object |
Ed Coyne | 33f4b7d | 2018-04-10 13:39:09 -0700 | [diff] [blame] | 50 | sp<BootAnimation> boot = new BootAnimation(audioplay::createAnimationCallbacks()); |
Kalle Raita | 88efa56 | 2017-07-14 16:18:16 -0700 | [diff] [blame] | 51 | ALOGV("Boot animation set up. Joining pool."); |
Mathias Agopian | de36313 | 2009-07-28 15:27:39 -0700 | [diff] [blame] | 52 | |
| 53 | IPCThreadState::self()->joinThreadPool(); |
Mathias Agopian | de36313 | 2009-07-28 15:27:39 -0700 | [diff] [blame] | 54 | } |
Kalle Raita | 88efa56 | 2017-07-14 16:18:16 -0700 | [diff] [blame] | 55 | ALOGV("Boot animation exit"); |
Mathias Agopian | 627e7b5 | 2009-05-21 19:21:59 -0700 | [diff] [blame] | 56 | return 0; |
| 57 | } |