jni: Incorporate liblog reading API

(cherry picked from commit e11cbd441df4a1689c89b2ab91b84523c9f2fd10)

Change-Id: I8b78e4db67b6daabb975ce740fb40478df4ffcef
jni: Resolve build warnings

(cherry picked from commit 087f58dd80e3296a53c6e3c74c089e9a0265f3bd)

Change-Id: I3659193f1ba1ba94561e4684cdb6627880ffc2fa
[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager

Symptom:
When press Home key to home screen, user is able to see the activity's window shown on top of wallpaper and below launcher(widgets).

Root Cause:
The ensureActivitiesVisibleLocked() is called pretty often (for example when a new process bound).
If the top activity "B" was finishing, then the previous activity "A" should be visible.
Therefore, the activity "A" window will be set to visible and then launched activity "A", but it does not updates the visible state in ActivityRecord for "A".
There has a timing issue that if a new activity "C" is started, "C" becomes the new top activity and be resumed.
In that case, Activity "A" window will remain visible even if it is behind a full screen activity "C" because the ActivityRecord.visble of "A" is still false, so the window visibility won't be update.
So when user press home key and back to launcher, the surface of activity "A" will be composed on top of wallpaper.

Solution:
Updates ActivityRecord.visible to true for "A". After "C" is started, the "A" will be called WindowManagerService.setAppVisibility() to set invisible, then called onStop() when execute ensureActivitiesVisibleLocked() again.

Change-Id: I536ba04b95d8d274fea6d679a6493e620bc981e2
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
    be 64-bit.

[x] Some minor changes have been done to conform with
    standard JNI practice (e.g. use of jint instead of int
    in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
    yet. Specifically mAtlasMap member has to be converted
    to hold native pointer using long. Added a TODO to
    AssetAtlasManager.java to indicate the change required.

Change-Id: I940433f601c6db998c1a8ffff338f5361200d5ed
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Change-Id: Ic05ebf2051a225a1638a43f476bab6176c0b5c38
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Track 64bit changes to android/graphics.

All pointers are now 64bits wide, so should be
represented as java longs and not ints.

Also changed DelegateManager and SparseWeakArray to
reflect the new world order.

(cherry picked from commit 88a8364c386c694f7ad56662ef89713dbf7c9d63)

Change-Id: Ic2f55dd6235751169c5014f9d2ccf3f544259a87
Merge "[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager"
Merge "AArch64: Make graphics classes 64-bit compatible"
Merge "AArch64: Use long for pointers in graphics/Camera"
Merge "Track 64bit changes to android/graphics."
Merge changes I3659193f,I8b78e4db

* changes:
  jni: Resolve build warnings
  jni: Incorporate liblog reading API