summaryrefslogtreecommitdiff
path: root/cmds/bootanimation/BootAnimation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Set orientation for boot animation and default display rotation.Mariia Sandrikova2022-12-191-0/+53
| | | | | | | | | | | 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
* Fix boot animation alpha multiplication computationsAndrew Zeng2022-11-081-15/+15
| | | | | | | | | | | | | | | | | Previously, this was resulting in the output color roughtly as output_n = color_n * mask_n^2 * (mask_0 + mask_1 + mask_2 + mask_3) where n is a color channel between 0 and 3. This caused extra aliasing around edges, since the alpha fades too quickly along an edge. Bug: 239632466 Bug: 258246539 Test: verify pixel values for boot animation match mask on watch + phone Test: modify uFade value, verify pixel colors match Change-Id: I86742a181576e684aa698a190a8766f4223de799
* Try to load colors more frequentlyLucas Dupin2022-04-251-8/+21
| | | | | | | | | | | | During OTA, sysprops aren't available as early in the boot process. This causes the boot animation to not have dynamic colors. This CL tries to load the colors more frequently, at every part loop. Before we'd only try on the first frame of each animation part. Test: adb shell bootanimation Fixes: 229029861 Change-Id: I1bbebf93b4fbc31d945c4181472576cf29f13bc7
* bootanimation: correct logo position and size after resolution changedjoenchen2022-04-201-8/+15
| | | | | | | | | | | | | 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 (cherry picked from commit 764ea0442141b4b961bb6c6af18e66cfaa617b7f) Merged-In: Id09490ecf7fc4b3e1a6baf073c134f357e9b327f
* Reload color sysprops after failingLucas Dupin2022-03-291-3/+13
| | | | | | | | | | | | 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
* Merge "Add additional logs for bootanimation" am: 51a4954076 am: 4aa84137f0 ↵Treehugger Robot2022-03-041-0/+10
|\ | | | | | | | | | | | | | | am: a73e533986 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991970 Change-Id: Ia36255c49f4323125ac37b812b28a87091c8cd79
| * Add additional logs for bootanimationYoshiaki Maruoka2022-03-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | The information will be printed - Message if no animation file - File name when it's loaded - Image name and path, loop information when playing - Play time at the end Bug: 220161782 Test: Manual, check logcat with and without bootanimation.zip Change-Id: I0e16bdeb4456a423649a27f7ae88f256e3fa3d19
* | Change the bootanim time file location.Josh Yang2021-12-231-14/+14
| | | | | | | | | | | | | | | | | | | | 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
* | Merge "Enable clock only when supported by product"Thiebaud Weksteen2021-12-131-0/+3
|\ \
| * | Enable clock only when supported by productThiébaud Weksteen2021-11-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 9748086, a detection for clock drifting was implemented. It relies on 2 files that must be provided by the product (/data/system/time/last_time_change and /data/system/time/time_is_accurate). Generally, these files are not available which triggers an SELinux denial error message. Introduce a new property ("persist.sys.bootanim.clock.enabled") which can be set by a product to enable this feature (default is false). For future reference, it is not sufficient to only enable this property, the product must also provide the files described above (see BootAnimation::updateIsTimeAccurate). Bug: 62954877 Test: lunch r11-userdebug && m Change-Id: Ia27e69547e3d898925029dc0c2be4ad717891c57
* | | Merge "Fix nanosleep in BootAnimation" am: 45e281ef2b am: 73357c61d0 am: ↵Keith Mok2021-11-191-1/+1
|\ \ \ | |/ / |/| / | |/ | | | | | | | | fd42131e14 am: c42a8a0793 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1891586 Change-Id: Iebc79f0ba23152c05de1f456fec984e225c1ea03
| * Merge "Fix nanosleep in BootAnimation" am: 45e281ef2bKeith Mok2021-11-191-1/+1
| |\ | | | | | | | | | | | | | | | Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1891586 Change-Id: I19f359a175aa9596f400481029c029c2dd908aa5
| | * Fix nanosleep in BootAnimationKeith Mok2021-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | clock_nanosleep will return 0 or error no directly. Bug: 207149564 Test: Build ok Change-Id: I15866728719d0672a16b4a76a8fd3be4d53d420a
* | | Merge "Fix AOSP boot animation black screen issue." into sc-qpr1-dev am: ↵TreeHugger Robot2021-09-101-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | 6d673f1f9a am: e277f0ded5 am: 1b45e9c5fc Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15799420 Change-Id: I77b788dea2058df0109ee9e38c924416bf230500
| * | Merge "Fix AOSP boot animation black screen issue." into sc-qpr1-devTreeHugger Robot2021-09-101-0/+2
| |\ \
| | * | Fix AOSP boot animation black screen issue.Shan Huang2021-09-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 197740038 Test: Force stock android animation on a pixel phone in BootAnimation.cpp. (Remember to disable dynamic coloring.) Check stock android animation. Change-Id: I3c3979c344a351ec261bb12127cff971d6050367
* | | | Merge "Fixes boot animation not appearing issue on Oriole." into sc-qpr1-dev ↵TreeHugger Robot2021-09-091-2/+7
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | am: 3a986bb956 am: 580ae422b6 am: 8dbf247294 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15779528 Change-Id: I4501403e20e0a3b50af1629a3d01b8a20d0cefaa
| * | | Fixes boot animation not appearing issue on Oriole.Shan Huang2021-09-071-2/+7
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Test: Flash the updated animation to device. Reboot and check if the animation shows up. Bug:199179989 Fixes:199179989 Change-Id: Ic2a2496efcaca4b6ae90c167498b8cd794b46bea
* | | Merge "Support rendering white pixels." into sc-qpr1-dev am: e2f4ad3e7b am: ↵Shan Huang2021-08-271-8/+29
|\| | | | | | | | | | | | | | | | | | | | | | | cfb0fe05a5 am: fbe437bd10 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15676845 Change-Id: I2f98a90333e19cda3b22229a90a8112dc0e999a2
| * | Support rendering white pixels.Shan Huang2021-08-261-8/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | BootAnimation: remove superfluous null check for `mAnimation`George Burgess IV2021-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The null check added in I603da080b1732a436a10dbaca6f2be9f158124dc makes our static analyzer suspect that the call to `playAnimation(*mAnimation)` dereferences null. The beginning of this function establishes a non-null value for `mAnimation`, which is used unconditionally throughout the function. Hence, this condition seems unnecessary. Bug: None Test: TreeHugger Change-Id: I0575df17df7f7e3018d99cafd9dcfcd3c10e5fbc
* | | Merge "Move boot color sysprop parsing to after loading zips." into ↵Shan Huang2021-08-191-22/+0
|\| | | | | | | | | | | | | | | | | | | | | | | sc-qpr1-dev am: a1c0f6dd41 am: 28c7d63d16 am: a332213f93 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15600978 Change-Id: I5ad79c95f2098d4876f691d74541948468647ed3
| * | Move boot color sysprop parsing to after loading zips.Shan Huang2021-08-191-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Revert "Revert "Revert "Revert "Implement dynamic colors for boot ↵Shan Huang2021-08-191-0/+22
|\| | | | | | | | | | | | | | | | | | | | | | | animation.""""" into sc-qpr1-dev am: 813c29b9a5 am: 9d7c1b7163 am: ba48d5a0f9 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15600806 Change-Id: I8478388303170a00c288e37274e9560c817d52f6
| * | Revert "Revert "Revert "Revert "Implement dynamic colors for boot animation.""""Shan Huang2021-08-181-21/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-87/+184
| |/ | | | | | | | | | | | | | | | | | | | | 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)
* | Move boot color sysprop parsing to after loading zips.Shan Huang2021-08-181-22/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-171-21/+122
| | | | | | | | | | | | | | | | | | This reverts commit ad9cf52df959489b615f30cbf072415b3352063b. Reason for revert: Fixing broken atv test Test: atv atp test tv/platform/simple_boot_test Change-Id: I9d6ecb6024ce49eef8007458b0d9bf0ff24906c7
* | Merge "Revert "Revert "Revert "Implement dynamic colors for boot animation.""""Shan Huang2021-08-131-110/+15
|\ \
| * | Revert "Revert "Revert "Implement dynamic colors for boot animation."""Shan Huang2021-08-131-110/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9f1123cb0d7f342f5c5e26467e9b5aff529e48a4. Reason for revert: b/196642443 ATV DOA failure. Bug: 196642443 Change-Id: Iad16e5e8f43850ffa7bf1f26701d85da96fd2cdd
* | | Merge "Use ui::LayerStack"TreeHugger Robot2021-08-131-7/+6
|\ \ \ | |/ / |/| |
| * | Use ui::LayerStackDominik Laskowski2021-07-271-7/+6
| | | | | | | | | | | | | | | | | | Bug: 182939859 Test: Build Change-Id: I4658471996939713a6330a9c4a7d05cf4c91833a
* | | Revert "Revert "Implement dynamic colors for boot animation.""Shan Huang2021-08-131-15/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 92aa9daa10ba767cccead3b875d1251dcf2a2a6b. Reason for revert: Working on fixing the null pointer dereference that caused the build breakage. Test: Manual Bug: 190093578 Change-Id: I30e525bcc9f70f9bcba616aa9b7ad39c5d38b46d
* | | Revert "Implement dynamic colors for boot animation."Ady Abraham2021-08-121-107/+15
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 79d079ea49866f2c5d3c02af2d19fb9cf2097dd4. Reason for revert: DroidMonitor: Potential culprit for Bug b/196456395 - verifying through Forrest before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Change-Id: I6130e75ae174f68ddfaa6e1010d7979538311020
* | | Implement dynamic colors for boot animation.Shan Huang2021-08-121-15/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL won't cause any visual change to the boot animation yet because the asset zips are yet to be udated. Next steps: - Update format.md to include documentation for dynamic coloring. - Update asset zip files. Test: Manual Bug: 190093578 Change-Id: I63fdb1983896f321288d595d06f46bcde7da1aab
* | | Revert "Revert "Migrate boot animation from GLES 1.0 to GLES2.0.""Lucas Dupin2021-08-041-87/+184
|/ / | | | | | | | | | | | | | | | | | | 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
* | Revert "Migrate boot animation from GLES 1.0 to GLES2.0."Greg Kaiser2021-07-191-181/+87
| | | | | | | | | | | | | | | | | | | | This reverts commit d711ac4858337539c2188f47ef015e5b88080830. Reason for revert: Breaks boot animation on wembley device Bug: 194074093 Change-Id: Id6143bfd1e35089a7df88470978cd064de2d839c Test: wembley has boot animation again with this reverted
* | Migrate boot animation from GLES 1.0 to GLES2.0.Shan Huang2021-07-131-87/+181
|/ | | | | | | | | | | | | | Main changes in how rendering is done: - Texts and images are drawing using a textured quad instead of glDrawTexiOES. - Shaders are introduced to draw with textures. - Frame fading is also done with shaders now, instead of drawing background colored transparent rectangles. Test: Verified the main animation, clock text, progress text and stock android animation all render correctly. Bug: 190093578 Change-Id: Ie3f336d22bcc9e24f06a2bd62683d7a8c87a85f6
* Merge "bootanimation: ensure that if a percent is shown, we'll get to 100." ↵Nicolas Geoffray2021-04-211-4/+11
|\ | | | | | | | | | | | | | | 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-4/+11
| | | | | | | | | | | | | | | | 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-2/+58
| | | | | | | | | | | | | | | | Bug: 175686819 Test: boot with manual changes updating the progress Change-Id: I2d936e3391f56796308c90deb39ecacc58797721 Merged-In: I2d936e3391f56796308c90deb39ecacc58797721
| * Send shutdown callback only during animation destructionPhilip Junker2020-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The shutdown callback is currently used only by audioplay.cpp to destroy the audio player. Sending shutdown when the animation is destructed makes sure the audio player is not being destroyed before its boot animation part is being displayed. Test: Modified bootanimation, sound in second last part of bootanimation plays Bug: 157407957 Bug: 127254055 Merged-In: I47f57643791e73e4a4fa1597309dccb1f52f2316 Change-Id: I47f57643791e73e4a4fa1597309dccb1f52f2316
| * Support animation parts fading outYegor Malyshev2020-10-191-18/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Tracking changes to renaming DisplayConfig to DisplayModeMarin Shalamanov2021-02-041-10/+12
| | | | | | | | | | | | Bug: 159590486 Test: presubmit Change-Id: I64e57fe4d73c22bbbe0a1767cadf8648259e9beb
* | Support for showing percent progress in boot animation.Nicolas Geoffray2021-01-081-2/+58
| | | | | | | | | | | | | | Bug: 175686819 Test: boot with manual changes updating the progress Change-Id: I2d936e3391f56796308c90deb39ecacc58797721
* | Send shutdown callback only during animation destructionPhilip Junker2020-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The shutdown callback is currently used only by audioplay.cpp to destroy the audio player. Sending shutdown when the animation is destructed makes sure the audio player is not being destroyed before its boot animation part is being displayed. Test: Modified bootanimation, sound in second last part of bootanimation plays Bug: 157407957 Change-Id: I47f57643791e73e4a4fa1597309dccb1f52f2316
* | Support animation parts fading outYegor Malyshev2020-09-211-18/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Use type safe display IDs.Marin Shalamanov2020-08-041-2/+2
| | | | | | | | | | | | | | Bug: 160679868 Test: m && flash device Test: take screnshot on device Change-Id: Id0cd5859b76fc29911d07119d54f329805425b7e
* | Merge "Render boot animation with same size as framebuffer" into rvc-dev am: ↵TreeHugger Robot2020-06-021-4/+26
|\| | | | | | | | | | | | | | | cbea0ab58f am: 937a25de15 am: 35ae2778c3 am: 3c1b9ad9af Original change: undetermined Change-Id: I1ae7b19afe2e88fc1a7fd32c41fb870e80685ff8
| * Render boot animation with same size as framebufferMarin Shalamanov2020-05-291-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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