Clear loaders array after they are destroyed.

See change Ia577caecbacb226a3ce525a01a66283efb6ba754 for details.

Change-Id: I9f07eeceaa3829f71008e6f6a38ab849095bd69c
Signed-off-by: Roman Mazur <mazur.roman@gmail.com>
Memory leak due to bad destroy sequence

During the destroy sequence, it happens that the mWebViewClassic was
set to null in the transferMessages function and consequently, the
call to WebCoreThreadWatchdog.unregisterWebView(mWebViewClassic) is
not really removing the view from the watchdog's list; creating a
memory leak.

Change-Id: I2bae7c8d7c473e2af25e62a485699f88269d6658
Author: Jean-Christophe PINCE <jean-christophe.pince@intel.com>
Signed-off-by: Jean-Christophe PINCE <jean-christophe.pince@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 57869
StringBlock_nativeCreate: Possible Leak

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

Change-Id: Icbeb8eb3fb78849c043fe032cc8f7050da041042
Fix logging typos in GpsLocationProvider

Change-Id: Ibf12947f3758defee990fbf685323334b8d1eeda
Signed-off-by: Magnus Eriksson <eriksson.mag@gmail.com>
Fix bugs regarding IllegalStateException during moving position in cursorwindow.

"startPos + addedRows < requiredPos" could miss a row in boundary position.
Because of the fluctuating row size, "startPos + addedRows < requiredPos" expression could miss a row in boundary position.
For example, simply speaking,
if window capacity = 120 and requiredPos = 120,
"fillWindow" needs to be newly called and "starPos" is 80 for the window.
Unfortunately 120th row is bigger than the rest size of the window,
the row for requiredPos is not in the window.
Then, startPos has to be newly set and the 120th row has to be included in the window.
But by the expression above "startPos + addedRows < requiredPos",
the row for requiredPos is regarded as included in the window.
In that case, by "mCurrentRowID = Long.valueOf(getLong(mRowIdColumnIndex));" statment in AbstractCursor,
IllegalStateException is thrown.

This patch contains modification of the expression as "startPos + addedRows <= requiredPos".

Change-Id: Iaee75241e495949b0a624b836843da18d0bcb98d
fix ImageView.getImageMatrix()

getImageMatrix() does not return "mDrawMatrix",  instead it returns
mMatrix.  This is not reflecting the matrix used in drawing when
Bitmap is changed and mDrawMatrix is set to null while mMatrix still
holds old invalid data.

Change-Id: If24c3118068eca70cfe15786f9715d95c4499f3b
Fix possible integer overflow in MtpStorage

When converting the MB value MtpReserveSpace value to bytes there is a
possible integer overflow since 3 integer values are multiplied, even
though the result is stored in a long variable. This would be visible when
the value is more than 2 GB. This is solved by making the constants
longs instead of ints.

Change-Id: I799129f7076a6e331cece17b5c05aed210499648
Fix for truncated sentence in "Find on Page" field

When typing a text in find on page, then deleting it again the
default text in the field "Find on Page" is truncated by
an invisible view.

This commit fixes the problem by setting the visibility of
mMatches view changes to View.GONE instead of View.INVISIBLE.

Change-Id: I9889f22a254cdabb0cbaba72bff4b14158e5c9ff
Change default intent

Older JB releases have a bug handling persistence invocation. One work
around right now is to have the newer release (with persistence)
use  a lower intent value to allow older release to operate in group
owner mode.

Change-Id: I7ffb66081a352929a6f421e5d6141f592be7d472
Process all display events in order

Display events in each batch received from IPC were being processed in
reverse order, and stopped after the first vsync event (latest
chronologically) was handled. This makes perfect sense for vsync
events, but is broken for hotplug events.

Now we process them all in order, handling all except vsync as we see
them. For vsync events, only the last is reported.

Bug: 7491120
Change-Id: I448d139d21dc27128d75ca1d661de666fff51bcb
Fix ListView is not scrolled properly with arrows

According to ListView's layoutChildren logic, it detaches all children
and rebuilds its children based on visible area which might omit
invisible elements in the adapter.

In this case, arrowScroll methods only tries to find next scroll
candidates from its children so user is unable to scroll more with
D-pad.

This fixes the issue by look forward next child among the adapter as
well as children.

Bug: 7346868
Change-Id: I01ab19ad899b5bcb5ab420ddf08c9ffd136933d1
VpnDialogs: filter obscured touches

Change-Id: Ifcc919c36006c88e36363f5160f9334df0cf7e5b
Applying ChannelScrolling to remove calculateDragAngle

To avoid angle calculation changed the logic to use virtual areas.
When try to drag or pan, check where the current touch point locates
and determine how to drag a page.

Change-Id: Id9bd08a69c4ac93ff385c8088e6c16bed5dc5f88
Signed-off-by: kiwon <kiwon98.lee@samsung.com>
FIX Null Pointer Exception on dialog cancel

Null Pointer Exception occurs because mWebViewCore instance
is made to null while calling destroyJava(). When
1.webview hosting activity goest to background, without calling webview onPause().
2. If app is launched again (having launchmode:singletask ) and another activity (not  webview hosting) comes on top top.
3. It destorys the previous activity holding webview which internally tries to cancel the dialog, but webviewcore instance is null.
Null pointer exception is raised.

Change-Id: Idbcd30d0b0d4a35819444bbaa5c73cced8bb35a3
Signed-off-by: Amit Kumar <amitkecian@gmail.com>
Track stack memory in MemoryInfo.

In /proc/pid/maps the main stack is identified as "[stack]". In Linux 3.4
thread stacks are identified as "[stack:<tid>]" where <tid> is the thread ID of
the thread using that stack. Add support in MemInfo's otherStats to track
memory being used by the stack.

Add sanity check on the length of the otherStats array.
Add detail messages to two null pointer exceptions.

Bug: 8265251

Change-Id: I2b228b147da9bdc5c7a4d825dfc628fcc7923927
Fix NPE when pasting non-text from Clipboard

When copying a link from a bookmark and then pasting it into
a textfield a NullPointerException will occur.
A ClipData.Item is not guaranteed to always contain a text string
and therefore getText() can be set to null.

Using method coerceToText() instead of getText() makes sure that
a text string is always returned.

Change-Id: I81343c0371835a3a7a52045dcd1760e69e59a967