Delete JNI Object references created from arrays

JNI Objects are deleted automatically when the native function returns,
but for large arrays this can not be enough and lead to running out of
resources before the native function returns. Prevent this by deleting
the references as they are created and finished being used.

Bug: 80527811
Test: Try sending a Now Playing List with a large number of items
Change-Id: I34ac44cdafca5b3edade8992a856f2f2fc14f23d
Merged-In: I34ac44cdafca5b3edade8992a856f2f2fc14f23d
(cherry picked from commit 80ceebddbb4583ab30207f14757ab08f1d29f265)
1 file changed