blob: 25b264ecff103853c84ab7e096c57735a3538318 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -070017#define LOG_NDEBUG 0
Mathias Agopianbc726112009-09-23 15:44:05 -070018#define LOG_TAG "BootAnimation"
19
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020#include <stdint.h>
21#include <sys/types.h>
22#include <math.h>
23#include <fcntl.h>
24#include <utils/misc.h>
Mathias Agopianb4d5a722009-09-23 17:05:19 -070025#include <signal.h>
Elliott Hughesbb94f312014-10-21 10:41:33 -070026#include <time.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080027
Jason parksbd9a08d2011-01-31 15:04:34 -060028#include <cutils/properties.h>
29
Mathias Agopianb13b9bd2012-02-17 18:27:36 -080030#include <androidfw/AssetManager.h>
Mathias Agopianac31a3b2009-05-21 19:59:24 -070031#include <binder/IPCThreadState.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032#include <utils/Atomic.h>
33#include <utils/Errors.h>
34#include <utils/Log.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035
36#include <ui/PixelFormat.h>
37#include <ui/Rect.h>
38#include <ui/Region.h>
39#include <ui/DisplayInfo.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040
Jeff Brown0b722fe2012-08-24 22:40:14 -070041#include <gui/ISurfaceComposer.h>
Mathias Agopian8335f1c2012-02-25 18:48:35 -080042#include <gui/Surface.h>
43#include <gui/SurfaceComposerClient.h>
Mathias Agopian000479f2010-02-09 17:46:37 -080044
Andreas Gampecfedceb2014-09-30 21:48:18 -070045// TODO: Fix Skia.
46#pragma GCC diagnostic push
47#pragma GCC diagnostic ignored "-Wunused-parameter"
Derek Sollenbergereece0dd2014-02-27 14:31:29 -050048#include <SkBitmap.h>
49#include <SkStream.h>
50#include <SkImageDecoder.h>
Andreas Gampecfedceb2014-09-30 21:48:18 -070051#pragma GCC diagnostic pop
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052
53#include <GLES/gl.h>
54#include <GLES/glext.h>
55#include <EGL/eglext.h>
56
57#include "BootAnimation.h"
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -070058#include "AudioPlayer.h"
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080059
Jeff Sharkey28f08772014-04-16 09:41:58 -070060#define OEM_BOOTANIMATION_FILE "/oem/media/bootanimation.zip"
Jim Huangc11f4622010-08-10 03:12:15 +080061#define SYSTEM_BOOTANIMATION_FILE "/system/media/bootanimation.zip"
Jason parksbd9a08d2011-01-31 15:04:34 -060062#define SYSTEM_ENCRYPTED_BOOTANIMATION_FILE "/system/media/bootanimation-encrypted.zip"
Kevin Hesterd3782b22012-04-26 10:38:55 -070063#define EXIT_PROP_NAME "service.bootanim.exit"
Jim Huangc11f4622010-08-10 03:12:15 +080064
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065namespace android {
66
Narayan Kamathafd31e02013-12-03 13:16:03 +000067static const int ANIM_ENTRY_NAME_MAX = 256;
68
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069// ---------------------------------------------------------------------------
70
Andriy Naborskyy815e51d2016-03-24 16:43:34 -070071BootAnimation::BootAnimation() : Thread(false), mClockEnabled(true) {
Mathias Agopian627e7b52009-05-21 19:21:59 -070072 mSession = new SurfaceComposerClient();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073}
74
75BootAnimation::~BootAnimation() {
76}
77
78void BootAnimation::onFirstRef() {
Mathias Agopianbc726112009-09-23 15:44:05 -070079 status_t err = mSession->linkToComposerDeath(this);
Steve Block3762c312012-01-06 19:20:56 +000080 ALOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err));
Mathias Agopian8434c532009-09-23 18:52:49 -070081 if (err == NO_ERROR) {
Mathias Agopianbc726112009-09-23 15:44:05 -070082 run("BootAnimation", PRIORITY_DISPLAY);
83 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084}
85
Mathias Agopianbc726112009-09-23 15:44:05 -070086sp<SurfaceComposerClient> BootAnimation::session() const {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087 return mSession;
88}
89
Mathias Agopianbc726112009-09-23 15:44:05 -070090
Narayan Kamathafd31e02013-12-03 13:16:03 +000091void BootAnimation::binderDied(const wp<IBinder>&)
Mathias Agopianbc726112009-09-23 15:44:05 -070092{
93 // woah, surfaceflinger died!
Steve Block5baa3a62011-12-20 16:23:08 +000094 ALOGD("SurfaceFlinger died, exiting...");
Mathias Agopianbc726112009-09-23 15:44:05 -070095
96 // calling requestExit() is not enough here because the Surface code
97 // might be blocked on a condition variable that will never be updated.
98 kill( getpid(), SIGKILL );
99 requestExit();
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700100 if (mAudioPlayer != NULL) {
101 mAudioPlayer->requestExit();
102 }
Mathias Agopianbc726112009-09-23 15:44:05 -0700103}
104
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105status_t BootAnimation::initTexture(Texture* texture, AssetManager& assets,
106 const char* name) {
107 Asset* asset = assets.open(name, Asset::ACCESS_BUFFER);
Andreas Gampecfedceb2014-09-30 21:48:18 -0700108 if (asset == NULL)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800109 return NO_INIT;
110 SkBitmap bitmap;
111 SkImageDecoder::DecodeMemory(asset->getBuffer(false), asset->getLength(),
Mike Reed42a1d082014-07-07 18:06:18 -0400112 &bitmap, kUnknown_SkColorType, SkImageDecoder::kDecodePixels_Mode);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800113 asset->close();
114 delete asset;
115
116 // ensure we can call getPixels(). No need to call unlock, since the
117 // bitmap will go out of scope when we return from this method.
118 bitmap.lockPixels();
119
120 const int w = bitmap.width();
121 const int h = bitmap.height();
122 const void* p = bitmap.getPixels();
123
124 GLint crop[4] = { 0, h, w, -h };
125 texture->w = w;
126 texture->h = h;
127
128 glGenTextures(1, &texture->name);
129 glBindTexture(GL_TEXTURE_2D, texture->name);
130
Mike Reed42a1d082014-07-07 18:06:18 -0400131 switch (bitmap.colorType()) {
132 case kAlpha_8_SkColorType:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800133 glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_ALPHA,
134 GL_UNSIGNED_BYTE, p);
135 break;
Mike Reed42a1d082014-07-07 18:06:18 -0400136 case kARGB_4444_SkColorType:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA,
138 GL_UNSIGNED_SHORT_4_4_4_4, p);
139 break;
Mike Reed42a1d082014-07-07 18:06:18 -0400140 case kN32_SkColorType:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800141 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA,
142 GL_UNSIGNED_BYTE, p);
143 break;
Mike Reed42a1d082014-07-07 18:06:18 -0400144 case kRGB_565_SkColorType:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800145 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB,
146 GL_UNSIGNED_SHORT_5_6_5, p);
147 break;
148 default:
149 break;
150 }
151
152 glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
153 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
154 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
155 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
156 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
157 return NO_ERROR;
158}
159
Mykola Kondratenko0c1eeb32014-04-15 09:35:44 +0200160status_t BootAnimation::initTexture(const Animation::Frame& frame)
Mathias Agopiana8826d62009-10-01 03:10:14 -0700161{
162 //StopWatch watch("blah");
163
164 SkBitmap bitmap;
Mykola Kondratenko0c1eeb32014-04-15 09:35:44 +0200165 SkMemoryStream stream(frame.map->getDataPtr(), frame.map->getDataLength());
Mathias Agopian2b99e552011-11-10 15:59:07 -0800166 SkImageDecoder* codec = SkImageDecoder::Factory(&stream);
Andreas Gampecfedceb2014-09-30 21:48:18 -0700167 if (codec != NULL) {
Elliott Hughesc367d482013-10-29 13:12:55 -0700168 codec->setDitherImage(false);
Mathias Agopian2b99e552011-11-10 15:59:07 -0800169 codec->decode(&stream, &bitmap,
Mike Reed42a1d082014-07-07 18:06:18 -0400170 kN32_SkColorType,
Mathias Agopian2b99e552011-11-10 15:59:07 -0800171 SkImageDecoder::kDecodePixels_Mode);
172 delete codec;
173 }
Mathias Agopiana8826d62009-10-01 03:10:14 -0700174
Mykola Kondratenko0c1eeb32014-04-15 09:35:44 +0200175 // FileMap memory is never released until application exit.
176 // Release it now as the texture is already loaded and the memory used for
177 // the packed resource can be released.
Narayan Kamath688ff4c2015-02-23 15:47:54 +0000178 delete frame.map;
Mykola Kondratenko0c1eeb32014-04-15 09:35:44 +0200179
Mathias Agopiana8826d62009-10-01 03:10:14 -0700180 // ensure we can call getPixels(). No need to call unlock, since the
181 // bitmap will go out of scope when we return from this method.
182 bitmap.lockPixels();
183
184 const int w = bitmap.width();
185 const int h = bitmap.height();
186 const void* p = bitmap.getPixels();
187
188 GLint crop[4] = { 0, h, w, -h };
189 int tw = 1 << (31 - __builtin_clz(w));
190 int th = 1 << (31 - __builtin_clz(h));
191 if (tw < w) tw <<= 1;
192 if (th < h) th <<= 1;
193
Mike Reed42a1d082014-07-07 18:06:18 -0400194 switch (bitmap.colorType()) {
195 case kN32_SkColorType:
Mathias Agopiana8826d62009-10-01 03:10:14 -0700196 if (tw != w || th != h) {
197 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tw, th, 0, GL_RGBA,
198 GL_UNSIGNED_BYTE, 0);
199 glTexSubImage2D(GL_TEXTURE_2D, 0,
200 0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, p);
201 } else {
202 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tw, th, 0, GL_RGBA,
203 GL_UNSIGNED_BYTE, p);
204 }
205 break;
206
Mike Reed42a1d082014-07-07 18:06:18 -0400207 case kRGB_565_SkColorType:
Mathias Agopiana8826d62009-10-01 03:10:14 -0700208 if (tw != w || th != h) {
209 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tw, th, 0, GL_RGB,
210 GL_UNSIGNED_SHORT_5_6_5, 0);
211 glTexSubImage2D(GL_TEXTURE_2D, 0,
212 0, 0, w, h, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, p);
213 } else {
214 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tw, th, 0, GL_RGB,
215 GL_UNSIGNED_SHORT_5_6_5, p);
216 }
217 break;
218 default:
219 break;
220 }
221
222 glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, crop);
223
224 return NO_ERROR;
225}
226
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800227status_t BootAnimation::readyToRun() {
228 mAssets.addDefaultAssets();
229
Jeff Brown0b722fe2012-08-24 22:40:14 -0700230 sp<IBinder> dtoken(SurfaceComposerClient::getBuiltInDisplay(
231 ISurfaceComposer::eDisplayIdMain));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800232 DisplayInfo dinfo;
Jeff Brown0b722fe2012-08-24 22:40:14 -0700233 status_t status = SurfaceComposerClient::getDisplayInfo(dtoken, &dinfo);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800234 if (status)
235 return -1;
236
237 // create the native surface
Jeff Brown0b722fe2012-08-24 22:40:14 -0700238 sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"),
239 dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565);
Mathias Agopian439863f2011-06-28 19:09:31 -0700240
241 SurfaceComposerClient::openGlobalTransaction();
Mathias Agopian17f638b2009-04-16 20:04:08 -0700242 control->setLayer(0x40000000);
Mathias Agopian439863f2011-06-28 19:09:31 -0700243 SurfaceComposerClient::closeGlobalTransaction();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800244
Mathias Agopian17f638b2009-04-16 20:04:08 -0700245 sp<Surface> s = control->getSurface();
246
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800247 // initialize opengl and egl
Mathias Agopian738b9a42009-08-06 16:41:02 -0700248 const EGLint attribs[] = {
Mathias Agopian1b253b72011-08-15 15:20:22 -0700249 EGL_RED_SIZE, 8,
250 EGL_GREEN_SIZE, 8,
251 EGL_BLUE_SIZE, 8,
Mathias Agopiana8826d62009-10-01 03:10:14 -0700252 EGL_DEPTH_SIZE, 0,
253 EGL_NONE
Mathias Agopian738b9a42009-08-06 16:41:02 -0700254 };
Andreas Gampecfedceb2014-09-30 21:48:18 -0700255 EGLint w, h;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800256 EGLint numConfigs;
257 EGLConfig config;
258 EGLSurface surface;
259 EGLContext context;
Mathias Agopian627e7b52009-05-21 19:21:59 -0700260
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800261 EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
Mathias Agopian627e7b52009-05-21 19:21:59 -0700262
263 eglInitialize(display, 0, 0);
Mathias Agopian1b253b72011-08-15 15:20:22 -0700264 eglChooseConfig(display, attribs, &config, 1, &numConfigs);
Mathias Agopian1473f462009-04-10 14:24:30 -0700265 surface = eglCreateWindowSurface(display, config, s.get(), NULL);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800266 context = eglCreateContext(display, config, NULL, NULL);
267 eglQuerySurface(display, surface, EGL_WIDTH, &w);
268 eglQuerySurface(display, surface, EGL_HEIGHT, &h);
Mathias Agopiana8826d62009-10-01 03:10:14 -0700269
Mathias Agopianabac0102009-07-31 14:47:00 -0700270 if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE)
271 return NO_INIT;
Mathias Agopiana8826d62009-10-01 03:10:14 -0700272
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800273 mDisplay = display;
274 mContext = context;
275 mSurface = surface;
276 mWidth = w;
277 mHeight = h;
Mathias Agopian17f638b2009-04-16 20:04:08 -0700278 mFlingerSurfaceControl = control;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800279 mFlingerSurface = s;
280
Elliott Hughesc367d482013-10-29 13:12:55 -0700281 // If the device has encryption turned on or is in process
Jason parksbd9a08d2011-01-31 15:04:34 -0600282 // of being encrypted we show the encrypted boot animation.
283 char decrypt[PROPERTY_VALUE_MAX];
284 property_get("vold.decrypt", decrypt, "");
285
286 bool encryptedAnimation = atoi(decrypt) != 0 || !strcmp("trigger_restart_min_framework", decrypt);
287
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700288 if (encryptedAnimation && (access(SYSTEM_ENCRYPTED_BOOTANIMATION_FILE, R_OK) == 0)) {
289 mZipFileName = SYSTEM_ENCRYPTED_BOOTANIMATION_FILE;
Jason parksbd9a08d2011-01-31 15:04:34 -0600290 }
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700291 else if (access(OEM_BOOTANIMATION_FILE, R_OK) == 0) {
292 mZipFileName = OEM_BOOTANIMATION_FILE;
293 }
294 else if (access(SYSTEM_BOOTANIMATION_FILE, R_OK) == 0) {
295 mZipFileName = SYSTEM_BOOTANIMATION_FILE;
296 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800297 return NO_ERROR;
298}
299
Mathias Agopiana8826d62009-10-01 03:10:14 -0700300bool BootAnimation::threadLoop()
301{
302 bool r;
Narayan Kamathafd31e02013-12-03 13:16:03 +0000303 // We have no bootanimation file, so we use the stock android logo
304 // animation.
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700305 if (mZipFileName.isEmpty()) {
Mathias Agopiana8826d62009-10-01 03:10:14 -0700306 r = android();
307 } else {
308 r = movie();
309 }
310
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800311 eglMakeCurrent(mDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
312 eglDestroyContext(mDisplay, mContext);
313 eglDestroySurface(mDisplay, mSurface);
Mathias Agopian6cf0db22009-04-17 19:36:26 -0700314 mFlingerSurface.clear();
Mathias Agopian17f638b2009-04-16 20:04:08 -0700315 mFlingerSurfaceControl.clear();
Mathias Agopian627e7b52009-05-21 19:21:59 -0700316 eglTerminate(mDisplay);
Sai Kiran Korwar3eee9fb2015-06-16 17:13:35 +0530317 eglReleaseThread();
Mathias Agopian627e7b52009-05-21 19:21:59 -0700318 IPCThreadState::self()->stopProcess();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800319 return r;
320}
321
Mathias Agopiana8826d62009-10-01 03:10:14 -0700322bool BootAnimation::android()
323{
Mathias Agopianb2cf9542009-03-24 18:34:16 -0700324 initTexture(&mAndroid[0], mAssets, "images/android-logo-mask.png");
325 initTexture(&mAndroid[1], mAssets, "images/android-logo-shine.png");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800326
327 // clear screen
Mathias Agopiana8826d62009-10-01 03:10:14 -0700328 glShadeModel(GL_FLAT);
Mathias Agopianb2cf9542009-03-24 18:34:16 -0700329 glDisable(GL_DITHER);
330 glDisable(GL_SCISSOR_TEST);
Mathias Agopian59f19e42011-05-06 19:22:12 -0700331 glClearColor(0,0,0,1);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800332 glClear(GL_COLOR_BUFFER_BIT);
333 eglSwapBuffers(mDisplay, mSurface);
334
Mathias Agopiana8826d62009-10-01 03:10:14 -0700335 glEnable(GL_TEXTURE_2D);
336 glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
337
Mathias Agopianb2cf9542009-03-24 18:34:16 -0700338 const GLint xc = (mWidth - mAndroid[0].w) / 2;
339 const GLint yc = (mHeight - mAndroid[0].h) / 2;
340 const Rect updateRect(xc, yc, xc + mAndroid[0].w, yc + mAndroid[0].h);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800341
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800342 glScissor(updateRect.left, mHeight - updateRect.bottom, updateRect.width(),
343 updateRect.height());
344
Mathias Agopianb2cf9542009-03-24 18:34:16 -0700345 // Blend state
346 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
347 glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
348
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800349 const nsecs_t startTime = systemTime();
350 do {
Mathias Agopian13796652009-03-24 22:49:21 -0700351 nsecs_t now = systemTime();
352 double time = now - startTime;
Mathias Agopianb2cf9542009-03-24 18:34:16 -0700353 float t = 4.0f * float(time / us2ns(16667)) / mAndroid[1].w;
354 GLint offset = (1 - (t - floorf(t))) * mAndroid[1].w;
355 GLint x = xc - offset;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356
Mathias Agopian81668642009-07-28 11:41:30 -0700357 glDisable(GL_SCISSOR_TEST);
358 glClear(GL_COLOR_BUFFER_BIT);
359
360 glEnable(GL_SCISSOR_TEST);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800361 glDisable(GL_BLEND);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800362 glBindTexture(GL_TEXTURE_2D, mAndroid[1].name);
Mathias Agopianb2cf9542009-03-24 18:34:16 -0700363 glDrawTexiOES(x, yc, 0, mAndroid[1].w, mAndroid[1].h);
364 glDrawTexiOES(x + mAndroid[1].w, yc, 0, mAndroid[1].w, mAndroid[1].h);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800365
Mathias Agopianb2cf9542009-03-24 18:34:16 -0700366 glEnable(GL_BLEND);
367 glBindTexture(GL_TEXTURE_2D, mAndroid[0].name);
368 glDrawTexiOES(xc, yc, 0, mAndroid[0].w, mAndroid[0].h);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800369
Mathias Agopian627e7b52009-05-21 19:21:59 -0700370 EGLBoolean res = eglSwapBuffers(mDisplay, mSurface);
371 if (res == EGL_FALSE)
372 break;
373
Mathias Agopian13796652009-03-24 22:49:21 -0700374 // 12fps: don't animate too fast to preserve CPU
375 const nsecs_t sleepTime = 83333 - ns2us(systemTime() - now);
376 if (sleepTime > 0)
Mathias Agopiana8826d62009-10-01 03:10:14 -0700377 usleep(sleepTime);
Kevin Hesterd3782b22012-04-26 10:38:55 -0700378
379 checkExit();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800380 } while (!exitPending());
381
382 glDeleteTextures(1, &mAndroid[0].name);
383 glDeleteTextures(1, &mAndroid[1].name);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800384 return false;
385}
386
Mathias Agopiana8826d62009-10-01 03:10:14 -0700387
Kevin Hesterd3782b22012-04-26 10:38:55 -0700388void BootAnimation::checkExit() {
389 // Allow surface flinger to gracefully request shutdown
390 char value[PROPERTY_VALUE_MAX];
391 property_get(EXIT_PROP_NAME, value, "0");
392 int exitnow = atoi(value);
393 if (exitnow) {
394 requestExit();
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700395 if (mAudioPlayer != NULL) {
396 mAudioPlayer->requestExit();
397 }
Kevin Hesterd3782b22012-04-26 10:38:55 -0700398 }
399}
400
Jesse Hall083b84c2014-09-22 10:51:09 -0700401// Parse a color represented as an HTML-style 'RRGGBB' string: each pair of
402// characters in str is a hex number in [0, 255], which are converted to
403// floating point values in the range [0.0, 1.0] and placed in the
404// corresponding elements of color.
405//
406// If the input string isn't valid, parseColor returns false and color is
407// left unchanged.
408static bool parseColor(const char str[7], float color[3]) {
409 float tmpColor[3];
410 for (int i = 0; i < 3; i++) {
411 int val = 0;
412 for (int j = 0; j < 2; j++) {
413 val *= 16;
414 char c = str[2*i + j];
415 if (c >= '0' && c <= '9') val += c - '0';
416 else if (c >= 'A' && c <= 'F') val += (c - 'A') + 10;
417 else if (c >= 'a' && c <= 'f') val += (c - 'a') + 10;
418 else return false;
419 }
420 tmpColor[i] = static_cast<float>(val) / 255.0f;
421 }
422 memcpy(color, tmpColor, sizeof(tmpColor));
423 return true;
424}
425
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700426
427static bool readFile(ZipFileRO* zip, const char* name, String8& outString)
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700428{
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700429 ZipEntryRO entry = zip->findEntryByName(name);
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700430 ALOGE_IF(!entry, "couldn't find %s", name);
431 if (!entry) {
432 return false;
433 }
434
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700435 FileMap* entryMap = zip->createEntryFileMap(entry);
436 zip->releaseEntry(entry);
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700437 ALOGE_IF(!entryMap, "entryMap is null");
438 if (!entryMap) {
439 return false;
440 }
441
442 outString.setTo((char const*)entryMap->getDataPtr(), entryMap->getDataLength());
Narayan Kamath688ff4c2015-02-23 15:47:54 +0000443 delete entryMap;
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700444 return true;
445}
446
Damien Bargiacchia704b7d2016-02-16 16:55:49 -0800447// The time glyphs are stored in a single image of height 64 pixels. Each digit is 40 pixels wide,
448// and the colon character is half that at 20 pixels. The glyph order is '0123456789:'.
449// We render 24 hour time.
450void BootAnimation::drawTime(const Texture& clockTex, const int yPos) {
451 static constexpr char TIME_FORMAT[] = "%H:%M";
452 static constexpr int TIME_LENGTH = sizeof(TIME_FORMAT);
453
454 static constexpr int DIGIT_HEIGHT = 64;
455 static constexpr int DIGIT_WIDTH = 40;
456 static constexpr int COLON_WIDTH = DIGIT_WIDTH / 2;
457 static constexpr int TIME_WIDTH = (DIGIT_WIDTH * 4) + COLON_WIDTH;
458
459 if (clockTex.h < DIGIT_HEIGHT || clockTex.w < (10 * DIGIT_WIDTH + COLON_WIDTH)) {
460 ALOGE("Clock texture is too small; abandoning boot animation clock");
461 mClockEnabled = false;
462 return;
463 }
464
465 time_t rawtime;
466 time(&rawtime);
467 struct tm* timeInfo = localtime(&rawtime);
468
469 char timeBuff[TIME_LENGTH];
470 size_t length = strftime(timeBuff, TIME_LENGTH, TIME_FORMAT, timeInfo);
471
472 if (length != TIME_LENGTH - 1) {
473 ALOGE("Couldn't format time; abandoning boot animation clock");
474 mClockEnabled = false;
475 return;
476 }
477
478 glEnable(GL_BLEND); // Allow us to draw on top of the animation
479 glBindTexture(GL_TEXTURE_2D, clockTex.name);
480
481 int xPos = (mWidth - TIME_WIDTH) / 2;
482 int cropRect[4] = { 0, DIGIT_HEIGHT, DIGIT_WIDTH, -DIGIT_HEIGHT };
483
484 for (int i = 0; i < TIME_LENGTH - 1; i++) {
485 char c = timeBuff[i];
486 int width = DIGIT_WIDTH;
487 int pos = c - '0'; // Position in the character list
488 if (pos < 0 || pos > 10) {
489 continue;
490 }
491 if (c == ':') {
492 width = COLON_WIDTH;
493 }
494
495 // Crop the texture to only the pixels in the current glyph
496 int left = pos * DIGIT_WIDTH;
497 cropRect[0] = left;
498 cropRect[2] = width;
499 glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, cropRect);
500
501 glDrawTexiOES(xPos, yPos, 0, width, DIGIT_HEIGHT);
502
503 xPos += width;
504 }
505
506 glDisable(GL_BLEND); // Return to the animation's default behaviour
507 glBindTexture(GL_TEXTURE_2D, 0);
508}
509
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700510bool BootAnimation::parseAnimationDesc(Animation& animation)
Mathias Agopiana8826d62009-10-01 03:10:14 -0700511{
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700512 String8 desString;
513
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700514 if (!readFile(animation.zip, "desc.txt", desString)) {
Narayan Kamathafd31e02013-12-03 13:16:03 +0000515 return false;
516 }
Mathias Agopiana8826d62009-10-01 03:10:14 -0700517 char const* s = desString.string();
518
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700519 // Create and initialize an AudioPlayer if we have an audio_conf.txt file
520 String8 audioConf;
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700521 if (readFile(animation.zip, "audio_conf.txt", audioConf)) {
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700522 mAudioPlayer = new AudioPlayer;
523 if (!mAudioPlayer->init(audioConf.string())) {
524 ALOGE("mAudioPlayer.init failed");
525 mAudioPlayer = NULL;
526 }
527 }
528
Mathias Agopiana8826d62009-10-01 03:10:14 -0700529 // Parse the description file
530 for (;;) {
531 const char* endl = strstr(s, "\n");
Andreas Gampecfedceb2014-09-30 21:48:18 -0700532 if (endl == NULL) break;
Mathias Agopiana8826d62009-10-01 03:10:14 -0700533 String8 line(s, endl - s);
534 const char* l = line.string();
Damien Bargiacchia704b7d2016-02-16 16:55:49 -0800535 int fps = 0;
536 int width = 0;
537 int height = 0;
538 int count = 0;
539 int pause = 0;
540 int clockPosY = -1;
Narayan Kamathafd31e02013-12-03 13:16:03 +0000541 char path[ANIM_ENTRY_NAME_MAX];
Jesse Hall083b84c2014-09-22 10:51:09 -0700542 char color[7] = "000000"; // default to black if unspecified
543
Kevin Hesterd3782b22012-04-26 10:38:55 -0700544 char pathType;
Mathias Agopiana8826d62009-10-01 03:10:14 -0700545 if (sscanf(l, "%d %d %d", &width, &height, &fps) == 3) {
Jesse Hall083b84c2014-09-22 10:51:09 -0700546 // ALOGD("> w=%d, h=%d, fps=%d", width, height, fps);
Mathias Agopiana8826d62009-10-01 03:10:14 -0700547 animation.width = width;
548 animation.height = height;
549 animation.fps = fps;
Damien Bargiacchia704b7d2016-02-16 16:55:49 -0800550 } else if (sscanf(l, " %c %d %d %s #%6s %d",
551 &pathType, &count, &pause, path, color, &clockPosY) >= 4) {
552 // ALOGD("> type=%c, count=%d, pause=%d, path=%s, color=%s, clockPosY=%d", pathType, count, pause, path, color, clockPosY);
Mathias Agopiana8826d62009-10-01 03:10:14 -0700553 Animation::Part part;
Kevin Hesterd3782b22012-04-26 10:38:55 -0700554 part.playUntilComplete = pathType == 'c';
Mathias Agopiana8826d62009-10-01 03:10:14 -0700555 part.count = count;
556 part.pause = pause;
557 part.path = path;
Damien Bargiacchia704b7d2016-02-16 16:55:49 -0800558 part.clockPosY = clockPosY;
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700559 part.audioFile = NULL;
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700560 part.animation = NULL;
Jesse Hall083b84c2014-09-22 10:51:09 -0700561 if (!parseColor(color, part.backgroundColor)) {
562 ALOGE("> invalid color '#%s'", color);
563 part.backgroundColor[0] = 0.0f;
564 part.backgroundColor[1] = 0.0f;
565 part.backgroundColor[2] = 0.0f;
566 }
Mathias Agopiana8826d62009-10-01 03:10:14 -0700567 animation.parts.add(part);
568 }
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700569 else if (strcmp(l, "$SYSTEM") == 0) {
570 // ALOGD("> SYSTEM");
571 Animation::Part part;
572 part.playUntilComplete = false;
573 part.count = 1;
574 part.pause = 0;
575 part.audioFile = NULL;
576 part.animation = loadAnimation(String8(SYSTEM_BOOTANIMATION_FILE));
577 if (part.animation != NULL)
578 animation.parts.add(part);
579 }
Mathias Agopiana8826d62009-10-01 03:10:14 -0700580 s = ++endl;
581 }
582
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700583 return true;
584}
585
586bool BootAnimation::preloadZip(Animation& animation)
587{
Mathias Agopiana8826d62009-10-01 03:10:14 -0700588 // read all the data structures
589 const size_t pcount = animation.parts.size();
Narayan Kamathafd31e02013-12-03 13:16:03 +0000590 void *cookie = NULL;
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700591 ZipFileRO* mZip = animation.zip;
Narayan Kamathafd31e02013-12-03 13:16:03 +0000592 if (!mZip->startIteration(&cookie)) {
593 return false;
594 }
595
596 ZipEntryRO entry;
597 char name[ANIM_ENTRY_NAME_MAX];
598 while ((entry = mZip->nextEntry(cookie)) != NULL) {
599 const int foundEntryName = mZip->getEntryFileName(entry, name, ANIM_ENTRY_NAME_MAX);
600 if (foundEntryName > ANIM_ENTRY_NAME_MAX || foundEntryName == -1) {
601 ALOGE("Error fetching entry file name");
602 continue;
603 }
604
605 const String8 entryName(name);
606 const String8 path(entryName.getPathDir());
607 const String8 leaf(entryName.getPathLeaf());
608 if (leaf.size() > 0) {
609 for (size_t j=0 ; j<pcount ; j++) {
610 if (path == animation.parts[j].path) {
Narayan Kamath4600dd02015-06-16 12:02:57 +0100611 uint16_t method;
Narayan Kamathafd31e02013-12-03 13:16:03 +0000612 // supports only stored png files
613 if (mZip->getEntryInfo(entry, &method, NULL, NULL, NULL, NULL, NULL)) {
614 if (method == ZipFileRO::kCompressStored) {
615 FileMap* map = mZip->createEntryFileMap(entry);
616 if (map) {
Narayan Kamathafd31e02013-12-03 13:16:03 +0000617 Animation::Part& part(animation.parts.editItemAt(j));
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700618 if (leaf == "audio.wav") {
619 // a part may have at most one audio file
620 part.audioFile = map;
621 } else {
622 Animation::Frame frame;
623 frame.name = leaf;
624 frame.map = map;
625 part.frames.add(frame);
626 }
Mathias Agopiana8826d62009-10-01 03:10:14 -0700627 }
628 }
629 }
630 }
631 }
632 }
633 }
634
Narayan Kamathafd31e02013-12-03 13:16:03 +0000635 mZip->endIteration(cookie);
636
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700637 return true;
638}
639
640bool BootAnimation::movie()
641{
642
643 Animation* animation = loadAnimation(mZipFileName);
644 if (animation == NULL)
645 return false;
646
Damien Bargiacchia704b7d2016-02-16 16:55:49 -0800647 // Blend required to draw time on top of animation frames.
648 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Mathias Agopiana8826d62009-10-01 03:10:14 -0700649 glShadeModel(GL_FLAT);
650 glDisable(GL_DITHER);
651 glDisable(GL_SCISSOR_TEST);
652 glDisable(GL_BLEND);
Mathias Agopiana8826d62009-10-01 03:10:14 -0700653
654 glBindTexture(GL_TEXTURE_2D, 0);
655 glEnable(GL_TEXTURE_2D);
656 glTexEnvx(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
657 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
658 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
659 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
660 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
661
Damien Bargiacchia704b7d2016-02-16 16:55:49 -0800662 bool clockTextureInitialized = false;
663 if (mClockEnabled) {
664 clockTextureInitialized = (initTexture(&mClock, mAssets, "images/clock64.png") == NO_ERROR);
665 mClockEnabled = clockTextureInitialized;
666 }
667
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700668 playAnimation(*animation);
669 releaseAnimation(animation);
670
Andriy Naborskyy815e51d2016-03-24 16:43:34 -0700671 if (clockTextureInitialized) {
672 glDeleteTextures(1, &mClock.name);
673 }
674
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700675 return false;
676}
677
678bool BootAnimation::playAnimation(const Animation& animation)
679{
680 const size_t pcount = animation.parts.size();
Mathias Agopiana8826d62009-10-01 03:10:14 -0700681 const int xc = (mWidth - animation.width) / 2;
682 const int yc = ((mHeight - animation.height) / 2);
Mathias Agopiana8826d62009-10-01 03:10:14 -0700683 nsecs_t frameDuration = s2ns(1) / animation.fps;
684
Mathias Agopian9f3020d2009-11-06 16:30:18 -0800685 Region clearReg(Rect(mWidth, mHeight));
686 clearReg.subtractSelf(Rect(xc, yc, xc+animation.width, yc+animation.height));
687
Narayan Kamathafd31e02013-12-03 13:16:03 +0000688 for (size_t i=0 ; i<pcount ; i++) {
Mathias Agopiana8826d62009-10-01 03:10:14 -0700689 const Animation::Part& part(animation.parts[i]);
690 const size_t fcount = part.frames.size();
691 glBindTexture(GL_TEXTURE_2D, 0);
692
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700693 // Handle animation package
694 if (part.animation != NULL) {
695 playAnimation(*part.animation);
696 if (exitPending())
697 break;
698 continue; //to next part
699 }
700
Mathias Agopiana8826d62009-10-01 03:10:14 -0700701 for (int r=0 ; !part.count || r<part.count ; r++) {
Kevin Hesterd3782b22012-04-26 10:38:55 -0700702 // Exit any non playuntil complete parts immediately
703 if(exitPending() && !part.playUntilComplete)
704 break;
705
Mike Lockwoodebf9a0d2014-10-02 16:08:47 -0700706 // only play audio file the first time we animate the part
707 if (r == 0 && mAudioPlayer != NULL && part.audioFile) {
708 mAudioPlayer->playFile(part.audioFile);
709 }
710
Jesse Hall083b84c2014-09-22 10:51:09 -0700711 glClearColor(
712 part.backgroundColor[0],
713 part.backgroundColor[1],
714 part.backgroundColor[2],
715 1.0f);
716
Narayan Kamathafd31e02013-12-03 13:16:03 +0000717 for (size_t j=0 ; j<fcount && (!exitPending() || part.playUntilComplete) ; j++) {
Mathias Agopiana8826d62009-10-01 03:10:14 -0700718 const Animation::Frame& frame(part.frames[j]);
Mathias Agopiandb7dd2a2012-05-12 15:08:21 -0700719 nsecs_t lastFrame = systemTime();
Mathias Agopiana8826d62009-10-01 03:10:14 -0700720
721 if (r > 0) {
722 glBindTexture(GL_TEXTURE_2D, frame.tid);
723 } else {
724 if (part.count != 1) {
725 glGenTextures(1, &frame.tid);
726 glBindTexture(GL_TEXTURE_2D, frame.tid);
727 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
728 glTexParameterx(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
729 }
Mykola Kondratenko0c1eeb32014-04-15 09:35:44 +0200730 initTexture(frame);
Mathias Agopiana8826d62009-10-01 03:10:14 -0700731 }
732
Mathias Agopian9f3020d2009-11-06 16:30:18 -0800733 if (!clearReg.isEmpty()) {
734 Region::const_iterator head(clearReg.begin());
735 Region::const_iterator tail(clearReg.end());
736 glEnable(GL_SCISSOR_TEST);
737 while (head != tail) {
Andreas Gampecfedceb2014-09-30 21:48:18 -0700738 const Rect& r2(*head++);
739 glScissor(r2.left, mHeight - r2.bottom,
740 r2.width(), r2.height());
Mathias Agopian9f3020d2009-11-06 16:30:18 -0800741 glClear(GL_COLOR_BUFFER_BIT);
742 }
743 glDisable(GL_SCISSOR_TEST);
744 }
Chris Elliottd13d5042015-05-04 15:24:12 -0700745 // specify the y center as ceiling((mHeight - animation.height) / 2)
746 // which is equivalent to mHeight - (yc + animation.height)
747 glDrawTexiOES(xc, mHeight - (yc + animation.height),
748 0, animation.width, animation.height);
Damien Bargiacchia704b7d2016-02-16 16:55:49 -0800749 if (mClockEnabled && part.clockPosY >= 0) {
750 drawTime(mClock, part.clockPosY);
751 }
752
Mathias Agopiana8826d62009-10-01 03:10:14 -0700753 eglSwapBuffers(mDisplay, mSurface);
754
755 nsecs_t now = systemTime();
756 nsecs_t delay = frameDuration - (now - lastFrame);
Mathias Agopiandb7dd2a2012-05-12 15:08:21 -0700757 //ALOGD("%lld, %lld", ns2ms(now - lastFrame), ns2ms(delay));
Mathias Agopiana8826d62009-10-01 03:10:14 -0700758 lastFrame = now;
Mathias Agopiandb7dd2a2012-05-12 15:08:21 -0700759
760 if (delay > 0) {
761 struct timespec spec;
762 spec.tv_sec = (now + delay) / 1000000000;
763 spec.tv_nsec = (now + delay) % 1000000000;
764 int err;
765 do {
766 err = clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &spec, NULL);
767 } while (err<0 && errno == EINTR);
768 }
Kevin Hesterd3782b22012-04-26 10:38:55 -0700769
770 checkExit();
Mathias Agopiana8826d62009-10-01 03:10:14 -0700771 }
Kevin Hesterd3782b22012-04-26 10:38:55 -0700772
Mathias Agopiana8826d62009-10-01 03:10:14 -0700773 usleep(part.pause * ns2us(frameDuration));
Kevin Hesterd3782b22012-04-26 10:38:55 -0700774
775 // For infinite parts, we've now played them at least once, so perhaps exit
776 if(exitPending() && !part.count)
777 break;
Mathias Agopiana8826d62009-10-01 03:10:14 -0700778 }
779
780 // free the textures for this part
781 if (part.count != 1) {
Narayan Kamathafd31e02013-12-03 13:16:03 +0000782 for (size_t j=0 ; j<fcount ; j++) {
Mathias Agopiana8826d62009-10-01 03:10:14 -0700783 const Animation::Frame& frame(part.frames[j]);
784 glDeleteTextures(1, &frame.tid);
785 }
786 }
787 }
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700788 return true;
Mathias Agopiana8826d62009-10-01 03:10:14 -0700789}
790
Andriy Naborskyy39218ba2015-08-16 21:32:50 -0700791void BootAnimation::releaseAnimation(Animation* animation) const
792{
793 for (Vector<Animation::Part>::iterator it = animation->parts.begin(),
794 e = animation->parts.end(); it != e; ++it) {
795 if (it->animation)
796 releaseAnimation(it->animation);
797 }
798 if (animation->zip)
799 delete animation->zip;
800 delete animation;
801}
802
803BootAnimation::Animation* BootAnimation::loadAnimation(const String8& fn)
804{
805 if (mLoadedFiles.indexOf(fn) >= 0) {
806 ALOGE("File \"%s\" is already loaded. Cyclic ref is not allowed",
807 fn.string());
808 return NULL;
809 }
810 ZipFileRO *zip = ZipFileRO::open(fn);
811 if (zip == NULL) {
812 ALOGE("Failed to open animation zip \"%s\": %s",
813 fn.string(), strerror(errno));
814 return NULL;
815 }
816
817 Animation *animation = new Animation;
818 animation->fileName = fn;
819 animation->zip = zip;
820 mLoadedFiles.add(animation->fileName);
821
822 parseAnimationDesc(*animation);
823 preloadZip(*animation);
824
825 mLoadedFiles.remove(fn);
826 return animation;
827}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800828// ---------------------------------------------------------------------------
829
830}
831; // namespace android