Fix for native leaks in YuvToJpegEncoder.cpp

Objects allocated by Get<object>ArrayElements function,
should be released. Add a fix to release this objects
in error cases.

Change-Id: Idf834523d93bb2dfd6b872e3b2179b7f1bba38f3
Cast CallVoidMethod's size_t parameters to jint

offset and size variables are passed to set method
of MediaCodec.BufferInfo java class. The corresponding
actual parameters of set method are of int type in java.

These variables are expected to fit in jint as they
indicate the offset and size of data in a media codec
buffer.

The variables are cast to jint, prior to passing to
java method, to avoid problems caused by automatic
type promotion of parameters when passed to a
variadic function, CallVoidMethod.

Change-Id: I39e202306f1b7122448c947f6d275f00251bb33a
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
MetadataRetriever: Check null pointer to avoid tombstone crash.

When the app's vm-heap is not enough, memory allocation for big
object like bitmap may failed.

This patch add protection for bitmap creating to avoid segment
fault error in the following GetIntField function.

Change-Id: I63977dc602f4ed395afd11004a0ed027173fb685
Signed-off-by: wang, biao <biao.wang@intel.com>
Signed-off-by: TingX Li <tingx.li@intel.com>
Signed-off-by: Wang LiangX <liangx.wang@intel.com>
WallpaperManager: add NULL pointer check for getCropAndSetWallpaperIntent

Originally the api 'getCropAndSetWallpaperIntent' does not check
whether the parsed parameter is a NULL pointer, as leads to the
whole app crash if it call this api with a null parameter accidentally.
A null pointer check logic is added into its original parameter check
logic, so that this API will throw an IllegalArgumentException if it
is parsed with a null pointer

Change-Id: Ib7de40e571419d09e1a744edc969eb7162766b75
Merge "Cast CallVoidMethod's size_t parameters to jint"
auto-merger: merge in from aosp/master
Fixes issue causing pseudolocalization of strings
in non-translatable resource files.

Change-Id: Ic8e5effc86226d5be00561ac71bab7695ef90376
Merge "Fix for native leaks in YuvToJpegEncoder.cpp"
Merge "WallpaperManager: add NULL pointer check for getCropAndSetWallpaperIntent"
Merge "Fixes issue causing pseudolocalization of strings in non-translatable resource files."
Map KEY_APPSELECT to APP_SWITCH.

Change-Id: Iec801f2edfec9923aac088cb66663f64d62b3df6
Signed-off-by: Olivier Gay <ogay@logitech.com>
Signed-off-by: Mathieu Meisser <mmeisser@logitech.com>
Fix broken logging in Zygote.cpp.

- Differentiate between clean exits and signals.
- Change the logic for the waitpid warning. We should log it
  only if the *first* call to waitpid returned ECHILD.

Change-Id: I6bc50e4ffd100fb7f3f526d6b4056bed10b8045f
Merge "Fix broken logging in Zygote.cpp."
Create arch specific cache dirs during zygote startup.

The runtime expects them to exist before it's launched.
The boot image / art files are created during the first
zygote launch.

(cherry picked from commit da738713e4e2120a324e8ab6fd11aa0e54a3c66e)

Change-Id: I7472aa25c16a1cf95791af2bdf80ed0d73123872
Fix x86 build in app_process.

Look for __i386__ and not __x86__.

(cherry picked from commit 47d526217b3fd0d17ba751c66d25cfaf1c6ed7cd)

Change-Id: I848ba351c378e59ab6744ca1983ae4463ae75ba4
Merge "Create arch specific cache dirs during zygote startup."
Merge "Fix x86 build in app_process."
Implement FileUtils#contains.

Partial cherry-pick of changes 4ca728c0 and 21de56a9, which
can't be cherry-picked due to their large surface area.

Change-Id: Ife46e150d360cd5241dea93863141749233c1805
Merge "Implement FileUtils#contains."
Support per-package lib dirs for bundled apps

Bundled apps can now use /system/lib/apkname or /system/lib64/apkname
in addition to the (globally shared) /system/lib and /system/lib64
directories.  Note that when an app is updated post hoc the update APK
will look to its normal library install directory in
/data/data/[packagename]/lib, so such updates must include *all*
needed libraries -- the private /system/lib/apkname dir will not be in
the path following such an update.

"apkname" here is the base name of the physical APK that holds the
package's code.  For example, if a 32-bit package is resident on disk
as /system/priv-app/SettingsProvider.apk then its app-specific lib
directory will be /system/lib/SettingsProvider

Bug 13170859

(cherry picked from commit addfbdc09ccf258395db8bfc510989a4c583f7ab)

Change-Id: Id82da78024a6325458b8b134d7d91ad0e5f0785e