102 Commits

Author SHA1 Message Date
Geoffrey Pitsch
290c4350ed Suppress Boot sound for non-standard scenarios.
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
2016-08-10 10:52:48 -04:00
Geoffrey Pitsch
305087991d BootAnimation system property to play sound.
Optional system property "persist.sys.bootanim.play_sound"
If nonexistent, default behavior plays the sound.

Bug: 30690353
Change-Id: Ie5ed456d891632be5ec8be255ac7c1193753c741
2016-08-08 16:18:21 -04:00
Eric Laurent
197e47979a bootanimation: fix glitchy playback
Do not use low latency playback mode to be more
robust against scheduling problems during boot phase.

Also:
- remove unused reverb on output mix
- fix WAV file parser.

Bug: 30277818
Change-Id: I1e15d3003a25c93d4995006885b32a754d17343f
2016-07-22 11:31:25 -07:00
Geoffrey Pitsch
5613313533 Play boot sound on the System stream.
Turning down the ring volume will also turn down boot sound.

BUG:30132711
Change-Id: I902e56b20f105c27209dd47f054e98085647ee85
2016-07-15 10:50:04 -04:00
Geoffrey Pitsch
a91a2d7375 Fixes delay when playing first sound in BootAnimation
audioplay is initialized with an example of the type of clip it
will play.
Also remove asserts and debug compile settings from BootAnimation.

BUG:24800792
Change-Id: Icb78489417aee0549c340c746b25e57ccdb3427e
2016-07-13 15:51:24 -04:00
Damien Bargiacchi
4786f6d958 Merge "Don't show times before 2000-01-01" into nyc-mr1-dev 2016-07-13 00:40:07 +00:00
Damien Bargiacchi
9676281c4f Don't show times before 2000-01-01
BUG=27802041

Change-Id: Iaa826e029c3b887e2bda6d12bc7c372d862ed320
2016-07-12 16:03:37 -07:00
Geoffrey Pitsch
859029ff7b Merge "OpenSL-based audio support for BootAnimation" into nyc-mr1-dev 2016-07-12 17:29:56 +00:00
Tim Murray
b646ec13e1 Merge changes from topic 'stune' into nyc-mr1-dev
* changes:
  Put bootanimation in top-app stune group.
  Sets android.ui to be in the fg stune group.
2016-07-11 20:29:40 +00:00
Geoffrey Pitsch
143d48927e Merge "BootAnimation: Use npot textures" into nyc-mr1-dev 2016-07-11 20:12:40 +00:00
Tim Murray
5c52691a48 Put bootanimation in top-app stune group.
bug 29512132

Change-Id: Id39650177b1f3b1ca24edb72b2809ee4ded396a1
2016-07-11 11:41:52 -07:00
Geoffrey Pitsch
2fb30fb68e Wait until end of BootAnimation to free looping textures
glDeleteTextures causes a noticeable framerate hitch when switching to
the outro.  By the time looping is finished, the system has finished
booting, so freeing the textures immediately is less beneficial.

Bug: 29878551
Bug: 30040263
Change-Id: I5a404a6e18cd2cf64d6c94343f82fa5db8dfbab3
2016-07-11 13:02:41 -04:00
Sai Kiran Korwar
271674930a BootAnimation: Use npot textures
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
2016-07-11 12:54:22 -04:00
Geoffrey Pitsch
d6d9a1d0b9 OpenSL-based audio support for BootAnimation
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
2016-07-06 11:13:48 -04:00
Geoffrey Pitsch
dd214a796f Support trimmed images in BootAnimation
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
2016-06-29 09:35:21 -04:00
Damien Bargiacchi
9748086fe2 Check clock accuracy before attempting to display clock
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
2016-05-12 17:01:59 -07:00
Andriy Naborskyy
815e51d76c resolve merge conflicts of 0c7535b to nyc-dev
Change-Id: I49fa42e0d78aeaa8127cefc5cc5122cf37fce878
2016-03-24 17:14:52 -07:00
Andriy Naborskyy
39218ba26d bootanimation: implement split packaging of animation
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>
2016-03-22 20:18:11 -07:00
Damien Bargiacchi
a704b7d344 Draw a clock on top of the Android boot animation
Don't draw on top of vendor specific animations/logos since we can't
make it look good.

Bug: 27209004
Change-Id: If4791b861ff476c23b37787ba896a3ef8d9df4fd
2016-03-07 16:15:31 -08:00
Tom Cherry
fe0fcf5cad am b9ac485a: am 49948146: Merge "bundle init.rc contents with its service"
* commit 'b9ac485a8e49a4db080bab8ea684a9b262215563':
  bundle init.rc contents with its service
2015-08-21 18:24:35 +00:00
Tom Cherry
c2de7a7e87 bundle init.rc contents with its service
Bug: 23186545
Change-Id: I080e73d6a124873c2ddd0fba85315d7082faf3f5
2015-08-19 17:24:47 -07:00
Jorim Jaggi
358fcc795e Do not start with a black frame in bootanimation
Bug: 23128307
Change-Id: I0ec044f983c1c30960be046e43a882c63205dc5f
2015-08-18 20:26:47 +00:00
Narayan Kamath
407753c456 ZipFileRO: Use precise widths for zip file types.
getEntryInfo crashes on 64-bit devices because "long" types
were being passed int pointers (that pointed to a stack frame)
that were reinterpret_cast'ed to long* (sigh.). To fix this issue
once and for all, use types with explicitly defined widths.

This change also removes some dead invariant checking from
Asset.cpp instead of cleaning it up.

Note that we've introduced a wart in NativeLibraryHelper, where
we need to deal with zlib's uLong type, which is "at least 32 bits
wide".

bug: 21622286

(cherry picked from commit 4600dd053dbdbd4b95f3b11057a1cc55b99f9c77)

Change-Id: I7886cb37a229cc27c625699c80e6a6a6117d2203
2015-06-17 13:13:16 +00:00
Narayan Kamath
4600dd053d ZipFileRO: Use precise widths for zip file types.
getEntryInfo crashes on 64-bit devices because "long" types
were being passed int pointers (that pointed to a stack frame)
that were reinterpret_cast'ed to long* (sigh.). To fix this issue
once and for all, use types with explicitly defined widths.

This change also removes some dead invariant checking from
Asset.cpp instead of cleaning it up.

Note that we've introduced a wart in NativeLibraryHelper, where
we need to deal with zlib's uLong type, which is "at least 32 bits
wide".

bug: 21622286

Change-Id: Iae675a9601db7aae03a8b80b40321d2cc1d97f50
2015-06-17 08:40:25 +00:00
Chris Elliott
b65b66ccc2 am 2224eac3: Merge "bootanimation: fix garbage line issue when screen height is odd." into lmp-mr1-modular-dev
* commit '2224eac30375a731f4ad38d6930dbc37b0855a0d':
  bootanimation: fix garbage line issue when screen height is odd.
2015-05-07 17:06:47 +00:00
Chris Elliott
d13d504e4b bootanimation: fix garbage line issue when screen height is odd.
bug:20032072

Change-Id: I784fb6f815b22c37dcd7354729aca346726196d9
2015-05-05 13:21:27 -07:00
Narayan Kamath
688ff4cf0f Track removal of refcounts from FileMap.
Use delete instead of release.

Change-Id: I25c841b368aa9d51e9259399b94cafa2bbb7a076
2015-02-23 15:47:54 +00:00
Yabin Cui
1610486d37 kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: Ib466949bb6cd6d1bbc4680e989f0f9fae62ca564
2015-01-26 22:32:38 -08:00
Bernhard Rosenkränzer
99d61edfda Fix class vs. struct mismatch
Don't refer to classes as structs and view versa -- causes warnings in
clang (in code built with -Werror)

Change-Id: I4d7f461bcf6fe4e43a14ad2f28ee0e0ddea95abc
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2014-11-24 16:18:15 -08:00
Bernhard Rosenkränzer
09993f768b Fix format strings mismatching the parameters passed to them
Change-Id: Ia0d33aec9edadac60508fb422e0821e6d8f28afa
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2014-11-20 15:24:46 -08:00
Andreas Gampe
cfedceb8c1 Frameworks/base: Turn on -Wall -Werror in cmds
Fix small warnings, turn on -Wall -Werror.

Change-Id: Iab1f01a7c7ebd6ba832b75067c5e395f380a1b8b
2014-11-07 14:33:51 -08:00
Bill Yi
5a71f83227 Merge lmp-dev-plus-aosp-without-vendor into stage-aosp-master
Change-Id: I7063b7b52e9c09a57eb6bf3b4ffa3716d58ebf43
2014-10-22 09:00:49 -07:00
Elliott Hughes
bb94f3107e Include <time.h> for clock_nanosleep.
Change-Id: If3098fa03003bce5d06d60e9129c10cce3c850bb
2014-10-21 10:41:33 -07:00
Mike Lockwood
28138587ef bootanimation: Tweak parameters for pcm_open for playing boot sounds.
Set start_threshold and avail_min to 1/4th period size and stop_threshold to INT_MAX

Change-Id: I0a3aac18533709daa86a024cdd6a32086410723a
2014-10-07 14:47:26 -07:00
Mike Lockwood
ebf9a0d8a8 Add support for playing audio during bootanimation
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
2014-10-03 15:38:15 -07:00
Jesse Hall
083b84cf88 bootanimation: allow animation to specify background color
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
2014-09-25 23:37:12 +00:00
Mike Reed
42a1d08df7 SkBitmap::Config is deprecated, use SkColorType
Change-Id: Ida181d2aac760072cf2d01409edac37699dea216
2014-07-07 18:11:24 -04:00
Narayan Kamath
52adfdaafd am 516130cc: am dbbf431b: am d0f7f418: Merge "Freeing frame map"
* commit '516130ccb1841afb6ef154c28269d91594925429':
  Freeing frame map
2014-04-30 17:36:10 +00:00
Mykola Kondratenko
0c1eeb3c8a Freeing frame map
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
2014-04-30 10:58:20 +00:00
Jeff Sharkey
28f0877073 Allow custom wallpaper and boot animation.
Add new "ro.config.wallpaper" and "ro.config.wallpaper_component"
properties which may be defined outside of the bundled framework
resources.  Falls back to bundled resources when properties are
undefined.

Also look for boot animation under OEM partition.

Bug: 13340779
Change-Id: Ibdc9935dbdaae3319bf63b40573de0503d82ae67
2014-04-28 08:54:17 -07:00
Colin Cross
63665f2ac4 am a3633c25: am 71a3d40d: am e4360c8e: am 4308a523: Merge "bootanimation: build 32-bit if 64-bit gl libraries are not available"
* commit 'a3633c25033b576ae160ea86194e4f7f20d82fe2':
  bootanimation: build 32-bit if 64-bit gl libraries are not available
2014-03-20 21:05:40 +00:00
Colin Cross
31d16e5bf9 bootanimation: build 32-bit if 64-bit gl libraries are not available
Set LOCAL_32_BIT_ONLY if TARGET_32_BIT_SURFACEFLINGER is set.

Change-Id: I76396cc9fe3fe45d1e98a44bf911d6e70922555a
2014-03-19 18:10:31 -07:00
Andy McFadden
c749b44086 FramebufferNativeWindow.h is obsolete
Change-Id: I3c645af7247a520e28d337e567f326375558519a
2014-03-05 15:36:58 -08:00
Derek Sollenberger
eece0dda56 Fix includes so that they no longer rely on the global Skia includes directories.
bug:13225538
Change-Id: Ia5d816dc665f81c7985f21036af4fd0a63c560cf
2014-02-27 14:31:29 -05:00
Nick Kralevich
9d7d4da6b7 am fc800d40: am fbd6d5a8: am 09fdc159: am 3ddee4de: Merge "[bootanimation] Drop user loadable bootanimation.zip abiltiy."
* commit 'fc800d407d695926ba07299c4e27d1e06284098f':
  [bootanimation] Drop user loadable bootanimation.zip abiltiy.
2013-12-16 18:47:03 +00:00
Robert Craig
cee6a096b1 [bootanimation] Drop user loadable bootanimation.zip abiltiy.
A prior change removed the ability of
the shell to push to /data/local. Because
of this, the bootanimation code no longer
supports users loading custom bootanimation.zip
files. This patch drops the access attempt
from the code.

Change-Id: Ie30dd73699c8296be00dc6fbf14691e08baa6410
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2013-12-16 09:42:51 -05:00
Nick Kralevich
362028d632 am 411954ae: am a6416309: am 1e137549: am efa5c88f: Merge "Don\'t try to set service.bootanim.exit"
* commit '411954aef072574676462f579847a01af0aed728':
  Don't try to set service.bootanim.exit
2013-12-11 23:05:00 +00:00
Nick Kralevich
e58d09a552 Don't try to set service.bootanim.exit
init has never allowed the bootanimation code to
set service.bootanim.exit, and has always generated the
dmesg error message

  <3>[   17.644615] init: sys_prop: permission denied uid:1003  name:service.bootanim.exit

Since setting this property has no effect and never worked, delete
the code which tries to do it.

Change-Id: Idacc5467d85479a8cf974702af8895011be585ea
2013-12-11 13:10:55 -08:00
Narayan Kamath
5a74e2df57 Reimplement ZipFileRO in terms of libziparchive.
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

(cherry picked from commit afd31e08299008fdc5c2813f21b2573f29dc53df)

Change-Id: I86a2c528575d4a3ca86b94be068dcdc3c17c2ed6
2013-12-11 19:06:18 +00:00
Narayan Kamath
afd31e0829 Reimplement ZipFileRO in terms of libziparchive.
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
2013-12-09 16:23:16 +00:00