Fixed VM memory leak in AudioSystem JNI interface

The function android_media_AudioSystem_error_callback from AudioSystem
JNI interface is using FindClass function but does not delete the
reference created by VM in this function.
By doing this call, VM will add a local reference in IndirectRefTable
and it's the caller's job to delete this reference.
By not doing this, everytime this callback is called, a new reference is
added and never deleted.
The effect is crashing the VM running system_server:

E/dalvikvm( 3071): JNI ERROR (app bug): local reference table overflow (max=512)
W/dalvikvm( 3071): JNI local reference table (0x732da288) dump:
W/dalvikvm( 3071):   Last 10 entries (of 512):
W/dalvikvm( 3071):       511: 0x42a90008 java.lang.Class<android.os.Parcel>
W/dalvikvm( 3071):       510: 0x4381fd90 android.view.KeyEvent
W/dalvikvm( 3071):       509: 0x439b9808 android.view.KeyEvent
W/dalvikvm( 3071):       508: 0x42d2fe18 java.lang.Class<com.android.server.input.InputManagerService>
W/dalvikvm( 3071):       507: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       506: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       505: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       504: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       503: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):       502: 0x42ad4298 java.lang.Class<android.media.AudioSystem>
W/dalvikvm( 3071):   Summary:
W/dalvikvm( 3071):       510 of java.lang.Class (3 unique instances)
W/dalvikvm( 3071):         2 of android.view.KeyEvent (2 unique instances)
E/dalvikvm( 3071): Failed adding to JNI local ref table (has 512 entries)
...
E/dalvikvm( 3071): VM aborting

In this case, PID 3071 is system server.

Change-Id: I0c113eb72256984854d59a3ccef11a8d23f96e79
Signed-off-by: Robert Chiras <robert.chiras@intel.com>
Improved profile.start-immediately comment

Change-Id: I41bda6a1cd99cb0a8230961e0462a41cb552887e
Merge "Improved profile.start-immediately comment"
Track changes to libcore ICU apis.

All private APIs that earlier accepted Locale.toString
now accept Locale instances.

Change-Id: I80df88d0c928e921320b6545b1267adecefe64af
Merge "Track changes to libcore ICU apis."
Move dex file pruning to installd.

Companion change for commit 7dbf95cd7606e22267
in frameworks/native.

bug: 14407732
Change-Id: I520aa3950fb6b87c7ca5a805e597d734496407d3
Merge "Move dex file pruning to installd."
Support deprecated language codes.

Locale.toLanguageTag will transform the obsolete (and
deprecated) language codes "in", "ji" and "iw" to
"id", "yi" and "he" respectively.

All versions of android prior to "L" used the deprecated
language tags, so we will need to support them for backwards
compatibility.

bug: 13230947

(cherry-picked from commit 21fc8ba39c4799a346caf95)

(also contains a partial cherry-pick of 857ba4af because
including it is the easiest way to avoid conflicts.)

Change-Id: Ia1d0f2d8e20f5679ff3990506f6468ebf789c94a
Merge "Support deprecated language codes."
Remove some pointless code.

Unnecessary disk reads for values that are never
used (and cached elsewhere, so that optimization is
rendered pointless).

Change-Id: Ic14a8b53a96908bb03eae28759d7be2c217e8125
Merge "Remove some pointless code."
Shrink profiler.start-immediately to fit in the maximum property size

Change-Id: I25f24f5e5b128aa6a300bdc1008427451bd9cecf
Merge "Shrink profiler.start-immediately to fit in the maximum property size"
Switch to a type-safe album art interface.

(Requires a matching change in frameworks/av.)

Bug: 15514223
Change-Id: I4e494cc5d7a2eb82cd2b7ae3b829fc663136267a
Merge "Switch to a type-safe album art interface."
Add service_contexts to policy update bundles.

Add service_context file to SELinuxPolicyInstallReceiver
to allow updating.

Bug: 12909011
Change-Id: Ic0ad89958cc750413787d57e0f51363212a8730b
Merge "Add service_contexts to policy update bundles."
Move FieldPacker over to use large objects on 64-bit.

Change-Id: I1d4d502a3f9d86c6cf0f516cc087b1457f86ac28
Merge "Move FieldPacker over to use large objects on 64-bit."
update parameters in uploadToTexture() for GLES20

Google optimized the uploadToTexture with GLES3.0+,
This allows us to upload a sub-rectangle of texture,
but this has compliance issue with GLES 2.0.

With OpenGL ES 2.0 we need to copy the bitmap in a
temporary buffer if the stride doesn't match the width,
and then upload entire temporary stripes.

Change-Id: I8987cd8347913c61b7fa45bd47be1189aa6bdb05
Signed-off-by: Shenghua Lu <shenghua.lu@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Guobin Zhang<guobin.zhang@intel.com>