Exposed the new "min delay" sensor property through native and
java sensor apis. This allows the caller to know what is the
maximum rate at which a sensor can return events, or, if a sensor
works in "update" mode (events returned only when the value changes).
Also augmented SensorManager.regusterSensorEvent() so that it can
accept a value in microsecond in addition to the 4 constants already
defined.
Change-Id: If425e9979892666df8c989d7de3c362230fa19e0
Merge commit '84c924a6c53cb63ca018013c9fda0077413d0005' into gingerbread-plus-aosp
* commit '84c924a6c53cb63ca018013c9fda0077413d0005':
Replace several IPCThreadState::get() lookups with one.
Downloading images over a slow connection could result in errors and
null images.
The JavaInputStreamAdaptor::do_skip method was correctly called in a
loop (to handle the EOF case using read()), but the amount that was
skipped at each time was not decreased by the amount already skipped.
Bug http://code.google.com/p/android/issues/detail?id=6066
Cherry picked from master CL57808
Change-Id: Ie6856898b21ba31de1209e1f995b4ae784c919b9
Merge commit 'e4764521353e898554931a557460fc49209fb0a9' into gingerbread-plus-aosp
* commit 'e4764521353e898554931a557460fc49209fb0a9':
new SensorService
Merge commit '7070b36549d511d6627538c73dfbab23fbae5b43' into gingerbread-plus-aosp
* commit '7070b36549d511d6627538c73dfbab23fbae5b43':
Added support for auxiliary audio effects to AudioTrack and MediaPlayer.
Added methods to AudioTrack and MediaPlayer java classes to enable use of
auxiliary audio effects. The effect can be attached and detached by specifying its
ID and the send level controlled.
Change-Id: Ie74ff54a453096a742688476f612ce355543b6f3
remove old sensor service and implement SensorManager
on top of the new (native) SensorManger API.
Change-Id: Iddb77d498755da3e11646473a44d651f12f40281
This is a common race that happens during application shutdown where the window
may be removed before the input event is finished. The input dispatcher
already recovers from this condition gracefully so there are no benefits to
throwing an exception on the client side.
Bug: 2834068
Change-Id: I53dcc3230464d7f528ac8a1cc9f01b5bb642f428
Merge commit 'c8c79a654d4ae8e3a883854e19cc2df757f72d82' into gingerbread-plus-aosp
* commit 'c8c79a654d4ae8e3a883854e19cc2df757f72d82':
Re-use existing Surface objects when reading them from parcels.
This change adds a process-global cache of previously deserialized Surface
objects so that if a Surface object wrapping the same ISurface gets received
again the same Surface can be used. This is important because the 'tail'
pointer in the SharedBufferClient is stored only on the client side, and needs
to be the same for all the Surface objects wrapping an ISurface instance. This
solves the problem by making there only be one Surface object wrapping an
ISurface per process.
Change-Id: I4bf0b8787885c56277622fca053022d2bb638902
This significantly re-works the native key dispatching code to
allow events to be pre-dispatched to the current IME before
being processed by native code. It introduces one new public
API, which must be called after retrieving an event if the app
wishes for it to be pre-dispatched.
Currently the native code will only do pre-dispatching of
system keys, to avoid significant overhead for gaming input.
This should be improved to be smarted, filtering for only
keys that the IME is interested in. Unfortunately IMEs don't
currently provide this information. :p
Change-Id: Ic1c7aeec8b348164957f2cd88119eb5bd85c2a9f
Merge commit '02c8730c1bf19daf48bec8c6995df676a00a73b1' into gingerbread-plus-aosp
* commit '02c8730c1bf19daf48bec8c6995df676a00a73b1':
Add API to call to vold for mounting OBBs
* Unhide StorageService class; hide all the USB-related items
* Add application-visible API to StorageManager for OBB files
* Add class for parceling OBB info across binders (ObbInfo)
* Add a JNI glue class to libutils/ObbFile (ObbScanner)
* Add API to MountService to deal with calling into vold and checking
permissions
Change-Id: I33ecf9606b8ff535f3a2ada83931da6bbef41cfd
Merge commit 'c5ed5910c9ef066cec6a13bbb404ec57b1e92637' into gingerbread-plus-aosp
* commit 'c5ed5910c9ef066cec6a13bbb404ec57b1e92637':
Add support for new input sources.
Added several new coordinate values to MotionEvents to capture
touch major/minor area, tool major/minor area and orientation.
Renamed NDK input constants per convention.
Added InputDevice class in Java which will eventually provide
useful information about available input devices.
Added APIs for manufacturing new MotionEvent objects with multiple
pointers and all necessary coordinate data.
Fixed a bug in the input dispatcher where it could get stuck with
a pointer down forever.
Fixed a bug in the WindowManager where the input window list could
end up containing stale removed windows.
Fixed a bug in the WindowManager where the input channel was being
removed only after the final animation transition had taken place
which caused spurious WINDOW DIED log messages to be printed.
Change-Id: Ie55084da319b20aad29b28a0499b8dd98bb5da68
Merge commit '2c40582a6c3a5781b39d0504d5aa8934982989d2' into gingerbread-plus-aosp
* commit '2c40582a6c3a5781b39d0504d5aa8934982989d2':
Add native C APIs for working with the Asset Manager
Merge commit '3a053db28451858162f3dd84f18fae2f245b07f1' into gingerbread-plus-aosp
* commit '3a053db28451858162f3dd84f18fae2f245b07f1':
The ICU data is no longer compiled directly into the shared library.
Merge commit 'd76b67c340d1564abf8d14d976fdaf83bf2b3320' into gingerbread-plus-aosp
* commit 'd76b67c340d1564abf8d14d976fdaf83bf2b3320':
IME events are now dispatched to native applications.
And also:
- APIs to show and hide the IME, and control its interaction with the app.
- APIs to tell the app when its window resizes and needs to be redrawn.
- API to tell the app the content rectangle of its window (to layout
around the IME or status bar).
There is still a problem with IME interaction -- we need a way for the
app to deliver events to the IME before it handles them, so that for
example the back key will close the IME instead of finishing the app.
Change-Id: I37b75fc2ec533750ef36ca3aedd2f0cc0b5813cd
Add native Parcel methods analogous to the Java versions.
Currently, these don't do much, but upcoming StrictMode work changes
the RPC calling conventions in some cases, so it's important that
everybody uses these consistently, rather than having a lot of code
trying to parse RPC responses out of Parcels themselves.
As a summary, the current convention that Java Binder services use is
to prepend the reply Parcel with an int32 signaling the exception
status:
0: no exception
-1: Security exception
-2: Bad Parcelable
-3: ...
-4: ...
-5: ...
... followed by Parceled String if the exception code is non-zero.
With an upcoming change, it'll be the case that a response Parcel can,
non-exceptionally return rich data in the header, and also return data
to the caller. The important thing to note in this new case is that
the first int32 in the reply parcel *will not be zero*, so anybody
manually checking for it with reply.readInt32() will get false
negative failures.
Short summary: If you're calling into a Java service and manually
checking the exception status with reply.readInt32(), change it to
reply.readExceptionCode().
Change-Id: I23f9a0e53a8cfbbd9759242cfde16723641afe04
Merge commit '289b9b62372ef52a06113b83dfb870e2c2fb325a' into gingerbread-plus-aosp
* commit '289b9b62372ef52a06113b83dfb870e2c2fb325a':
Add ANativeWindow API for directly drawing to the surface bits.
Also other cleanup and fixes:
- We now properly set the default window format to 565.
- New APIs to set the window format and flags from native code.
- Tweaked glue for simpler handling of the "destroy" message.
- Um, other stuff.
Change-Id: Id7790a21a2fa9a19b91854d225324a7c1e7c6ade
This factors out the boiler-plate code from the sample
app to a common glue code that can be used for everyone
writing this style of app: a dedicated app thread that
takes care of waiting for events and processing them.
As part of doing this, ALooper has a new facility to allow
registration of fds that cause ALooper_pollOnce() to return
the fd that has data, allowing the app to drive the loop
without callbacks. Hopefully this makes some people feel better. :)
Also do some other cleanup of the ALooper API, plus some
actual documentation.
Change-Id: Ic53bd56bdf627e3ba28a3c093faa06a92be522b8
This allows us to avoid exposing the file descriptor of
the event queue; instead, you attach an event queue to
a looper. This will also should allow native apps to be
written without the need for a separate thread, by attaching
the event queue to the main thread's looper and scheduling
their own messages there.
Change-Id: I38489282635895ae2cbfacb88599c1b1cad9b239
Merge commit '8ae5a8e7c04c7b204b739dfcd5da9e2e0f83e1eb' into gingerbread-plus-aosp
* commit '8ae5a8e7c04c7b204b739dfcd5da9e2e0f83e1eb':
Get to the point of being able to do native drawing.
Merge commit '54a181b1a2b1517a9479b21fbf7705a688232faf' into gingerbread-plus-aosp
* commit '54a181b1a2b1517a9479b21fbf7705a688232faf':
Make real API for native code to get its window.
Merge commit '160edb3645f8b7012bab70ae6e6e8c4a5733082b' into gingerbread-plus-aosp
* commit '160edb3645f8b7012bab70ae6e6e8c4a5733082b':
Add ability to guard a thread against setting its own prio to bg
The guard is compiled out by default because it adds overhead to
android.os.Process.setPriority().
Change-Id: Ibb2a648c6349b381abb7ae62a358888b04fba871