Refactor 904 for safety

Some functions that could potentially cause allocations were being
performed during the ObjectAllocated callback in test 904. If these
allocations occurred the test could enter an infinite loop until it
stack-overflows in native code.

To prevent this we move all potentially allocation causing code (such
as calling java methods and getting jmethodIDs) out to the
getTrackingEventMessages function.

Test: ./test.py --host
Change-Id: Iccd2bea90ef037cc2fc496f46690770cfa2d00f7
1 file changed