Framework/base: Added synchronization block to avoid race condition

Fix for the synchronization issue leading to access of an array
Index out of bounds. Issue occurs due to race condition between
removing the activities of a crashed process from history stack
and resuming a separate activity.

Change-Id: I14bb5834e778c15b674248e46fe93b0ce9f37967
EthernetDataTracker: Set network available on connected

This change fixes state mismatch found in the bugs below,
and makes the code look consistent with disconnect().

In startMonitoring(), reconnect() is called before mNMService.registerObserver().
Then dhcpThread.run() could finish without getting interfaceLinkStateChanged() callback.
In such a case, mNetworkInfo has connected but not-available state - which is contradictory.

Bug: 8113933, 8291000, 8291039
Change-Id: I29d74f8d09dcffb97d6c9f8198811bca046fef0c
Bug fix for building the hover target list

lastHoverTarget should be updated even though lastHoverTarget is not null.
If not, the hover target list cannot have more than one hover target.

Change-Id: I21b49e8cbf3657321b2f1f2c20a3bdeb7f07bd48
Signed-off-by: Sangkyu Lee <sk82.lee@lge.com>
Properly rotate full [-pi, +pi] orientation range if available

The code currently in place assumes that orientation has a range
of [-pi/2, +pi/2] as may be found with a touch digitizer. However,
when used with a digitzer that can report the full [-pi, +pi] range
of orientations (e.g. a stylus) the calculations here are incorrect.

This patch checks if the post-rotation value is out of range for
the axis, and wraps it back around.

Change-Id: I03a22f7bf9526a5d995df1a18430d6dd24c6d6ee
Fix CalendarView to show the month title properly.

Step to reproduce:
Do this test on a Tablet (i.e. do in multi-pane layout)
1. Settings > Date & time > Uncheck the Automatic date & time checkbox.
2. Select 'Set date' and set the month to January and Done.
3. Re-select 'Set date' then you will find no month title just above the calendar.

Change-Id: I2489b454a4526be13f1fbdc61a72edcd6b6942a0
change "next" to "done" in minute IME option under 24-hour format

We don't need "next" button under 24-hour format any more.
So, we changed from "next" button to "done" in IME option
when setting minute under 24-hour format

Change-Id: Ic9b1673248183060ba7279b63648a85dc39ca3b9
Add additional Method that check whether a table is empty or not

Application Devleopers are using queryNumEntries API
implemented by "COUNT(*)" to check whether a table is empty or not.
COUNT(*)  has to process the entire table to compute the result.
But, "EXISTS" can stop after a single matching row has been found.
So, Using "EXISTS" is more faster than "COUNT(*)"
I added new API using "EXISTS" to check whether a table is empty or not

Change-Id: Idcc2633d0a5349c59f41e125cf34c9dc6622cdbe
Fix documentation of requestCode parameter.

It's not correct to state requestCode is 'currently not used'. It can be
used to differentiate multiple PendingIntents since a number of Android
versions now. Also, the introduction block of the PendingIntent
documentation explicitly states this as a possible use:
"If you truly need multiple distinct PendingIntent objects active at the same
time [...], then you will need to ensure there is something that is different
about them to associate them with different PendingIntents. This may be
any of the Intent attributes considered by Intent.filterEquals, or
different request code integers supplied [...]"

So fix the documentation inconsistency to make the possible use
immediately clear.

Change-Id: Ia65d7a5ab12c2c3ee1aa1c5107e5ea8fd937b765
when locale is non-Enligh, sometimes month spinner needs a number IME

When locale is non-English like korean, chinese, etc.,
month displayed string is started with number.

So, It's better to use Number IME for month selection.

Change-Id: If0444d62679b1f31d98fdedd2f06c2d445cade2a
Can not mark the same content of browser page after copy

Marking a text on the web page and then press copy works,
but trying to mark the same text again does not work.
The reason for this is that the selection never gets
cleared in webkit.
The fix, calling cleaSelection in the onDestroyActionMode.
Also added clearSelection when getting an
onConfigurationChange.

Change-Id: I59b384cb5441b6a3a05007ea7e77f9699889a87c
Fix wrong log information in DevicePolicyManagerService

When user reset password their password,
if password doesn't match target quality of device,
DPM print a log why can't reset password.
however log message isn't correct information.
in log context, it have to exist current quality
and target quality. this patch can help print correct log.

Change-Id: I5c8fb1c77ddbe1bdbc76e35038c897e2e8efb077
Adding matching @deprecated.

Bug: 8657266
Change-Id: Idbd22dc647f11441d15da12eb23723539768cf4c
Human-readable POSIX capabilities for SystemServer.

Change-Id: I8fecdc55b2cf0041ceed643eb48df53d22ecd600
Merge "Adding matching @deprecated."
Don't set ADDR_COMPAT_LAYOUT on the emulator

Don't work around third party app bugs on the emulator.

Change-Id: I4440fcd56b72e3a74881ddec2a469f037a060525
Merge "Don't set ADDR_COMPAT_LAYOUT on the emulator"
Merge "Human-readable POSIX capabilities for SystemServer."
Merge "Can not mark the same content of browser page after copy"
Use the newer ZoneInfoDB API.

Change-Id: I846c720ae6c262afb4fd7f8a749008c837e76cc4
Merge "Use the newer ZoneInfoDB API."