StringBlock_nativeCreate: Possible Leak

osb can be leaked when osb->getError() != NO_ERROR

Change-Id: Icbeb8eb3fb78849c043fe032cc8f7050da041042
Handle errors from AudioEffect::queryNumberEffects

There may be cases where queryNumberEffects fails leading
to the usage of the uninitialized numEffects.

Change-Id: If6d46987021ff6f0c9a2123d8714ff5fdf9ced45
Leak in ToneGenerator_native_setup

Failure in ToneGenerator::isInit causes a leak.
lpToneGen should be deleted.

Change-Id: I48df7a328fed01be8412d5449ee0753dad3c101f
Return error upon attempt to use non-existent APN

startUsingNetworkFeature will ignore errors from
reconnect - causing ConnectivityService to send
faulty information back to requester.

Change-Id: I4e0fcc1addd84da409cdc1eed1a95d25d925e020
avoid crashing system serer process

Context#unregisterReceiver will throw IllegalArgumentException
if the receiver has already unregistered.

In GlobalAction class, when SilentModeAction is changed, it will
close the dialog with some delay. So there is a possibility
that it would unregistere again for the same receiver if a user
changes slient mode againand again. System must not crash in such
a case.

Change-Id: I33662feb48a770d39a8413901ec77ac1acd16bc7
Remove unnecessary locking for screen broadcasts.

The actual handling occurs in updateScreenOn() on the other side of a
handler, which acquires the lock correctly.

Change-Id: Ibd359446dba8e88f81d34f1e10a6b5e150348f89
Fix regression in ListView click handling

Regression caused by patch a607223f34

If an item click handler results in the ListView becoming detached
from the window, the performClick runnable could be executed twice.
Null out the mTouchModeReset runnable before running the click handler
so that it is not run by the detach handler.

Change-Id: I2fab60232027bb4876f9912088e0ffb9b17d308c
Avoid possible memory leaks by ensuring stream closures

Stream close() methods should always be called in finally block
to ensure we don't accidentally leak a stream.

Change-Id: I3460b558ed5b4489296388c9a52fbb773cefd31f
Frameworks part: Port Reboot button in power widgets

patch set 2: removed permissions specific to Network Type Button

patch set 3: added license text

Change-Id: Idbcebcc176df133e020ff7f10d78fb6111bf38e9
Enable Copy/Paste in Google Talk

Thanks to TeamBAMF: http://www.teambamf.net/topic/4465-modhowto-enable-copypaste-for-google-talk/

Change-Id: Icf20b68fc6fb9eef4c9fbe848c7fa803cead5038
show SELECT ALL icon with text in landscape mode

Though set config_allowActionMenuItemTextWithIcon as true,
icon for the "SELECT ALL" menu on ActionBar is not shown as staring
in landscape mode.
To fix it, use "SELECT ALL" icon in onCreateActionMode() to show the
icon and text together.

To show or hide text is decided by updateTextButtonVisibility() of
core/java/com/android/internal/view/menu/ActionMenuItemView.java

STEPS TO REPRODUCE: (please be specific)
1. launch Browser/Chrome and go to google.com
2. rotate to landscape mode
3. long press on URL address

Bug: 8073761
Change-Id: Ie0e0aa45f0dff609ed8c03e4423b163bad5452ed
Decrease lag generated by autorotation on

There are different issues from what I understand:

1) Discarding of events too close to each others is broken
as mAccelerationTimestampNanos is conditionned by isAccelerating()
on TF101 no events are discarded anymore, and so it creates an update every ~50ms
filing up the android notification message queue quite a bit for nothing and so generating lag.
2) isAccelerating seems incorrect to me too, the code means more that it's accelerating "out of range" and should be discarded in that case.

=> Discard the sample if outOfRange and don't condition the update of mAccelerationTimestampNanos that way next time we come back "too soon"
the sample will be properly discarded.

3) with events being discarded properly on the WindowOrientationListener
the SensorManager can now update every 20ms instead of 50ms
but that is definitely overkill.
=> add SystemProperty sensor.loop.minms with a default value of 50ms to throttle the notifications.
That way the thread sleeps properly instead of sending events as fast as it can.

(increasing up to 100ms can be ok depending if you want faster response or not.)
This can be positionned on a per device prop too.

4) Add 2 SystemProperties:
one on the SystemSensor side: sensor.magnitude.threshold with a default 0 value(doesn't change the behavior)
one on the WindowOrientationListener: orientation.magnitude.threshold with a 200 (0.2G) default value
These allows to discard the sample if it is too close to STANDARD_GRAVITY (ie not accelerating much)
These can be set on a per device or use the default values.
On the TF101 200 works most of the time. But weirdly when docked the reported gravity seems to have an additionnal offsert of -0.2
maybe some magnetic interference from the dock...

For the moment the 0.2G threshold is positionned on the Orientation code.
Once the cpp sensor poll crazy loop is solved it could be better to use the sensor.magnitude.threshold instead.

That should take care of most of the lag generated by autorotation.

Change-Id: I093227f539050a6bad8e6e8d9f533eff7bddd0d6
Another optimization of glyph cache uploads

Previously, cache textures were updated whenever mCurrentCacheTexuture was changed.
Since updating cache textures needs glTexSubImage2D call, frequent changing
of mCurrentCacheTexture (which can easily happen when an app uses lots of unique glyphs
even with precaching) caused many glTexSubImage2D calls and bad framerates.
This patch optimized isssueDrawCommand function. Consequently, changing mCurrentCacheTexture doesn't
cause glTexSubImage2D call any more and it will improve font rendering performance.

Change-Id: Id19d959fa0e69eeb2a39f83a57e311d7394586b2
Signed-off-by: Sangkyu Lee <geteuid@gmail.com>
resolver list is not cleared on rebuild

Refactoring ResolverActivity.java

Change-Id: I84e6420ff98ddcafd27a52b041ddb1c50e7d7362
Signed-off-by: You Kim <you.kim72@gmail.com>
Try go-negotiation when invocation request is deferred.

Devices setting persistent_reconnect to 0 in wpa_supplicant returns "information is currently unable" error.
In that case, the connection establishment was always failed when the other device does NOT handle the invitation request.
So, try go-negotiation for interoperability.

Change-Id: Ia30a1c63d1bb4acc186a71248fb0aa5ea7edc627
Signed-off-by: Yoshihiko Ikenaga <yoshihiko.ikenaga@jp.sony.com>
AsyncChannel to support remote death notification and post a
disconnect message to the source handler.

Change-Id: I7368cb466d9e33f7da8095ef2de25fc70f13d47e
Fix EventLog string class problem in onOptionMenuSelected

EventLog function can handle string,integer class and long class. (in android_util_EventLog.cpp)
If menu title string are used bold tag(like <b>test</b>), it'll be android.text.SpannedString.
In onOptionMenuSelected, it is using item.getTitleCondensed() function for writing event log.
therefore any android activity using tag menu string(like <b></b>) can be crashed by IllegalArgumentException.

I found this crash on GMS Application.
change locale chinese -> launch Google+ -> hangout -> menu key -> Invite(expressed chinese) click -> Google+ crash

Change-Id: I0437be81699925e29bf4510eb615ef2424432763
convert jint to uint32_t.

This works around a compiler bug, and is probably more
correct anyway.

Change-Id: I1c49064bd64c31dafae560e416c665de0449f245
return value of String.replace() is ignored.

Change-Id: Id7330e1ffc9f429b22f153d8e644fa7c64354173
Signed-off-by: You Kim <you.kim72@gmail.com>
Ensure running mTouchModeReset when AbsListView is detached

mTouchModeReset should be executed when AbsListView is detached from window.
If not, when the AbsListView is re-attaced to window,
the child can retain a pressed state.

You can see this problem easily when you double-touch an item of
option menu very quickly.

Change-Id: I5aaa1fd5b95847efb2f5f1b5ec7cabe8eb85b237
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>