Set the mTargetDensity of BitmapState when inflate BitmapDrawable from xml resource.

The mTargetDensity of BitmapSate was not assigned when BitmapDrawable.inflate().

Change-Id: I31f36c5bcb4b3ff178366a35d175125c5d8573b8
Signed-off-by: CheolOh,Park <cheoloh.park@gmail.com>
Fix cursor memory leak

In current code, if an application opens a cursor to access a
provider, and doesn't close that cursor, later, when this cursor
is garbage collected, it won't get closed. This will cause a memory
leak in the provider. The leaked memory can only be reclaimed when
the application with the leaked cursor was dead.

The solution is, close the cursor when it's garbage collected.

Change-Id: I786915c46d4672b6b1b37414b3bc1ff8cea2e00b
Store correct time stamps in recorded mp4 files

According to the specification (ISO_IEC_14496-12_2008 page 17, 19 and
21) the time is "in seconds since midnight, Jan. 1, 1904, in UTC time"
which is not the same as Unix epoch time. This is already correctly
handled in MPEG4Extractor.cpp when reading files.

The specification also supports 64 bit timestamps which would make
it a bit more future proof, but unfortunately it seems like support
for this in players are poor (tested both Windows media player and
Quicktime player).

Change-Id: I309b834bce4bde018ebd379ba9445908fe4a6abd
Normalize output from aapt d xmltree

When using aapt dump xmltree to dump an XML which has a content element with newlines, the output contains a
newline. This makes it very difficult, sometimes impossible, to understand what is part of the content, and
what is the meta-data.

We now pass XML content through the same normalizer used for other tags.

Change-Id: I327321520fac563eb32aecaf796f2473866697fc
Telephony: Notify the data connection failed if data is not possible

Changes in CdmaDCT to notify the data connection failure whenever
it is trying to setup data and if the data connection is not possible.

Changes in GsmDCT to try intiate the data call if the conditions are
met whenever updating the enabled/met flags of the ApnContext to make
sure that the proper data connection state is broadcast.

Change-Id: I18ae177c1b7602de82e52385fdc9840264fefed2
Telephony: Do not display the data icon if data is not connected.

Change-Id: Iba4b6eb424ea953fa2b10af236b9a9c7e66e7a8e
Telephony: Check SmsTracker's mSentIntent for null

When SmsManager's sendMultipartTextMessage is invoked with null sentIntents,
the SmsTracker object is initialized with mSentIntent as null.
This causes NullPointerException.

Change-Id: I7d5bafcc95cfda517a34739d70afd0101eb690c8
Doesn't display input PIN number after cancel the PIN screen

Set mEnteredDigits to zero when press cancel key.

Change-Id: Ib7c25e5f7f34dd9c280aad78da7cec707140c38f
Signed-off-by: Charles Li<liyuchenlp@gmail.com>
Fix WebView.loadData ignores encoding on Android 3.x and after

In WebView.loadData encoding parameter was ignored (expect if the value was 'base64').
Now, charset encoding is used to display the data.

The following call should display well.
webView.loadData("éàçèù", "text/plain", "utf-8");

This fix a bug that appears in the 3.x android version.
Fix issues:
19747 http://code.google.com/p/android/issues/detail?id=19747
19306 http://code.google.com/p/android/issues/detail?id=19306
17163 http://code.google.com/p/android/issues/detail?id=17163

Sources:
- http://en.wikipedia.org/wiki/Data_URI_scheme
- http://tools.ietf.org/html/rfc2397

Amends:
remove + string concat
remove "or base64" from the url encoded case

Change-Id: I518d916204423f3fc78f76e4e868e5d5377c1cea
Signed-off-by: Guillaume Châtelet <guillaume.chatelet@orange.com>
Plug a fd leak.

Change-Id: Ia7189e67e8a03eceaa81e13cac98f20a82a44276
Fix issue #13366. Take account of stackFromBottom in
computeVerticalScrollOffset().

Change-Id: I743708ef1ac05e358840f37010de36b7d0c6a346
Signed-off-by: Pieter-Jan Vandormael <ezelspinguin@gmail.com>
Pass additional inputs when spawning apps via the Zygote and add SELinux permission checks.

When spawning an app process, the ActivityManagerService has additional information
about the app package that may be useful in setting a SELinux security context on the
process.  Extend the Process.start() interface to allow passing such information
to the Zygote spawner.  We originally considered using the existing zygoteArgs
argument, but found that those arguments are appended after the class name and
left uninterpreted by ZygoteConnection, merely passed along to the class or wrapper.
Thus we introduce a new seInfo argument for this purpose.

Modify the ZygoteConnection to interpret the new option and convey it to
forkAndSpecialize, as well as passing the nice name as a further input.
Also modify the ZygoteConnection to apply SELinux permission checks on
privileged operations.

Change-Id: I66045ffd33ca9898b1d026882bcc1c5baf3adc17
Initialize mJunkPath to false

Change-Id: Ib48bb1d91736d27f055528c3ba275237ff5ada07
Add the possibility to modify the View focus rect

This change makes it possible for a view to supply a different rectangle than
the drawing rect to be used by the FocusFinder when finding a new view to give
focus to. This is useful if e.g. the total view area is larger than the
interactive area of the view.

The default implementation of getFocusRect() will return  getDrawingRect().
The existing behaviour is only changed if getFocusRect() is overridden by a
subclass of android.view.View

Change-Id: I52dd95c6fa296b744e354217051dcec1bb3c8e92
Another case of extra ">"

Change-Id: I870af9400b49bcbe6195e9c251adf174783e3507
Fix shutdown sequence to avoid SIGSEGV when running am command

When the app_process is shutting down the main thread will close the
binder fd while pool threads are executing an ioctl (in
IPCThreadState::stopProcess called by AppRuntime::onStarted in
app_main.c).

The binder driver will then return all pending calls in ioctl
without any error and with a command. One of the threads gets a
BR_SPAWN_LOOPER which will create a new thread (the other thread
gets a BR_NOOP). This new thread then calls
vm->AttachCurrentThread. Usually this results in a log entry with
"AndroidRuntime: NOTE: attach of thread 'Binder Thread #3' failed",
but sometimes it also causes a SIGSEGV. This depends on the timing
between the new thread an the main thread that calls DestroyJavaVM
(in AndroidRuntime::start).

If IPCThreadState.cpp is compiled with "#define LOG_NDEBUG 0" the
pool thread will loop and hit the
ALOG_ASSERT(mProcess->mDriverFD >= 0) in
IPCThreadState::talkWithDriver.

Crashes like this has been seen when running the am command and
other commands that use the app_process.

This fix makes sure that any command that is received when the driver
fd is closed are ignored and IPCThreadState::talkWithDriver instead
returns an error which will cause the pool thread to exit and detach
itself from the vm. A check to avoid calling ioctl to a fd with -1
was also added in IPCThreadState::threadDestructor.

Another solution might be to change the binder driver so that it
returns an error when the fd is closed (or atleast not a
BR_SPAWN_LOOPER command). It might also be possible to call exit(0)
which is done when System.exit(0) is called from java.

Change-Id: I3d1f0ff64896c44be2a5994b3a90f7a06d27f429

Conflicts:

	libs/binder/IPCThreadState.cpp
Pass SearchView suggestion cursor exception to Log.

When an error in fetching a column occurs in your suggestions cursor
adapter this will ensure the stacktrace is logged to provide more
context about what failed.

Change-Id: Iafe4918caebb9b0fb712b758b2d3ace329fd2512
stagefright aacenc: Fix reading out of bounds in pow2_xy

This fixes cases where x was a large number, causing fPart to
exceed the 32 bit signed integer range (while fitting in an
unsigned 32 bit integer), making the table index a negative
number.

Change-Id: I674047db65f89148a93d218c138b42cd8305f80e
Added mpga as valid MediaFile extension

Added mpga as a valid media file extension, it is treated as mp3.

Change-Id: Ie39036d61b6ca50439861fa10be0d824dcc65ed3
Add JNI bindings for some of the libselinux interfaces.

Change-Id: Ifcc68cb06f9f56a04f3bc64dd9906a9436fabc88