* changes:
Close USB dialogs if their corresponding accessory or device has disconnected
USB: Add API and dialog for apps to request permissions for USB devices and accessories
UsbService: Automatically use system apps by default if it is the only choice
Report inclusive minimum and maximum ranges for all
axes including X and Y.
Set mouse pointer bounds to 0..width-1, 0..height-1.
Rotate touch and mouse positions more carefully, paying attention
to the maximum bounds when calculating the complement of an axis.
Simplified the InputReader somewhat and removed support for a
couple of poorly defined input device configuration parameters.
We now assume that the touch device provides useful absolute axis
ranges for the X and Y axes since the alternative does not actually
make sense.
Bug: 3413541
Change-Id: I121d28a125c4f9618cb283dc460d33ff1a907023
* commit '12230eaa5f446cb22032d6645074a1aaca146df9':
Fix bug 4065021 - Adjust spacing of the "home" action bar item to be consistent with the "up" indicator
consistent with the "up" indicator
Make sure that the "home" affordance in the action bar always occupies
the same amount of space regardless of whether or not the "up"
indicator is visible. This means centering the application icon/logo
in the remaining space after the "up" indicator has been added.
Change-Id: I3c81cfe8255546d4dd676af913895713baba4f13
Persist the setting of wifi override in airplane mode
so that it can be restored on reboot
Bug: 3250824
Change-Id: I2af38c282ba55fc150fd9ef783d43600f0d4260f
This fix ensures captured thumbnails in portrait mode have the
same resolution as those in landscape by fixing the horizontal
resolution and vertical resolution of the target image.
The returned image is now always the same size and matches
the landscape screen exactly. In portrait mode, it grabs
the upper portion of the screen based on the vertical dimension
of the target image.
Change-Id: I203c39843f2f21ca28f6ef0dffec308ce5cb39fb
New APIs:
UsbManager.hasPermission returns true if the caller has permission
for the given device or accessory
UsbManager.requestPermission poses a dialog to allow the user to give the caller
permission for the device or accessory.
Result is returned via a PendingIntent.
No dialog is displayed if the caller already has permission.
Also moved UsbResolverActivity to SystemUI package
BUG: 4069037
Change-Id: I93be769501a8776b49ac26e468af19f8fa2114c9
If only one app is installed that supports a USB device or accessory
and that app is in the system partition, then use that activity by default
and rather than displaying the USB app chooser dialog.
BUG: 4060064
Change-Id: I49bf22a439e9676039b6f612c9bb622ab426066c
Signed-off-by: Mike Lockwood <lockwood@android.com>
This change makes Context initialization wait properly for all threads to be
available before leaving initContext(). This prevents a case where ~Context()
gets called before all created threads have started/finished their work. This
was triggered/discovered by running some very short-lived tests in CTS.
BUG=4064203
Change-Id: I1dd6f43fa7942c53881008e857df864e2395202e
This change adds a new 'method' to the ANativeWindow interface to check
whether buffers queued to the window will be sent directly to the system
window compositor.
Change-Id: I4d4b199e328c110b68b250029aea650f03c8724d
Bug: 3495535
This change fixes the stability problems experienced when using
a bluetooth headset supporting both A2DP and SCO. Problems occur
when starting the video chat at which time the A2DP output is being
stopped to start SCO. At that time, active AudioTracks are invalidated
by AudioFlinger so that a new AudioTrack binder interface can be
recreated by the client process on the new mixer thread with correct parameters.
The problem was that the process to restore the binder interface was not
protected against concurrent requests which caused 2 binder interfaces
to be created sometimes. This could lead to permanent client deadlock
if one of the client threads was waiting for a condition of the first
created binder interface while the second one was created (as the AudioFlinger
would only signal conditions on the last one created).
This concurrent request situation is more likely to happen when a client
uses the JAVA AudioTrack as the JNI implementation uses simultaneously the
native AudioTrack callback and write push mechanisms. By doing so, the code
that checks if the binder interface should be restored (in obtainBuffer()) is
much more likely to be called concurrently from two different threads.
The fix consists in protecting the critical binder interface restore phase
with a flag in the AudioTrack control block. The first thread acting upon the binder
interface restore request will raise the flag and the second thread will just wait for
a condition to be signaled when the restore process is complete.
Also protected all accesses to the AudioTrack control block by a mutex to prevent
access while the track is being destroyed and restored. If a mutex cannot be held
(e.g because we call a callback function), acquire a strong reference on the IAudioTrack
to prevent its destruction while the cblk is being accessed.
Modified AudioTrack JNI to use GetByteArrayElements() instead of
GetPrimitiveArrayCritical() when writing audio buffers. Entering a critical section would
cause the JNI to abort if a mediaserver crash occurs during a write due to the AudioSystem
callback being called during the critical section when media server process restarts.
Anyway with current JNI implementation, either versions do not copy data most of the times
and the criticial version does not guaranty no data copy.
The same modifications have been made to AudioRecord.
Change-Id: Idc5aa711a04c3eee180cdd03f44fe17f3c4dcb52
Bug: 3321263
Submit area should be visible when the field has focus, irrespective of text content.
Make sure that the fields get highlighted when focused.
Also fix an issue with hint not being applied from the SearchableInfo.
Bug: 3470348
Change-Id: If399d9551f89312c19485e249043f5823a862499
This fixes a bug where we would capture the statusbar region in
thumbnails because the wallpaper was used in the bounds calculation.
Change-Id: I572221e83c4c363afe90e59bece9a291ce694a15
Use a death handler when audio focus changes are caused by audio
mode changes.
The bug comes from the fact that audio focus clients that use the
audio mode for automatic focus handling didn't register a death
handler, which was set to null. When such a client died, this
handler was compared against the one to remove from the
audio focus stack, which resulted in an NPE.
The fix consists in registering a valid IBinder object in the
audio focus stack, even for clients whose focus requests originate
from a change in audio mode, as implemented in the
handleFocusForCalls() method.
Change-Id: Id9e1d3d10afcd99969285f6d60fc4d7dde1e4a10