391 Commits

Author SHA1 Message Date
Daisuke Miyakawa
5763c1f501 Call register_localized_collators() with the current locale.
Make JNI function for setLocale() call register_localized_collators()
with the current locale, not previous one, every time it is possible.

This is a partial cherry-pick of b945639d0c3fa1850c07a2b80f476c8d242a8bde

BUG: 2514026
Change-Id: I584f1f68814dc084e699714e9d14a034123b49da
2010-05-05 09:01:48 -07:00
Johannes Carlsson
ed0d1ab286 Everytime Bluetooth was turned off two file descriptors were not closed
Using close instead of shutdown on the file descriptors and only clear the file
descriptor that was closed. If both file descriptors are cleared the thread
will not be able to close it.
2010-03-16 15:12:39 +01:00
Mike Reed
6dc9232c1c am a66baccc: Merge "Do not merge" into eclair
Merge commit 'a66baccc8fa9f6fa5f1630845e3c6370cb3418eb' into eclair-plus-aosp

* commit 'a66baccc8fa9f6fa5f1630845e3c6370cb3418eb':
  Do not merge
2010-01-20 18:35:24 -08:00
Mike Reed
12bcbdc681 Do not merge
port stretchy from master
2010-01-20 16:27:36 -05:00
Mike Reed
70660425c0 am 9f954cf2: Merge "Do not merge" into eclair
Merge commit '9f954cf27e9e2bb94c836b1686c0e07500234b27' into eclair-plus-aosp

* commit '9f954cf27e9e2bb94c836b1686c0e07500234b27':
  Do not merge
2010-01-20 13:21:26 -08:00
Mike Reed
1e1a7a5017 Do not merge
roll 1-line fix from master here. Fixes crasher when apps use custom fonts

fixes http://code.google.com/p/android/issues/detail?id=6030
2010-01-19 16:40:31 -05:00
San Mehat
d26707da89 am c93c70c4: Merge "framework: storage: Ensure that filesystems are unmounted before shutdown/reboot" into eclair
Merge commit 'c93c70c4b849d31ff1b5e5cf2fb9462fd60e5da0' into eclair-plus-aosp

* commit 'c93c70c4b849d31ff1b5e5cf2fb9462fd60e5da0':
  framework: storage: Ensure that filesystems are unmounted before shutdown/reboot
2010-01-12 10:02:40 -08:00
San Mehat
7ebf017658 framework: storage: Ensure that filesystems are unmounted before shutdown/reboot
Signed-off-by: San Mehat <san@google.com>
2010-01-12 07:57:42 -08:00
Jean-Baptiste Queru
c4978805dc merge from open-source master 2009-12-21 15:32:25 -08:00
Eric Laurent
9cc489a219 Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search.
Fixed AudioFlinger::openInput() broken in change ddb78e7753be03937ad57ce7c3c842c52bdad65e
so that an invalid IO handle (0) is returned in case of failure.
Applied the same correction to openOutput().
Modified RecordThread start procedure so that a failure occuring during the first read from audio input stream is detected and causes
the record start to fail.
Modified RecordThread stop procedure to make sure that audio input stream fd is closed before we exit the stop function.

Fixed AudioRecord JAVA and JNI implementation to take status of native AudioRecord::start() into account
and not change mRecordingState to RECORDSTATE_RECORDING if start fails.
2009-12-07 05:37:47 -08:00
Christopher Tate
41c4bea27c Don't accidentally signal multiple exceptions in setThreadPriority()
After signalling an exception due to set_sched_policy() failing (probably
because the thread in question had exited before this function was called), we
proceeded to call setpriority() anyway, and raised *another* exception when it
also failed.  We don't do this any more; we just bail after signalling the first
exception.

Change-Id: I397b6a93c73d3f0870176e26759f2bec33e56205
2009-12-04 11:07:48 -08:00
San Mehat
0a42b811ae base: process: Abort setting the process group if one of the threads fails to switch
Signed-off-by: San Mehat <san@google.com>
2009-12-03 12:23:00 -08:00
Android (Google) Code Review
ad431ad863 Merge change Ia3acc2ee into eclair
* changes:
  Fix pairings lost on reboot.
2009-11-22 21:54:29 -08:00
Dianne Hackborn
b8d8167955 Debugging for issue #2228381 android.view.InflateException
Binary XML file line #37: Error inflating class <unknown> after adding a secondary account

Now that I have these debug logs, I want to keep them since they will make
debugging these kinds of issues a lot easier in the future.  (Note in this
case there was no problem in the framework.)

Change-Id: If2b0bbeda4706b7c5dc1ba4a5db04b74f40e1543
2009-11-20 14:26:42 -08:00
Jaikumar Ganesh
b148bc844e Fix pairings lost on reboot.
Bug:2277376
Dr No:Eastham
2009-11-20 13:50:26 -08:00
Kenny Root
6c2d4029f1 Time.parse3339 range checking and proper 'sec-frac' skip
The parse3339 JNI code doesn't properly do bounds checking on the input String.
These changes do some bounds checking to prevent a buffer underflow condition.

parse3339 should allow the fractional seconds to be optional and an arbitrary
length as specified in RFC 3339. This will scan through arbitrary precision
until it finds the timezone indicators.

Change-Id: Ie9d01d0b24163d893c58c747d37873c83b74e6c7
2009-11-16 14:30:24 -06:00
Jean-Baptiste Queru
9db3d07b96 eclair snapshot 2009-11-13 13:53:39 -08:00
Jared Suttles
8b1243e5e4 jni: GpsLocationProvider: Check for pending callbacks before waiting
This change fixes a corner case where a callback may not get handled until
a second callback arrives.  This can happen because there is a significant
section of the wait_for_event function where the mutex is not locked, and
the sPendingCallbacks member could be updated.  We now check to see if
there is a pending callback to handle before we wait for another callback.

Change-Id: I20cfae1e780944bb74133940dda032efc4c55540
Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com>
Signed-off-by: Jared Suttles <jared.suttles@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-11-06 08:28:58 -05:00
Eric Laurent
bda7469d9b Fix issue 2203561: Sholes: audio playing out of earpiece.
Create a new IAudioTrack interface to AudioFlinger when start() fails due to a broken pipe error.
Do the same if start fails due to the same error after time out in obtainBuffer().
Do not indicate that the AudioTrack is started to AudioPolicyManager if IAudioTrack start fails.
This avoids that an AudioTrack keeps a dead IAudioTrack after a media server crash.

Same modifications for AudioRecord.

Add a flag to ToneGenerator indicating that the callback thread can call Java. Without it, when the media server crashes and restarts, the AudioSystem error callback will crash in JNI if the IAudiotrack is created from AudioTrack callback thread.
2009-11-04 23:47:21 -08:00
Android (Google) Code Review
1864d01f2b Merge change Iae849da2 into eclair
* changes:
  add table maskfilter
2009-10-30 17:03:18 -04:00
Mike Reed
0e1e623011 add table maskfilter
hidden for now, since it need only be seen by Launcher2

http://b/issue?id=2210685
2009-10-30 08:11:58 -04:00
San Mehat
957e58670b process: Disable debugging
Signed-off-by: San Mehat <san@google.com>
2009-10-29 13:59:32 -07:00
Android (Google) Code Review
8e312e8160 Merge change Ia5109a87 into eclair
* changes:
  process: Add debug code to log process group transitions
2009-10-29 15:02:53 -04:00
San Mehat
a5109a878e process: Add debug code to log process group transitions
Signed-off-by: San Mehat <san@google.com>
2009-10-29 11:50:43 -07:00
Jack Palevich
4a94318454 Avoid trying to throw multiple exceptions at once.
The typical usage pattern for the get_char helper function is:

    bool thrown = false;

    n = get_char(env, s, 0, 1000, &thrown);
    n += get_char(env, s, 1, 100, &thrown);
    n += get_char(env, s, 2, 10, &thrown);
    n += get_char(env, s, 3, 1, &thrown);
    if (thrown) return false;

As you can see, get_char is called multiple times before the
thrown flag is checked. If the input text contains multiple
incorrect characters, then we have to guard against throwing
the same exception multiple times. (Because doing so will
cause the Dalvik runtime to abort.)

The fix is simple: modify get_char to check if an exception
has already been thrown before throwing a new exception.
2009-10-28 19:38:05 -07:00
Android (Google) Code Review
78a50aa1db Merge change If3c30fc9 into eclair
* changes:
  Patching in hidden API to allow app managed preview frame buffers.
2009-10-23 22:08:30 -04:00
Andrew Harp
94927dffce Patching in hidden API to allow app managed preview frame buffers.
Commit-Id: If3c30fc932697afa966cc97b17749e9996de92ee
2009-10-23 01:44:47 -04:00
Jack Palevich
c620a52b69 Add size checks for glBufferData and glBufferSubData
Without the size checks it's possible for calls to glBufferData
and glBufferSubData to read off the end of the Buffer object's
data, which can cause page faults.

Fix end-of-line characters for the "spec" files. (That's why
every line of these files is changed.)

Enhance our code emitter to properly handle bounds checks for
possibly-null pointers.
2009-10-21 11:02:44 -07:00
Nick Pelly
53f33d8477 Revert "Remove STOPSHIP comment."
This reverts commit 3d0726b4d8a30e57852b70f1dcf4d8d20508cd1e

Change-Id: Ie1ce5d09cc0b799ef0799f30eedc95f0ca5d3fad
DrNo: jerrryw
2009-10-14 12:25:29 -07:00
Nick Pelly
3d0726b4d8 Remove STOPSHIP comment.
Change-Id: I2492bffe57bded65fdbef5cf98e22cef3937e537
DrNo: eastham
Bug: 2089423
Joke: Why don't anteaters get sick? Because they're full of anty-bodies!
2009-10-14 11:46:18 -07:00
Nick Pelly
16fb88a673 Encourage developers to connect RFCOMM by UUID instead of Channel.
Hide createRfcommSocket(int channel)
Add createRfcommSocketWithServiceRecord(UUID uuid)

Rename listenUsingRfcomm(String,UUID) -> listenUsingRfcommWithServiceRecord(..)

Now we have a complete API for developers to make peer-peer RFCOMM connections
with hard-coding the limited (30) RFCOMM channels, instead using SDP lookup
of an UUID.

This commit addresses two serious bugs:
- Do not throw IOException on accepting an incoming RFCOMM connection with
  BluetoothSocket. This was a regression from commit 24bb9b8af4ff6915
- Workaround failure of bluez to update SDP cache when channel changes by
  trying to use the same RFCOMM channel on the server every time, instead
  of picking server channels randomly. This is a pretty ugly workaround,
  and we are still trying to fix the caching issue - but with this
  workaround we are at least shippable and apps will work at least until
  they start colliding on the 30 RFCOMM channels.

DrNo: eastham
Bug: 2158900
Joke: What did the digital watch say to his mom? "Look mom no hands."
Change-Id: Ia4879943b83afac06b6f1a3f2391cf1628afce7d
2009-10-07 23:25:24 +02:00
Mike Reed
a78b0a2d9e add (hidden) setHasAlpha() to allow clients like the view's cache to hint that a bitmap is opaque.
Knowing that a 32bit bitmap is opaque is a performance boost for some blits.
2009-10-07 11:38:05 -07:00
Wu-cheng Li
36f68b8f24 Add zoom functions and sendCommand.
b2060030
2009-10-06 13:25:10 -07:00
Nick Pelly
24bb9b8af4 Provide an API for apps to use a dynamic RFCOMM channel and SDP record.
Hide listenUsingRfcommOn(int channel)
Add listenUsingRfcomm(String name, ParcelUuid uuid)

The new API automatically finds a free RFCOMM channel and registers an SDP
record with the given uuid and name. The SDP record is automatically
removed when the socket is closed, or if the application dies.

Apps are prevented from registering SDP records with the uuid of system
Bluetooth profiles, such as A2DP, HFP and OPP.

Apps are prevented from removing SDP records that they did not create. This is
tracked by pid.

TODO: Provide an API for the connecting app to look up an SDP record.

Bug: 2158900
DrNo: eastham
Joke: "What did the dog say to the tree? bark."
Change-Id: Ia92f51c34615a7270a403255ad2b8faa98c4a3f5
2009-10-06 05:57:50 -07:00
Jaikumar Ganesh
a01a4479a1 Fix rfcomm socket connect return code.
The phone would say connected even when powered off.
Bug id: 2161890
DrNo: Hiroshi

Change-Id: I5dbd19941a80e86c7462670fb844a29cf4eb0908
2009-10-01 19:12:18 -07:00
Jaikumar Ganesh
54172d92af Try to reconnect twice when the rfcomm error code is Connection Refused.
This happens when the the remote headset is in a bad state or is
not accepting connections. Try twice before giving up.

Change-Id: I55e15bad6b72904b8e4ccbca89e17e9bd3ddb61e
2009-09-30 17:46:17 -07:00
Zhu Lan
f9bbe1e71a Bluetooth A2DP suspend/resume functionality
Change-Id: I8366852fa9b6ff9dacf18db00ea1c2be0c00ff34
2009-09-29 20:50:02 -07:00
Dianne Hackborn
afa78967b8 Hack to fix issue #2125365: Sports Trivia compatability with Eclair
Adds a mechanism to tell Paint the scaling factor its target
canvas will have, for it to compute font metrics based on the
correct font size.  Only TextView uses this, but that is enough
for the large majority of apps.

Change-Id: I6cacaa0dd26d40ee3ad959bed0028678d6e9016e
2009-09-28 17:33:54 -07:00
Nick Pelly
57a2292bff Bounds check read and write path in native code.
Already checked in Java, but requested by security review.

Change-Id: I5314dbc32546278b977236a154fba03f38610b1a
2009-09-25 14:13:49 -07:00
Nick Pelly
1a42cfac15 Use LM_SECURE when auth && encrypt.
LM_SECURE enforces man in the middle (MITM) protection.

Change-Id: Ia800bb657b429f8872d72072f7c9450a74028af0
2009-09-24 19:36:27 -07:00
Android (Google) Code Review
0665ae22aa Merge change 26939 into eclair
* changes:
  Fix 2101425: Camera crashes spontaneously in preview.
2009-09-24 19:59:08 -04:00
Chih-Chung Chang
6157de0e2d Fix 2101425: Camera crashes spontaneously in preview.
The problem is we missed an "obj" parameter while calling
postEventFromNative (which put it in a field of a Message object),
so a garbage value on stack is used.

When the GC tries to follow that "obj" field, expecting to find
another object, it crashes.
2009-09-24 15:38:18 -07:00
Android (Google) Code Review
9251c34459 Merge change 26851 into eclair
* changes:
  use new setDither on ImageRef to retain that setting for purgeable images
2009-09-24 12:38:23 -04:00
Mike Reed
17154417e8 use new setDither on ImageRef to retain that setting for purgeable images 2009-09-24 12:35:27 -04:00
Dianne Hackborn
de0dfb7b65 Fix issue #2125720 Weather Forecast Widget - graphics do not scale
I forgot to add the new density field to the Bitmaps' parcelable data.

Change-Id: I77cf3e93e356297e0caed6fc71b62b5cd8f79124
2009-09-23 14:26:02 -07:00
Wu-cheng Li
ffe1cf251a Unhide Camera lock and unlock API. 2009-09-21 07:28:44 +08:00
Jaikumar Ganesh
995ae82f38 Make removeBond() call async.
This call has been synchronus since Bluez3.36.
However, since the semantics for all Bluetooth API calls are
asynchronous make this so too. It does fix an occasional ANR
seen while unpairing.

Change-Id: If81f8ec262ea1f6f62775282ab33855a8669c41a
2009-09-20 11:28:34 -07:00
Jaikumar Ganesh
1caa6d111e Add new API for fetching UUIDs using SDP.
Add new API which clients can use to force an SDP query.
The result is broadcast using an intent having the UUIDs.
The intent is broadcast after a timeout, in case of an error.
This timeout is greater than the page timeout.

Change-Id: I61e6db4c05b34c42f679a66987e37e2063a793b6
2009-09-19 11:29:24 -07:00
Jaikumar Ganesh
4f3ebc43af Fix async calls with Connect And Disconnect Sink.
Change-Id: I814c7fdf40ec0d6aefeb410b1a1b1572ab4a8d88
2009-09-16 17:27:10 -07:00
Chih-Chung Chang
244f8c2636 Fix 2083478: Camera needs an auto-focus cancel API
Change-Id: I13bda991b32aee47e82b5cf9d43b3021c416a9a2
2009-09-15 18:29:03 +08:00