Add a null check in exifParser to avoid crash while setting Wallpaper.

For some images, while setting as Wallpaper, the src array in
System.arraycopy was null in exifParser, which leads to crash.
This change adds null check to the array used in System.arraycopy.
Also, a safe check is made to ensure start index is not negative.

Change-Id: I46a16b6943aaeeb2395e335bf3926988b881be7a
Don't assume languages are 2 letter codes.

Also, note that this method never worked. Locale
settings were stored with underscores (like Locale.toString)
but matched against AssetManager.getLocales() which
returned language-tag like output.

bug: 10090157
Change-Id: I36ffea6e39ff7d1907b2787f8fd4545c24d326a8
Add NULL pointer check for canvas in GLES20RenderLayer

The canvas member in GLES20RenderLayer is possibly NULL
when some lower level OpenGL API leads to some error.
Such error includes something like insufficient memory
for texture creation. Once the NULL pointer of
canvas is encountered in start API, it should be
correctly detected. A NULL pointer is returned by
start API to indicate failure of canvas creation,
which should be further processed by callers.

Change-Id: Iddfdda0f577a4a01fc0e729b12ccffa4479e60ae
Signed-off-by: Allen Shen <ashen@nvidia.com>