2466 Commits

Author SHA1 Message Date
Jeff Brown
a47425a13c Add support for input devices that have vibrators.
Added a getVibrator() method to InputDevice which returns a Vibrator
associated with that input device.  Its uses the same API as the
system vibrator which makes it easy for applications to be modified
to use one or the other.

Bug: 6334179
Change-Id: Ifc7f13dbcb778670f3f1c07ccc562334e6109d2e
2012-04-13 17:01:15 -07:00
Jeff Brown
af9e8d3818 Notify applications when input devices change.
This change allows the InputManager to keep track of what input
devices are registered with the system and when they change.
It needs to do this so that it can properly clear its cache of
input device properties (especially the key map!) when changes
occur.

Added new API so that applications can register listeners for
input device changes.

Fixed a minor bug in EventHub where it didn't handle EPOLLHUP
properly so it would spam the log about unsupposed epoll events
until inotify noticed that the device was gone and removed it.

Change-Id: I937d8c601f7185d4299038bce6a2934fe4fdd2b3
2012-04-12 18:54:54 -07:00
Jeff Brown
49ccac530b Refactor key code mapping.
Added handling for EV_MSC / MSC_SCAN which typically reports
the HID usage associated with a key.  This will enable key maps
to map keys with HID usages that Linux does not natively recognize.

Removed keyCode and flags fields from EventHub RawEvent since
they don't necessarily make sense in isolation now that we
pay attention to HID usage codes too.

Removed the fallback code for mapping keys and axes.  In practice,
an input device should be self-sufficient.  We should not ever
need to look at the built-in keyboard's key map.  In fact, there
usually isn't a built-in keyboard anyhow.  This code was originally
working around a problem where we weren't loading the key map
for touch screens with virtual keys, which has long since been fixed.

Change-Id: I0a319bdec44be9514f795526347397e94d53a127
2012-04-11 20:28:09 -07:00
Chet Haase
7b6a75872b Pass width/height parameters to webview
When webview draws into an fbo layer, it needs to know the
size of that surface to create the rendering transform appropriately.
This change copies in the current viewport size to the structure that
is passed to the webview.

Change-Id: I7160b0836d00834134c799c95a439cdc045e2035
2012-04-11 14:32:02 -07:00
Jeff Brown
9f25b7fdf2 Request key maps from input manager service.
Instead of each application loading the KeyCharacterMap from
the file system, get them from the input manager service as
part of the InputDevice object.

Refactored InputManager to be a proper singleton instead of
having a bunch of static methods.

InputManager now maintains a cache of all InputDevice objects
that it has loaded.  Currently we never invalidate the cache
which can cause InputDevice to return stale motion ranges if
the device is reconfigured.  This will be fixed in a future change.

Added a fake InputDevice with ID -1 to represent the virtual keyboard.

Change-Id: If7a695839ad0972317a5aab89e9d1e42ace28eb7
2012-04-10 18:23:58 -07:00
Jeff Brown
e38fdfae91 Add a unique input device descriptor.
The purpose of the input device descriptor is to make it possible
to associate persistent settings for each input device, such as the
keyboard layout.

The descriptor is a hash of the information we have about the
device, such as its vendor id, product id, unique id, name,
or location.

Bug: 6110399
Change-Id: Idb80f946819b3f0dbf4e661bb0a753dbc2b60981
2012-04-06 14:57:19 -07:00
Jeff Brown
56bad16f02 Merge "Add Japanese specific key codes." 2012-04-02 17:08:13 -07:00
Yang Chuang
7511f9cd2f Add Japanese specific key codes.
These keys are specific to Japanese hardware keyboard which can be
used by input method.

Patch ported from AOSP, with the addition of EISU and KANA mappings.

Change-Id: I647473cdd257458e3b9d134b0fc623eae946c3e0
2012-04-02 15:19:45 -07:00
Romain Guy
8f3b8e3299 Allow fine-grained control over functors execution
Adds non-drawing execution mode

Change-Id: I82f92cf1b9a3b9ff2ca6d7427c4e02b73e04e6bf
2012-04-02 15:15:07 -07:00
Colin Cross
4be0041630 Move services/powermanager from frameworks/base to frameworks/native
Move services/powermanager into frameworks/native so audioflinger can
use it.  Note that this is not the same as a PowerManagerService,
which is part of systemserver and handles turning the screen on and
off, etc.  This is just a binder interface to allow taking wakelocks.

Change-Id: I1142e6d9ddbb651cc19ac07d946fa24d8feed8a3
2012-03-28 13:57:51 -07:00
James Dong
d927a1d996 Deleted the media, camera, drm related files since they are relocated
Change-Id: I9bc5573ee07e30b305b5b879023aa9ec69e10b91
2012-03-28 10:42:44 -07:00
Romain Guy
56485fe628 Merge "Use a status_t return type for GL functors" 2012-03-26 16:51:22 -07:00
Romain Guy
6554943a1d Use a status_t return type for GL functors
WebView needs more fine-grained control over the behavior of the
framework upon execution of the display lists. The new status_t
allows WebView to requests its functor to be re-executed directly
without causing a redraw of the entire hierarchy.

Change-Id: I97a8141dc5c6eeb6805b6024cc1e76fce07d24cc
2012-03-26 16:45:05 -07:00
Glenn Kasten
8296628ed8 Merge "mv libcpustats from frameworks/base to /native" 2012-03-26 12:28:38 -07:00
Glenn Kasten
30b8a65c5c mv libcpustats from frameworks/base to /native
OK to lose history

Change-Id: I05ce0452f16a396cff6e18db5424492f3a6f6861
2012-03-26 12:22:57 -07:00
Andreas Huber
b3e2e24f78 Merge "Provisional support for secure decryption of media streams." 2012-03-26 11:43:06 -07:00
Andreas Huber
9b8e496f4d Provisional support for secure decryption of media streams.
Change-Id: Ib3982a9c960bfdb0cb7e1b174440b141b194cfbe
2012-03-26 11:24:04 -07:00
Eric Laurent
383c4b3e63 Merge "reorganize SoundPool and JetPlayer code." 2012-03-26 11:23:49 -07:00
Eric Laurent
f5e1812549 reorganize SoundPool and JetPlayer code.
Reorganize SoundPool and JetPlayer code to be ready for the
creation of libmedia_native.

Split SoundPool between libsoundpool (JNI) and libmedia(sound pool implementation).
Remove dependencies on nativehelper/jni.h from JetPlayer.

Change-Id: I130c6014173b714329929dd82c5dfb70b757a610
2012-03-26 10:54:41 -07:00
Glenn Kasten
4acee00352 Add TRACK_FAST for IAudioFlinger::createTrack
Currently not implemented by client or server

Change-Id: Ib11dda57db3eeb871bcc7b546e340078776875f5
2012-03-26 07:25:48 -07:00
Glenn Kasten
39581f9248 Merge "IAudioFlinger::createTrack and openRecord flags" 2012-03-26 07:16:37 -07:00
Colin Cross
8dd6574809 remove jni.h include from IOMX.h
jni.h is not used in IOMX.h and is not available in pdk builds,
remove it.

Change-Id: I9bc8fd70f617942712d9f684c6fc927bf18be753
2012-03-24 15:35:17 -07:00
James Dong
062ed957e0 Fixed missing return value from a method should have returned status_t
Change-Id: I83ad2735eaf8a8dfa5f8f29f30aec1311b3222de
2012-03-24 10:15:18 -07:00
Colin Cross
a982dc05d7 frameworks/base: move Zip* from libandroidfw to libutils
ZipUtils is needed by build/tools, move it from libandroidfw
(frameworks/base) to libutils (frameworks/native).

Change-Id: I2b4b7adcdf68eb25ee7cba5dd3b69eadf0523af3
2012-03-22 18:43:07 -07:00
Glenn Kasten
bf30911bf1 Merge "Remove enforceFrameCount" 2012-03-22 11:06:49 -07:00
Marco Nelissen
da9deca7ba Support gapless playback for mp3 and m4a
Gapless playback for appropriately tagged mp3 and m4a files.
Currently this is implemented in OMXCodec, which most players
use, but should be easy to support in other players as well by
using the SkipCutBuffer utility class.

Change-Id: I748c669adc1cfbe5ee9a7dea2fad945d48882551
2012-03-22 10:06:03 -07:00
Glenn Kasten
2333a27ee5 Remove enforceFrameCount
It was only used to decide whether to issue a warning.
The warning was issued the first time track was created but
not at re-creation.  Now it is a verbose message every time,
not a warning since it happens all the time with key clicks on A2DP.

Change-Id: I9d39f53c0a7eb84b666e55b1b76ff830cf8f37ba
2012-03-21 15:41:02 -07:00
Marco Nelissen
3e6792232a Merge "Add MetaData::dumpToLog" 2012-03-21 15:12:44 -07:00
Marco Nelissen
d0a524fb59 Add MetaData::dumpToLog
Utility method for dumping the content of a MetaData object to the log.

Change-Id: I2d91b991e1d9fed2215e8995a73c2b1854205074
2012-03-21 15:00:27 -07:00
Glenn Kasten
32d72b2f53 Merge "Whitespace" 2012-03-21 07:22:40 -07:00
Marco Nelissen
54fa725483 Merge "Parse mp3 encoder padding/delay" 2012-03-20 09:15:05 -07:00
Marco Nelissen
2ed77701f9 Parse mp3 encoder padding/delay
Get the mp3 encoder padding and delay from a XING frame or iTunSMPB tag.

Change-Id: Icde598c8857d7e7c187a718f478ee9799d6a1b8a
2012-03-20 08:46:11 -07:00
Glenn Kasten
f743e1f6ab Whitespace
Fix indentation, and add blank lines in key places for clarity

Change-Id: I57a0a8142394f83203161aa9b8aa9276abf3ed7c
2012-03-19 17:53:33 -07:00
Glenn Kasten
84569cc4e1 IAudioFlinger::createTrack and openRecord flags
createTrack and openRecord don't need the "old" flags parameter,
which was either audio_policy_output_t or audio_in_acoustics_t
shifted left by 16 bits.  But they do need "new" flags, which
are defined by the application use case.  Initially, the only
application use case flag is timed output, but others are planned.

For output, the audio_policy_output_t flags are passed to
AudioSystem::getOutput, which returns an audio_io_handle_t, and that
handle is then passed to createTrack. So createTrack doesn't need the
old flags parameter.

For input, the audio_in_acoustics_t flags are passed to
AudioSystem::getInput, which returns an audio_io_handle_t, and that
handle is then passed to openRecord. So openRecord doesn't need the
old flags parameter.

Change-Id: I18a9870911846cca69d420c19fe6a9face2fe8c4
2012-03-19 09:04:23 -07:00
Jeff Brown
543ec1c808 Merge "If an application calls System.exit() terminate it immediately." 2012-03-16 11:01:20 -07:00
Wu-cheng Li
8d3c318b2d Merge "Add a new camera open API that allows taking the ownership." 2012-03-15 21:23:24 -07:00
Jeff Brown
4280c4a93e If an application calls System.exit() terminate it immediately.
There is no graceful way to kill Android application processes.
They typically have many threads running doing various things
When System.exit() is called, those threads just keep going
while the cleanup actions run until the process finally.

Performing shutdown actions can easily cause more harm than good.
For example, closing the Binder driver's file descriptor may
cause other threads waiting on Binder to wake up and then crash
in nasty ways after receiving EBADF.

So when an Android application exits, skip the cleanup and just
call _exit() to end it all.

Bug: 6168809
Change-Id: I29790c064426a0bf7dae7cdf444eea3eef1d5275
2012-03-15 19:59:23 -07:00
Eino-Ville Talvala
4d2ece12a6 Merge "Move CameraParameters.h to frameworks/native." 2012-03-15 10:34:00 -07:00
Wu-cheng Li
a1c41e13b5 Add a new camera open API that allows taking the ownership.
The purpose is to let face unlock always get the camera
successfully. What happened was the camera applications may
have opened the camera in onResume under the lock screen.
This API lets face unlock take the camera from the camera
application. A new permission will be added, so other
applicatoins won't be able to take the camera from the face
unlock.

bug:5584464

Change-Id: Ib3d9dcbc2161815b68db42327dc01148453704c6
2012-03-15 14:50:48 +08:00
Eino-Ville Talvala
bf4431bd93 Move CameraParameters.h to frameworks/native.
CameraParameters.h is indirectly required to implement the Camera
HAL. Move it to frameworks/native.

Bug: 6171735
Change-Id: I1bf4db228333be16fc7caa3c51280a9495293011
2012-03-14 17:14:19 -07:00
Insun Kang
41f3f716b0 Defines MediaPlayer APIs to support multiple audio/video/timedtext
tracks.

o Newly introduced APIs are (MediaPlayer):
  getTrackInfo() / addExternalSource() / enableTrack() / disableTrack().

o Timed text tracks are supported only, for now.

o TODOs:
 - Define the audio/video behavior for enableTrack and disableTrack.
 - Refactoring AwesomePlayer / TimedTextDriver so that all types of
   track index can be managed in the correct order and be ready for
   supporting audio/video tracks.
   (MediaExtractor and MediaSource for text file might be necessary.)

Change-Id: Idb85e1b3f2ed49a64f377d05472dd6663ce94e07
2012-03-15 08:36:52 +09:00
Glenn Kasten
81fe4fbd6b Merge "AudioFlinger playback thread CPU measurement in Hz" 2012-03-14 16:28:38 -07:00
Glenn Kasten
f57e2bceb9 AudioFlinger playback thread CPU measurement in Hz
Log statistics on CPU usage in Hz in addition to wall clock time

Use CPU statistics for all playback threads, not just MIXER
(but they are disabled by default by a compile-time debug macro).

ThreadCpuUsage library:
 - Move statistics out of the library and leave that up to the caller
 - Add API to determine a CPU's frequency

Change-Id: Ia1011123146e641fcf210ef26e78ae2b4d3b64ad
2012-03-14 16:03:01 -07:00
Glenn Kasten
6940484150 Merge "Use correct syntax for #include <> """ 2012-03-14 13:54:21 -07:00
Glenn Kasten
c81d31c3f8 Use correct syntax for #include <> ""
Change-Id: I943137108668ae66f8eba18dafe069a7951bcd8f
2012-03-13 16:14:19 -07:00
Jeff Brown
9dc348d756 Merge "Fix spurious ANRs in native activities." 2012-03-13 15:15:48 -07:00
Jeff Brown
2b6c32ca41 Fix spurious ANRs in native activities.
Some native activities experienced ANRs when the input consumer
deferred an input event due to client-side batching.  If the
input channel was fully emptied then the client had no way of
knowing that it should wake up to handle the deferred input event.

This patch also fixes some lock issues in the native activity
input queue implementation.  In at least one error case, it
was possible for a function to exit without releasing the lock.

Bug: 6051176
Change-Id: I4d9d843237e69b9834f8d8b360031b677fcab8c3
2012-03-13 15:00:09 -07:00
Marco Nelissen
1c1d1e7ed7 Merge "Gapless playback, step 1." 2012-03-13 13:23:07 -07:00
Marco Nelissen
84b8320545 Gapless playback, step 1.
Currently able to play Ogg Vorbis, PCM WAV and other lossless files seamlessly
by reusing the initial AudioTrack for subsequent players.

Change-Id: Ie7cf6b9076bdf4f9211574456d192c02c04fecc7
2012-03-13 13:13:14 -07:00
James Dong
7cd59760be Merge "Switched to use the header files in /frameworks/native and deleted the duplicate header files in /frameworks/base" 2012-03-13 12:44:54 -07:00