1627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian/* 2627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * Copyright (C) 2007 The Android Open Source Project 3627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * 4627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * Licensed under the Apache License, Version 2.0 (the "License"); 5627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * you may not use this file except in compliance with the License. 6627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * You may obtain a copy of the License at 7627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * 8627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * http://www.apache.org/licenses/LICENSE-2.0 9627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * 10627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * Unless required by applicable law or agreed to in writing, software 11627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * distributed under the License is distributed on an "AS IS" BASIS, 12627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * See the License for the specific language governing permissions and 14627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian * limitations under the License. 15627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian */ 16627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 17627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian#define LOG_TAG "BootAnimation" 18627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 19de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian#include <cutils/properties.h> 20de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian 21ac31a3b8b09aba1c5ebc73f0cf65cac2210aa6b7Mathias Agopian#include <binder/IPCThreadState.h> 22ac31a3b8b09aba1c5ebc73f0cf65cac2210aa6b7Mathias Agopian#include <binder/ProcessState.h> 23ac31a3b8b09aba1c5ebc73f0cf65cac2210aa6b7Mathias Agopian#include <binder/IServiceManager.h> 24a0d128c8c601750dcbcf97342ffca7865b8a6f9eMathias Agopian 25627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian#include <utils/Log.h> 26627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian#include <utils/threads.h> 27627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 28000479f9e325b4e426a67033abd92d47da412725Mathias Agopian#include <surfaceflinger/ISurfaceComposer.h> 29627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 30627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian#if defined(HAVE_PTHREADS) 31627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian# include <pthread.h> 32627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian# include <sys/resource.h> 33627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian#endif 34627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 35627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian#include "BootAnimation.h" 36627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 37627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopianusing namespace android; 38627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 39627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian// --------------------------------------------------------------------------- 40627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 41627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopianint main(int argc, char** argv) 42627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian{ 43627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian#if defined(HAVE_PTHREADS) 44627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian setpriority(PRIO_PROCESS, 0, ANDROID_PRIORITY_DISPLAY); 45627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian#endif 46627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 47de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian char value[PROPERTY_VALUE_MAX]; 48de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian property_get("debug.sf.nobootanimation", value, "0"); 49de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian int noBootAnimation = atoi(value); 50de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian LOGI_IF(noBootAnimation, "boot animation disabled"); 51de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian if (!noBootAnimation) { 52de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian 53de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian sp<ProcessState> proc(ProcessState::self()); 54de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian ProcessState::self()->startThreadPool(); 55de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian 56de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian // create the boot animation object 57de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian sp<BootAnimation> boot = new BootAnimation(); 58627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 59de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian IPCThreadState::self()->joinThreadPool(); 60627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian 61de36313b0b80c019c2784edd9d41f6761fe80685Mathias Agopian } 62627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian return 0; 63627e7b50be41e4fdee758a1bfad3a55de56b4e27Mathias Agopian} 64