use utf8_length() instead of local function, isValidUtf8()

utf8_length() from libutils returns -1 when source not contains
valid sequence for UTF-8. Fixed to use it and removed the local
function isValidUtf8().

Change-Id: If2834ce1d1ae07fd8526ce8bc5df3fd3f44e85c8
Signed-off-by: Homin Lee <suapapa@insignal.co.kr>
Remove deprecation on android:enabled attribute.

The android:enabled was never deprecated and replaced by
android:state_enabled as it was mentioned in the documentation.

The attribute android:enabled when applied to a TextView (or its
descendants) still works until now. In fact that's the way to
disable widgets from layout XMLs.

The deprecation made ADT and lint suggest users not to use this
attribute.

Change-Id: I5e7d7060d9e79a04342ebc723d7937b9bc12a018
Signed-off-by: Yuku on yuku4 <yukuku@gmail.com>
Add header for forward compatibility

Change-Id: I6e3da852d50fc14cfb6fb50f7dd867f37daea19d
Transparent activity orientation problem when previous landsacpe fullscreen activity not yet destroyed.

After terminating landsacpe fullscreen activity,
when user launch transparent activity via portrait home app, transparent activity is shown as landscape mode.

At this time AppWindowToken of previous acitivity has not been deleted, because Activity.onDestory() has not been returned yet.
In this case, getOrientationFromAppTokensLocked() returned ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE.

Ignore hidden application is terminated on the top.
See also http://code.google.com/p/android/issues/detail?id=28927

Change-Id: I51239431120ec6ba8f8ff76871efb2347b9810ca
Volume Overlay Bug When swapping streams

Merged in http://review.cyanogenmod.com/#change,14109

Fixing a bug that when an app is dismissed or loaded that changes
the current active audio stream, if the volume overlay is visible during the swap,
if you adjust the volume (with hard keys) after the stream has changed while
the panel is still visible, the wrong panel (view) is still visible on-top of the
one that is being adjusted.

A good way to replicate this is to
   Open the Phone APP
   Go to the Keypad Screen
   Adjust the volume (not the icon on the overlay)
   While the volume is visible Hit the HOME hard key
   Before the volume dissapears, adjust the volume with hard keys

You will hear and feel the volume adjusting, but the overlay will not update.

Change-Id: Ied50ed83b153234cff82c282e3fd76ed671b420b
Merge "Transparent activity orientation problem when previous landsacpe fullscreen activity not yet destroyed."
Merge "Volume Overlay Bug When swapping streams"
Merge "use utf8_length() instead of local function, isValidUtf8()"
Merge "Remove deprecation on android:enabled attribute."
Fix build - re-generate current.txt

Change-Id: Id6a3100e4aaed473172237ab368e5aeeb7ccf577
Merge "Fix build - re-generate current.txt"
Issue: Foreground activity performs [Resume] and [Pause] when any process died in sleep mode.

Step to Reproduce
1)	Turn off device’s screen. (Sleep mode)
2)	Kill any process.
A.	Engineer Version: kill [PID]
B.	User Version: am force-stop [Package Name]
3)	Foreground activity proceed [Resume] and [Pause] consecutively.

Reason: Since ICS version, activity goes to stopped status when screen turns off.
stopIfSleepingLocked( ) makes activity to stopped status but, pauseIfSleepingLocked( ) was used in GB
and, activity keep paused status and, this problem did not occur.
This change give effect to resuming activity when any process was killed.
Because, resume is proceed without exception for activity status.
The exception only filtered for [ActivityState.PAUSED] in sleep or shutdown mode.
and, resume complete flow when activity status was [ActivityState.STOPPED].

Solution for this issue:
We think that exception’s condition have to change if stopped activity status is intended in sleep mode.
According to activity life cycle, activity can not resume from stop status.

Also check [ActivityState.STOPPING]. :)

Change-Id: Icca3366ac30ffa3b18f6e2393e4d7309089ef26a
Fix for too many binder calls in packagemanager

The packagemanager uses a ParceledListSlice to send back its lists
of installed packages and apps. The list slice has a method append
which, in addition to adding the item to the list, also returns true
if the list has passed a size limit (about 1/4 of the total possible
IPC parcel size) to let the caller know that he should send the
slice. However, when used by the pm, it has an extra ! that makes it
send whenever it ISN'T over this limit instead (and conversely, not
send if it is under). This causes a lot more calls than needed since
it sends tiny one item slices instead of larger ones. This patch
removes the extra ! making it behave correctly.

Change-Id: I8db46d380a25406b55f3214aee1505e81949acc5
Merge "Fix for too many binder calls in packagemanager"
Merge "Issue: Foreground activity performs [Resume] and [Pause] when any process died in sleep mode."
Distance max set incorrectly

The distance max used in the MotionRange is calculated
incorrectly.

Looks like a copy-and-paste error.

Change-Id: I2b6daab088df0fb69e05682b67ca33524ff35987
Fix potential NPE when saving fragment state.

If a fragment's saved view state is null and the user
visible hint is true then the `result` bundle will have
never been initialized to a value resulting in a
`NullPointerException`.

Mirrors support library change I8ba585bc6b9298841490d64bc22a8219cd261adb.

Change-Id: Iabd5ac293d2ece3771da9ef257479eca0dcd523c
Merge "Fix potential NPE when saving fragment state."
Merge "Distance max set incorrectly"