what happened is that the efective pixel format is calculated by SF but Surface nevew had access to it directly.
in particular this caused query(FORMAT) to return the requested format instead of the effective format.
this would happen is the window is made visible but the client didn't render yet into it. This happens often with SurfaceView.
Instead of filling the window with solid black, SF would simply ignore it which could lead to more disturbing artifacts.
in theory the window manager should not display a window before it has been drawn into, but it does happen occasionnaly.
Apparently the problem is caused by the fact that A2dpAudioStreamOut::standby() calls a2dp_stop() after the headset has been powered down.
The workaround consists in indicating to A2DP audio hardware that a close request is pending and that stanby() must be bypassed.
This change makes SurfaceHolder.setType(GPU) obsolete (it's now ignored).
Added an API to android_native_window_t to allow extending the functionality without ever breaking binary compatibility. This is used to implement the new set_usage() API. This API needs to be called by software renderers because the default is to use usage flags suitable for h/w.
This is because the AudioFlinger duplicating thread is closed while the output tracks are still active. This cause the output tracks objects to be destroyed at a time where they can be in use by the destination output mixer.
The fix consists in adding the OutputTrack to the track list (mTracks) of its destination thread so that a strong reference is help during the mixer processed and the track is detroyed only when safe by destination thread.
Also added detection of problems when creating the output track (e.g. no more tracks in mixer). In this case the output track is not added to output track list of duplicating thread.
When changing the audio output stream sampling rate with setParameters() make sure that all tracks have a sampling rate less or equal to 2 times the new output sampling rate.
Merge change 7419 from master that may help eliminate the problem.
This change was for a different use case (when disabling A2DP to switch output to SCO) but without a repro case it is worth trying.
The BT headset detection now makes the difference between car kits and headsets, which can be used by audio policy manager.
The headset connection is also detected earlier, that is when the headset is connected and not when the SCO socket is connected as it was the case before. This allows the audio policy manager to suspend A2DP output while ringing if a SCO headset is connected.
There was no garanty that the corresponding thread destructor had been already called when exiting the closeOutput() or closeInput() functions.
This contructor could be called by the thread after the exit condition is signalled. By way of consequence, closeOutputStream() could be called after
we exited closeOutput() function.
To solve the problem, the call to closeOutputStream() or closeInputStream() is moved to closeOutput() or closeInput().
The function checkForNewParameters_l() is called with the ThreadBase mutex mLock locked. In the case where the parameter change implies
an audio parameter modification (e.g. sampling rate) the function sendConfigEvent() is called which tries to lock mLock creating a deadlock.
The fix consists in creating a function equivalent to sendConfigEvent() that must be called with mLock locked and does not lock mLock.
Also added the possibility to have more than one set parameter request pending.
Use integers instead of void* as input/output handles at IAudioFlinger and IAudioPolicyService interfaces.
AudioFlinger maintains an always increasing count of opened inputs or outputs as unique ID.
* changes:
update most gl tests to use EGLUtils
added two EGL helpers for selecting a config matching a certain pixelformat or native window type
added NATIVE_WINDOW_FORMAT attribute to android_native_window_t
The major things going on here:
- The MotionEvent API is now extended to included "pointer ID" information, for
applications to keep track of individual fingers as they move up and down.
PointerLocation has been updated to take advantage of this.
- The input system now has logic to generate MotionEvents with the new ID
information, synthesizing an identifier as new points are down and trying to
keep pointer ids consistent across events by looking at the distance between
the last and next set of pointers.
- We now support the new multitouch driver protocol, and will use that instead
of the old one if it is available. We do NOT use any finger id information
coming from the driver, but always synthesize pointer ids in user space.
(This is simply because we don't yet have a driver reporting this information
from which to base an implementation on.)
- Increase maximum number of fingers to 10. This code has only been used
with a driver that reports up to 2, so no idea how more will actually work.
- Oh and the input system can now detect and report physical DPAD devices.
If the output stream handler passed was not the A2DP output stream, the request was ignored instead of being forwarded downstream to hardware interface.
there was several issues:
- when a surface was made non-current, the last frame wasn't shown and the buffer could stay locked
- when a surface was made current the 2nd time, it would not dequeue a new buffer
now, queue/dequeue are done when the surface is made current.
for this to work, a new query() hook had to be added on android_native_window_t, it allows to retrieve some attributes of a window (currently only width and height).
The current gralloc allocates buffer memory for render targets that will typically have NPOT dimensions. Assuming that the vendor driver supports converting the resulting NPOT android_native_buffer_t to a NPOT EGLImage, SurfaceFlinger calls glEGLImageTargetTexture2DOES(), and uses glGetError() to test whether the GL can support creating an EGL target texture with the specified NPOT EGLImage. If it is supported, the DIRECT_TEXTURE flag remains set, otherwise it is cleared.
Tangentially, if the driver advertises the GL_ARB_texture_non_power_of_two extension, the NPOT_EXTENSION flag is set, otherwise it is cleared.
If the driver supported creating an EGL target texture from a NPOT source EGLImage, it implicitly creates a NPOT texture. This does not need any glScalef() texture coordinate correction in LayerBase::drawWithOpenGL(). However, the same driver may not advertise the GL_ARB_texture_non_power_of_two extension nor generally support NPOT textures that were not derived from EGLImages. So SurfaceFlinger may flag only DIRECT_TEXTURE, not NPOT_EXTENSION.
Therefore, the test in LayerBase::drawWithOpenGL() should only perform the glScalef() if neither NPOT_EXTENSION or DIRECT_TEXTURE are flagged. Otherwise scaling is applied to NPOT EGL target textures when none is required.
It turns out we were not returning the density for anything retrieved from a
TypedArray... which basically means any bitmap references from a layout or style...!!!
This is now fixed.
Also fiddle with the density compatibility mode to turn on smoothing in certain situations,
helping the look of things when they need to scale and we couldn't do the scaling at
load time.
Merge commit '1521cd6e657ba4efa9382ab73d3cbba3bdf50ead'
* commit '1521cd6e657ba4efa9382ab73d3cbba3bdf50ead':
Reset the mDpiX and mDpiY values when qemu.sf.lcd_density is defined.
* changes:
Fix the IOException in wallpaper restore -- the padding isn't required at the end.
Fix bug 1982892 - batteryservice turns off device even while plugged in
Initial commit for review.
Integrated comments after patch set 1 review.
Fixed lockup in AudioFlinger::ThreadBase::exit()
Fixed lockup when playing tone with AudioPlocyService startTone()
* changes:
Add a flag to set whether the overlay has been initialized. Commit needs to be called at least once on each overlay, and it appears that sometimes this doesn't happen because the visibility never changes. With this change the overlay parameter and position will be committed when either the visibility of the window changes, or on the first call to visibility resolved, if it hasn't already been done.
doesn't happen because the visibility never changes. With this change
the overlay parameter and position will be committed when either the visibility
of the window changes, or on the first call to visibility resolved, if it
hasn't already been done.
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
This changes the names of the directories in aapt, to what you see
in the list of DpiTest resources. Also adds a new "long" configuration
for wide screens, which the platform sets appropriate, and introduces
a new kind of resizeability for not large but significantly larger
than normal screens which may have compatibility issues.
This will be used to avoid unnecessarily listening to data from sensors
that function as event devices.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Patch supplied on advice of partner. This causes us to send suspend_sink to
Bluez via socket interface, so we enter suspend on the A2DP link faster.
This is especially important when switching to SCO so that we come closer to
whitepaper recommendations to suspend A2DP before setting up SCO.
We have another patch set to add DBUS A2DP suspend and resume calls to Bluez
that will do a better job of following whitepaper recommendations for
A2DP -> SCO -> A2DP, but this small patch is still an improvement.
The kernel can now publish a property describing the layout of virtual
hardware buttons on the touchscreen. These outside of the display
area (outside of the absolute x and y controller range the driver
reports), and when the user presses on them a key event will be
generated rather than a touch event.
This also includes a number of tweaks to the absolute controller
processing to make things work better on the new screens. For
example, we now reject down events outside of the display area.
Still left to be done is the ability to cancel a key down event,
so the user can slide up from the virtual keys to the touch screen
without causing a virtual key to execute.