[Android] DirectBuffer cleanup and code tidy