summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/BootAnimation.h
Commit message (Collapse)AuthorAgeFilesLines
* Set orientation for boot animation and default display rotation.Mariia Sandrikova2022-12-191-0/+4
| | | | | | | | | | | Change the default display rotation value and boot animation orientation to the value specified in the sysprop ro.bootanim.set_orientation_<display_id>. Four values are supported: ORIENTATION_0, ORIENTATION_90, ORIENTATION_180 and ORIENTATION_270. If the value isn't specified or is ORIENTATION_0, nothing will be changed. This is needed to support having default rotation behavior and boot animation in orientation different from the natural device orientation. For example, on tablets that may want to keep natural orientation portrait for applications compatibility but have landscape orientation as a default choice from the UX perspective. Bug: 260627934 Test: manual test with all 4 values and atest WmTests still pass Change-Id: I322919999ef787ff2c149293d7e1c7e669796c9a
* bootanimation: correct logo position and size after resolution changedjoenchen2022-04-191-0/+2
| | | | | | | | | | | The resolution may be changed while the boot animation is playing. mInitWidth and mInitHeight store the original resolution, and then the animation coordinate and size are recalculated according to the ratio (mWidth/mInitWidth and mHeight/mInitHeight). Bug: 228605923 Test: change resolution and then reboot to check the animation Change-Id: Id09490ecf7fc4b3e1a6baf073c134f357e9b327f
* Reload color sysprops after failingLucas Dupin2022-03-291-0/+1
| | | | | | | | | | | | During OTA, sysprops aren't load as fast as during regular boot. This causes the animation to not be able to pick up the dynamic colors. We can mitigate this issue by trying to reload the sysprops at the beginning of each animation part. Test: manual Bug: 227381265 Change-Id: I4397079aacc52acb5cda54a925f70e4f5c745b3f
* Change the bootanim time file location.Josh Yang2021-12-231-1/+1
| | | | | | | | | | This change moves the bootanim time file location from /data/system/time to /data/bootanim/time. This change helps us remove the access to system_data_file from bootanim. Bug: 210757252 Test: Boot animation can show time. No SELinux violations. Change-Id: Ie61155f8976f3b8c6ad5ceac1826140c1455ad54
* Support rendering white pixels.Shan Huang2021-08-261-0/+2
| | | | | | | | | | This CL allows dynamic color boot animations to render graphics in shades of white. Bug: 190093578 Test: adb shell stop; adb shell start. Complete reboot to see the full sequence (including the loader part) Change-Id: I672a49aff90fa04daa4bdd6fd3c0b5497cc1a115
* Move boot color sysprop parsing to after loading zips.Shan Huang2021-08-191-0/+1
| | | | | | | | | | | | | | Otherwise the sysprops would not be loaded yet and accessing them would return empty strings. Though unlikely, this is not 100% safe because boot color sysprops are not guaranteed to be loaded by the time zips are loaded. A TODO here is to understand boot steps and their timing implications so that we can fully avoid the race condition. Bug: 190093578 Test: adb shell setprop persist.bootanim.color(1-4), then reboot phone. Change-Id: I603da080b1732a436a10dbaca6f2be9f158124dc
* Revert "Revert "Revert "Revert "Implement dynamic colors for boot animation.""""Shan Huang2021-08-181-4/+15
| | | | | | | | | | This reverts commit ad9cf52df959489b615f30cbf072415b3352063b. Reason for revert: Fixing broken atv test Test: atv atp test tv/platform/simple_boot_test Bug: 190093578 Change-Id: I9d6ecb6024ce49eef8007458b0d9bf0ff24906c7
* Revert "Revert "Migrate boot animation from GLES 1.0 to GLES2.0.""Lucas Dupin2021-08-161-1/+9
| | | | | | | | | | | This reverts commit 2ded80094ee534cfbf360e89562f9d6f1cee33e0. Reason for revert: Working on fixing the regression that happened on Wembly, so we can resume feature work. Change-Id: I9a624beffdaf97f131046fd4441a251ed3a448ad Test: adb shell /system/bin/bootanimation Bug: 190093578 (cherry picked from commit 8eedc0293d53d31f96c2f9cd2f773149aaf5d63f)
* Merge "bootanimation: ensure that if a percent is shown, we'll get to 100." ↵Nicolas Geoffray2021-04-211-1/+2
|\ | | | | | | | | | | | | | | am: 87c254de0e am: 10e844df41 am: 55b2ba298c Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1681127 Change-Id: I1ee402945af4207affb77d61eb76a21c175ac1fc
| * bootanimation: ensure that if a percent is shown, we'll get to 100.Nicolas Geoffray2021-04-201-1/+2
| | | | | | | | | | | | | | | | Seeing 100 while booting is not finished, or seeing eg 90 while booting is not finished isn't user-friendly. Test: update ART module, see percent progress Change-Id: I5509c83f661f937f00a7d28c789df509e3528a37
| * Support for showing percent progress in boot animation.Nicolas Geoffray2021-01-111-0/+3
| | | | | | | | | | | | | | | | Bug: 175686819 Test: boot with manual changes updating the progress Change-Id: I2d936e3391f56796308c90deb39ecacc58797721 Merged-In: I2d936e3391f56796308c90deb39ecacc58797721
| * Support animation parts fading outYegor Malyshev2020-10-191-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This support helps with several things: - simpler animation structure (size, number of items) - more room for designers avoiding thinking about exit part - time saving as complete parts now can be safely used as fading parts Bug: 167352662 Test: Manual testing of major/edge cases - backward compatibility => "f 0" is mapped to "p", "p" still works - only trimmed areas are faded out - clock is not faded out (wear case) - adb shell su root bootanimation - [c, (exit) f 120, c] => "f 120" fades out and "c" completes - [c, (exit) f 120, f 320] => "f 120" fades out and "f 320" skipped - [c, f 16, (exit) f 120] => "f 16" played, "f 120" fades out - [c, (exit) f 0, f 120] => "f 0" skipped, "f 120" fades out Change-Id: I9b200ee7107ef9b3dc8d711658ed1042b83739c2 Merged-In: I9b200ee7107ef9b3dc8d711658ed1042b83739c2
* | Support for showing percent progress in boot animation.Nicolas Geoffray2021-01-081-0/+3
| | | | | | | | | | | | | | Bug: 175686819 Test: boot with manual changes updating the progress Change-Id: I2d936e3391f56796308c90deb39ecacc58797721
* | Support animation parts fading outYegor Malyshev2020-09-211-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This support helps with several things: - simpler animation structure (size, number of items) - more room for designers avoiding thinking about exit part - time saving as complete parts now can be safely used as fading parts Bug: 167352662 Test: Manual testing of major/edge cases - backward compatibility => "f 0" is mapped to "p", "p" still works - only trimmed areas are faded out - clock is not faded out (wear case) - adb shell su root bootanimation - [c, (exit) f 120, c] => "f 120" fades out and "c" completes - [c, (exit) f 120, f 320] => "f 120" fades out and "f 320" skipped - [c, f 16, (exit) f 120] => "f 16" played, "f 120" fades out - [c, (exit) f 0, f 120] => "f 0" skipped, "f 120" fades out Change-Id: I9b200ee7107ef9b3dc8d711658ed1042b83739c2
* | Merge "Render boot animation with same size as framebuffer" into rvc-dev am: ↵TreeHugger Robot2020-06-021-0/+3
|\| | | | | | | | | | | | | | | cbea0ab58f am: 937a25de15 am: 35ae2778c3 am: 3c1b9ad9af Original change: undetermined Change-Id: I1ae7b19afe2e88fc1a7fd32c41fb870e80685ff8
| * Render boot animation with same size as framebufferMarin Shalamanov2020-05-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When ro.surface_flinger.max_graphics_{width|height} is set the framebuffer size is limited by this property. However the boot animation size matches the display active mode size which can cause it to be off-center or partially visible. This change limits the boot animation surface size with accordance with ro.surface_flinger.max_graphics_width. Bug: 153991408 Test: manual Change-Id: Idfd1c9adc1f6b10f44bc04ec2078dbc823f28ed6
| * Resize boot animation on display changesMarin Shalamanov2020-05-271-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use DisplayEventReceiver to listen for display hotplug events and resize the boot animation is display size changes. Bug: 156448328 Test: manually make sure the boot animation has correct dimensions in the following cases I. With boot animation file 1. scrcpy 2. start boot animation with adb shell /system/bin/bootanimation when no physical display is connected (= 480p fake HWC display). Use the virtual display from scrcpy to check the boot animation size. 3. connect a 1080p display (HWC sends hotplug connect to change the display) 4. disconnect the real display II. Same steps without boot animation file (android logo should be displayed) Merged-In: Ib3f0383686399669e8de10456092baaec607fa01 Change-Id: Ib3f0383686399669e8de10456092baaec607fa01
* | Resize boot animation on display changesMarin Shalamanov2020-05-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use DisplayEventReceiver to listen for display hotplug events and resize the boot animation is display size changes. Bug: 156448328 Test: manually make sure the boot animation has correct dimensions in the following cases I. With boot animation file 1. scrcpy 2. start boot animation with adb shell /system/bin/bootanimation when no physical display is connected (= 480p fake HWC display). Use the virtual display from scrcpy to check the boot animation size. 3. connect a 1080p display (HWC sends hotplug connect to change the display) 4. disconnect the real display II. Same steps without boot animation file (android logo should be displayed) Change-Id: Ib3f0383686399669e8de10456092baaec607fa01
* | Use public APIs for decoding images for the boot animationDerek Sollenberger2020-04-081-2/+0
|/ | | | | | | | | HWUI is restricting access to only a set of stable C APIs. Callers like boot animation are being converted to either the stable C or NDK APIs. Test: build and verify animation on reboot Bug: 150782769 Change-Id: I1fb7c9e0ed2f7bcecec109ddc32b1c5a473f7f3a
* Add a way to customize boot animation during userspace rebootNikita Ioffe2020-01-281-0/+3
| | | | | | | | | In case userspace reboot boot animation can't be found, a default Android logo is going to be shown. Test: adb reboot userspace Bug: 148172262 Change-Id: Ida12ffcfe73b335b63178f3e3f2b0c4063dae2c2
* Preload zip before waiting for surface flingerHuihong Luo2019-02-141-0/+4
| | | | | | | | | | | | | | This saves about 200 msec by preloading media zip file before waiting for surface flinger becomes ready. Android Auto results: BootAnimation: BootAnimationPreloadTiming start time: 8261ms BootAnimation: BootAnimationPreloadStopTiming start time: 8508ms Bug: 62056504 Test: adb logcat -s BootAnimation Change-Id: Iaedf774983a66c2838452c45a04b3a1f4c728f17
* Generalize physical display managementDominik Laskowski2019-02-041-0/+1
| | | | | | | | | | | | | This CL enables the framework to manage an arbitrary number of physical displays. It also surfaces physical display IDs, which are stable across reboots and encode (model, port) information that will be propagated further up in a follow-up CL. Bug: 116025192 Test: Boot with more than two displays Test: Hotplug works with any number of displays Test: Verify stable display IDs with "dumpsys display" Change-Id: Idb2eaff66b2e0873be6ad27d337ff18b730d1331
* Merge "Fix/suppress bootanimation google-explicit-constructor warnings" am: ↵Chih-hung Hsieh2019-01-021-2/+2
|\ | | | | | | | | | | | | | | 50ee220126 am: b737b4fdb3 am: 05ae400a06 Change-Id: I2380f3e0467e1b9c4a8c36f31a2c4c8f45e893b0
| * Fix/suppress bootanimation google-explicit-constructor warningsChih-Hung Hsieh2019-01-021-2/+2
| | | | | | | | | | | | | | | | * Add explicit to conversion constructors/operators Bug: 28341362 Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor Change-Id: Ia6ada49250973d507ae8b10d8f0d7c2d47ee805c
* | Merge "BootAnimation: Fix boot animation with hidden cutout" into pi-dev am: ↵Jorim Jaggi2018-08-221-0/+4
|\| | | | | | | | | | | | | | | e387ce18d8 am: 2c68abc9fc Change-Id: I1a0db9f30f7270d49136fa3984dc8d9633ead690
| * BootAnimation: Fix boot animation with hidden cutoutAdrian Roos2018-08-221-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | We do this by storing the masking inset in a persistent property. The boot animation then animates itself to where it would be if that masking inset were applied, then changes the viewport. For this to work, we also need to make sure the DisplayManagerService has the right overlay right at the start. Bug: 112876936 Test: Hide cutout, then reboot. Verify boot animation is smooth. Change-Id: I3e988b2340b2e0d2be3939bdc6878704c234ccc8
* | Refactor audio code out of bootanimation_main.Ed Coyne2018-05-311-0/+1
|/ | | | | | | | | | | So it can be shared with the iot/ variant I refactored it into the audioplay.h file. This keeps all of the audio code local, we could hide the functions and only expose the callback but that would make testing harder. Test: Ran a bootanimation.zip with audio.wav on Marlin, works as expected. Bug: 67051984 Change-Id: Ie31dc5f2cfaad5bb23134ef81be712afa6b3cd6f
* Allow IO During boot process, BootActions.Ed Coyne2017-06-191-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | NOTE: this is only compiled into products with PRODUCT_IOT=true. Introduce BootActions that a developer can provide to manipulate IO before the android framework comes up on boot. We will look for a configuration file at /oem/app/etc/boot_action.conf and expect it to tell us the name of a shared library. We will then fetch this library from /oem/app/lib/${arch}/ and load it. We expect it to export boot_action_init(), boot_action_shutdown(), and optionally boot_action_start_part(int partNumber, int playNumber). We will then call boot_action_init() during boot after PeripheralManager is up and call boot_action_shutdown() when the android framework is up and we are going to start loading APKs. We will also call boot_action_start_part(*) when each part of the boot animation is started, use this if you want to synchronize the boot action and the boot animation. Boot actions run in a restricted environment and in general can only make calls to PeripheralManager. Bug: 37992717 Test: Pushed to local imx7d to test boot actions, pushed to bullhead test that animation+sound still works. Change-Id: I9e53a17567f8028ea84486d637e1d231ee1125e1
* Refactor bootanimation into a shared lib.Ed Coyne2017-05-311-41/+45
| | | | | | | | | | | We would like to reuse the animation parts of it in Android things. This refactors the audio part into the _main and gets callbacks from the BootAnimation class at interesting times. This will be the same approach we take to integrate with it. BUG: 37992717 Test: Built locally and pushed to a bullhead, works with sound. Change-Id: I5eaca07c25eeb5edeab07d7ae7a29945e0e2cd37
* support shutdown animation from bootanimKeun-young Park2017-04-031-0/+1
| | | | | | | | | | | | | | | - init will set sys.powerctl property and run bootanim. - Use /oem/media/shutdownanimation.zip or /system/media/shutdownanimation.zip for animation file. If none of them exist, android animation will be used. - Disable audio playing for shutdown animation. - Disable TimeCheckThread for shutdown animation. It accesses /data partition and can block umount. bug: 36526187 Test: many reboots Change-Id: If02c73cda2015317d88d056cd45201208da49946
* Initialize bootanimation sound on separate threadGeoffrey Pitsch2017-01-311-3/+13
| | | | | | | Blocks when it's time to play the first sound. Bug: 30189706 Test: on marlin Change-Id: Ib3666fbfb5f109c633ed59edad4a283b8ada8ae2
* Allow boot clock to be toggled between 12 and 24 hour formatDamien Bargiacchi2016-10-281-0/+1
| | | | | Bug: 32461548 Change-Id: I414192e6d9f3ae44267f4a360e35647f18c420b4
* Allow custom fonts in the boot animaiton zip fileDamien Bargiacchi2016-09-051-5/+19
| | | | | | | Change the font format to be a 16x6 grid of characters Bug: 29580875 Change-Id: Ia468307cb9770436e8ae865c91acda23a71bde05
* Suppress Boot sound for non-standard scenarios.Geoffrey Pitsch2016-08-101-0/+2
| | | | | | | | | Blacklisted bootreasons will not play a sound (e.g. "kernel_panic") If boot has already completed, assume this is a runtime restart and skip the sound. Bug: 30654343 Change-Id: I41b1829a93c0d9a63c69aea2d1614eaa18b72230
* Merge "OpenSL-based audio support for BootAnimation" into nyc-mr1-devGeoffrey Pitsch2016-07-121-3/+2
|\
| * OpenSL-based audio support for BootAnimationGeoffrey Pitsch2016-07-061-3/+2
| | | | | | | | | | | | | | | | | | | | Respects dnd settings for sound playback. Basic implementation uses in-memory wavs as buffers. audioplay::playClip should not be called before previous clip ends. Updated FORMAT.md to reflect no more audio_conf.txt Bug: 29055299 Change-Id: Ifc358d7c85f11b8b54ae6446c40643b87bc567f2
* | BootAnimation: Use npot texturesSai Kiran Korwar2016-07-111-0/+1
|/ | | | | | | | | | | If non power of two textures are supported, then use npot texture for specifying the images supplied by vendor. This will reduce the memory footprint of the app by a considerable amount. Bug: 28865582 Bug: 30040263 Change-Id: I5cef98fb013318d60d8a648041c9665da68c0ff3
* Support trimmed images in BootAnimationGeoffrey Pitsch2016-06-291-0/+5
| | | | | | | | | Each frame directory may optionally contain a `trim.txt` to specify how the image was trimmed relative to the animation's full size. See FORMAT.md for more details. Bug: 29055299 Change-Id: I7a291e9a52b4bbe50a29c519f6a4d0e2cc0389d7
* Check clock accuracy before attempting to display clockDamien Bargiacchi2016-05-121-0/+20
| | | | | | | | | | | The RTC may not be set yet, may have been reset, or may have drifted significantly if the device time hasn't been updated in a long time. Using the the last_time_change file to determine if the time is known to be accurate and only display the clock when that is the case. Bug: 27802041 Change-Id: I845cf9c74fcb4009504f1bab853e04146fa19e1d
* resolve merge conflicts of 0c7535b to nyc-devAndriy Naborskyy2016-03-241-2/+11
|\ | | | | | | Change-Id: I49fa42e0d78aeaa8127cefc5cc5122cf37fce878
| * bootanimation: implement split packaging of animationAndriy Naborskyy2016-03-221-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Animation package zip can be separated into OEM and SYSTEM OEM desc.txt can use new command "$SYSTEM" to invoke animation from SYSTEM package Changes to animation structure: 1. animation can refer other animation 2. animation contains zip file reference 3. BootAnimation has name of root of animation Zip; processing desc.txt we need filename of container zip and we can't access it from ZipFileRO instance movie() changes: 1. Split movie() into loading Zip and playing part 2. load parses desc.txt and if needed referred Zip 3. play can descend animations tree Change-Id: I600d02c84d537df7b3e32a84f84a294b26e319e0 Signed-off-by: Andriy Naborskyy <andriyn@google.com>
* | Draw a clock on top of the Android boot animationDamien Bargiacchi2016-03-071-2/+7
|/ | | | | | | | Don't draw on top of vendor specific animations/logos since we can't make it look good. Bug: 27209004 Change-Id: If4791b861ff476c23b37787ba896a3ef8d9df4fd
* Add support for playing audio during bootanimationMike Lockwood2014-10-031-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bootanimation daemon will play 16 bit WAV files contained in bootanimation.zip For this to work, the bootanimation.zip must contain an audio_conf.txt file, which contains parameters to be used for the tinyalsa pcm_open call as well as mixer parameters to set before attempting to play the sound. If the bootanimation finds an audio_conf.txt file, then it will look for a file named "audio.wav" in each of the part subdirectories. If audio.wav is found, it will play that WAV file starting at the beginning of that part. The code for this is based on the tinyplay utility in tinyalsa. The audio_conf.txt and must begin with the following header: card=<ALSA card number> device=<ALSA device number> period_size=<period size> period_count=<period count> This header is followed by zero or more mixer settings, each with the format: mixer "<name>" = <value list> Since mixer names can contain spaces, the name must be enclosed in double quotes. The values in the value list can be integers, booleans (represented by 0 or 1) or strings for enum values. Finally I should mention that this change is not the right approach. Instead of going straight to ALSA we should be using the mediaserver instead. But mediaserver isn't ready in time due to interactions with the system server, and there isn't time to fix this for the current release. We need to fix that for the next one. Bug: 17674304 Change-Id: Ic391ade61c941d0a24f4d64fe005ac9375a23fa9
* bootanimation: allow animation to specify background colorJesse Hall2014-09-251-0/+1
| | | | | | | | | | | | Some OEMs want to have a bootanimation (or parts of it) displayed on a color other than black. They currently just use full-screen frames for that, which wastes lots of memory and bandwidth. This change allows each part of the animation to specify a background color that will be applied outside of the frame images; if unspecified the background will be black as it is now. Bug: 16635599 Change-Id: Ibf008fc75c5aad891c86ba9e4ec0879b7a61b8bd
* Freeing frame mapMykola Kondratenko2014-04-301-1/+1
| | | | | | | | | FileMap memory is never released until application exit Release it now as the texture is already loaded and the memory used for the packed resource can be released. Change-Id: Id08a1e466337b3a0179684eb6a444e18147ee343
* Reimplement ZipFileRO in terms of libziparchive.Narayan Kamath2013-12-091-2/+1
| | | | | | | | | | | | | | | | This lets us share zip archive processing code with both the runtime (Art, dalvik) and critical java code (StrictJarFile). This change also moves several utility methods to ZipUtils and dedups code across several zip inflation methods. One of the side effects of this change is that several processing loops are now O(n) instead of O(n^2). bug: 10193060 Change-Id: I3c7188496837a47246c4f342e45485a70fef3169
* Exit boot animation cleanly.Kevin Hester2012-06-191-0/+3
| | | | | | | | | | | | | | | The desc.txt file can now mark parts as 'must finish cleanly' by using 'c' as the part line prefix rather than 'p'. If so indicated, if the bootanimation is asked to quit it will do so only after waiting to finish that part. I considered either making init.c service killing smarter or promoting bootanim to be a bindable service with a requestExit method. However, these changes are probably too big/risky given our ship date. So I used a property as a mailbox between SurfaceFlinger and bootanim. Bug: 6679877 Change-Id: I1f8dd9e7da1ea80a483b31fa14c4a5645922d774
* fix libgui header locationMathias Agopian2012-02-271-4/+3
| | | | Change-Id: Iec71706cdd4f29c6904993648ce873e83ef9cafe
* frameworks/base refactoring.Mathias Agopian2012-02-171-1/+1
| | | | | | step 2: move libutils headers to their new home: androidfw Change-Id: I14624ba23db92a81f2cb929f104386e1fab293ef
* split libsurfaceflinger_client and libcamera_client out of libuiMathias Agopian2010-02-111-2/+2
|