Commit Graph

185 Commits

Author SHA1 Message Date
joenchen
85b339fb24 bootanimation: correct logo position and size after resolution changed
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 764ea04421)
Merged-In: Id09490ecf7fc4b3e1a6baf073c134f357e9b327f
2022-04-20 07:05:15 +00:00
Lucas Dupin
cd25684a0c Reload color sysprops after failing
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
2022-03-29 23:38:50 +00:00
Treehugger Robot
780bfed3f9 Merge "Add additional logs for bootanimation" am: 51a4954076 am: 4aa84137f0 am: a73e533986
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991970

Change-Id: Ia36255c49f4323125ac37b812b28a87091c8cd79
2022-03-04 03:03:17 +00:00
Yoshiaki Maruoka
9ef19b85cb Add additional logs for bootanimation
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
2022-03-03 07:40:43 +00:00
Josh Yang
f95b2007a3 Change the bootanim time file location.
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
2021-12-23 14:35:34 -08:00
Thiebaud Weksteen
2a32ff7e14 Merge "Enable clock only when supported by product" 2021-12-13 00:56:44 +00:00
Thiébaud Weksteen
08de4439ac Enable clock only when supported by product
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
2021-11-23 10:49:49 +11:00
Keith Mok
6704dc46f0 Merge "Fix nanosleep in BootAnimation" am: 45e281ef2b am: 73357c61d0 am: fd42131e14 am: c42a8a0793
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1891586

Change-Id: Iebc79f0ba23152c05de1f456fec984e225c1ea03
2021-11-19 23:38:37 +00:00
Keith Mok
73357c61d0 Merge "Fix nanosleep in BootAnimation" am: 45e281ef2b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1891586

Change-Id: I19f359a175aa9596f400481029c029c2dd908aa5
2021-11-19 22:54:54 +00:00
Keith Mok
0f2e66866c Fix nanosleep in BootAnimation
clock_nanosleep will return 0 or error no directly.

Bug: 207149564
Test: Build ok
Change-Id: I15866728719d0672a16b4a76a8fd3be4d53d420a
2021-11-19 20:38:22 +00:00
TreeHugger Robot
a254195dc4 Merge "Fix AOSP boot animation black screen issue." into sc-qpr1-dev am: 6d673f1f9a am: e277f0ded5 am: 1b45e9c5fc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15799420

Change-Id: I77b788dea2058df0109ee9e38c924416bf230500
2021-09-10 20:51:57 +00:00
TreeHugger Robot
6d673f1f9a Merge "Fix AOSP boot animation black screen issue." into sc-qpr1-dev 2021-09-10 19:28:29 +00:00
Shan Huang
bfd2d3ce72 Fix AOSP boot animation black screen issue.
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
2021-09-09 23:19:04 +00:00
TreeHugger Robot
03c3759126 Merge "Fixes boot animation not appearing issue on Oriole." into sc-qpr1-dev am: 3a986bb956 am: 580ae422b6 am: 8dbf247294
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15779528

Change-Id: I4501403e20e0a3b50af1629a3d01b8a20d0cefaa
2021-09-09 21:34:16 +00:00
Shan Huang
81846bad1a Fixes boot animation not appearing issue on Oriole.
Test: Flash the updated animation to device. Reboot and check if the
animation shows up.
Bug:199179989
Fixes:199179989

Change-Id: Ic2a2496efcaca4b6ae90c167498b8cd794b46bea
2021-09-07 19:27:41 +00:00
Shan Huang
05701b8eb5 Merge "Support rendering white pixels." into sc-qpr1-dev am: e2f4ad3e7b am: cfb0fe05a5 am: fbe437bd10
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15676845

Change-Id: I2f98a90333e19cda3b22229a90a8112dc0e999a2
2021-08-27 04:19:08 +00:00
Shan Huang
488ff7459c Support rendering white pixels.
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
2021-08-26 20:28:08 +00:00
George Burgess IV
0f8e8110b1 BootAnimation: remove superfluous null check for mAnimation
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
2021-08-23 17:32:23 -07:00
Shan Huang
7bd03e61aa Merge "Move boot color sysprop parsing to after loading zips." into 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
2021-08-19 22:04:43 +00:00
Shan Huang
a1f7a71c2d Move boot color sysprop parsing to after loading zips.
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
2021-08-19 18:50:25 +00:00
Shan Huang
4a14527fb8 Merge "Revert "Revert "Revert "Revert "Implement dynamic colors for boot 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
2021-08-19 01:24:43 +00:00
Shan Huang
89965006af Revert "Revert "Revert "Revert "Implement dynamic colors for boot animation.""""
This reverts commit ad9cf52df9.

Reason for revert: Fixing broken atv test
Test: atv atp test tv/platform/simple_boot_test
Bug: 190093578

Change-Id: I9d6ecb6024ce49eef8007458b0d9bf0ff24906c7
2021-08-18 17:20:45 +00:00
Shan Huang
7fee352207 Move boot color sysprop parsing to after loading zips.
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
2021-08-18 01:10:16 +00:00
Shan Huang
2b31a36bea Revert "Revert "Revert "Revert "Implement dynamic colors for boot animation.""""
This reverts commit ad9cf52df9.

Reason for revert: Fixing broken atv test
Test: atv atp test tv/platform/simple_boot_test

Change-Id: I9d6ecb6024ce49eef8007458b0d9bf0ff24906c7
2021-08-17 17:28:38 +00:00
Lucas Dupin
dd7ed60de0 Revert "Revert "Migrate boot animation from GLES 1.0 to GLES2.0.""
This reverts commit 2ded80094e.

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 8eedc0293d)
2021-08-16 20:17:48 +00:00
Shan Huang
337e3b1124 Merge "Revert "Revert "Revert "Implement dynamic colors for boot animation."""" 2021-08-13 23:56:24 +00:00
Shan Huang
ad9cf52df9 Revert "Revert "Revert "Implement dynamic colors for boot animation."""
This reverts commit 9f1123cb0d.

Reason for revert: b/196642443 ATV DOA failure.
Bug: 196642443

Change-Id: Iad16e5e8f43850ffa7bf1f26701d85da96fd2cdd
2021-08-13 23:51:58 +00:00
TreeHugger Robot
24beb0a31d Merge "Use ui::LayerStack" 2021-08-13 21:06:32 +00:00
Shan Huang
9f1123cb0d Revert "Revert "Implement dynamic colors for boot animation.""
This reverts commit 92aa9daa10.

Reason for revert: Working on fixing the null pointer dereference that caused the build breakage.

Test: Manual
Bug: 190093578

Change-Id: I30e525bcc9f70f9bcba616aa9b7ad39c5d38b46d
2021-08-13 02:06:22 +00:00
Ady Abraham
92aa9daa10 Revert "Implement dynamic colors for boot animation."
This reverts commit 79d079ea49.

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
2021-08-12 23:55:46 +00:00
Shan Huang
79d079ea49 Implement dynamic colors for boot animation.
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
2021-08-12 19:10:30 +00:00
Lucas Dupin
8eedc0293d Revert "Revert "Migrate boot animation from GLES 1.0 to GLES2.0.""
This reverts commit 2ded80094e.

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
2021-08-04 15:44:53 -07:00
Dominik Laskowski
989de3d470 Use ui::LayerStack
Bug: 182939859
Test: Build
Change-Id: I4658471996939713a6330a9c4a7d05cf4c91833a
2021-07-27 21:12:18 -07:00
Greg Kaiser
2ded80094e Revert "Migrate boot animation from GLES 1.0 to GLES2.0."
This reverts commit d711ac4858.

Reason for revert: Breaks boot animation on wembley device

Bug: 194074093
Change-Id: Id6143bfd1e35089a7df88470978cd064de2d839c
Test: wembley has boot animation again with this reverted
2021-07-19 17:03:27 +00:00
Shan Huang
d711ac4858 Migrate boot animation from GLES 1.0 to GLES2.0.
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
2021-07-13 18:50:46 +08:00
Nicolas Geoffray
db45defb94 Merge "bootanimation: ensure that if a percent is shown, we'll get to 100." am: 87c254de0e am: 10e844df41 am: 55b2ba298c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1681127

Change-Id: I1ee402945af4207affb77d61eb76a21c175ac1fc
2021-04-21 09:54:52 +00:00
Nicolas Geoffray
a12987512c bootanimation: ensure that if a percent is shown, we'll get to 100.
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
2021-04-20 15:15:06 +01:00
Marin Shalamanov
cb783ca6d9 Tracking changes to renaming DisplayConfig to DisplayMode
Bug: 159590486
Test: presubmit
Change-Id: I64e57fe4d73c22bbbe0a1767cadf8648259e9beb
2021-02-04 19:37:51 +01:00
Nicolas Geoffray
bbb00e78ef Support for showing percent progress in boot animation.
Bug: 175686819
Test: boot with manual changes updating the progress

Change-Id: I2d936e3391f56796308c90deb39ecacc58797721
Merged-In: I2d936e3391f56796308c90deb39ecacc58797721
2021-01-11 13:56:21 +00:00
Nicolas Geoffray
41fffb49d5 Support for showing percent progress in boot animation.
Bug: 175686819
Test: boot with manual changes updating the progress

Change-Id: I2d936e3391f56796308c90deb39ecacc58797721
2021-01-08 10:52:33 +00:00
Philip Junker
f1291ba703 Send shutdown callback only during animation destruction
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
2020-12-01 16:45:52 +01:00
Philip Junker
60600569a0 Send shutdown callback only during animation destruction
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
2020-11-26 15:00:23 +01:00
Yegor Malyshev
eafcb99786 Support animation parts fading out
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
2020-10-19 14:33:17 +02:00
Yegor Malyshev
6925e1bde0 Support animation parts fading out
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
2020-09-21 20:55:21 +02:00
Marin Shalamanov
11599eeaee Use type safe display IDs.
Bug: 160679868
Test: m && flash device
Test: take screnshot on device
Change-Id: Id0cd5859b76fc29911d07119d54f329805425b7e
2020-08-04 11:38:05 +02:00
TreeHugger Robot
e350724e34 Merge "Render boot animation with same size as framebuffer" into rvc-dev am: cbea0ab58f am: 937a25de15 am: 35ae2778c3 am: 3c1b9ad9af
Original change: undetermined

Change-Id: I1ae7b19afe2e88fc1a7fd32c41fb870e80685ff8
2020-06-02 11:39:57 +00:00
Marin Shalamanov
047802d416 Render boot animation with same size as framebuffer
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
2020-05-29 18:15:52 +02:00
TreeHugger Robot
569b3fbfa7 Merge "Resize boot animation on display changes" into rvc-dev 2020-05-27 12:17:08 +00:00
Marin Shalamanov
1a6e368920 Resize boot animation on display changes
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
2020-05-27 11:50:23 +02:00
TreeHugger Robot
8f631886c5 Merge "Resize boot animation on display changes" 2020-05-26 19:21:50 +00:00