Skip to content
Commit 03079387 authored by Amy Zhang's avatar Amy Zhang
Browse files

Check if the weak reference of java object is alive before using it

This CL get the global strong reference from the weak reference before
calling methods on a weak java object reference in Tuner JNI.

The method call would use the strong ref instead of the weak ref after
making sure it's non-null because weak ref is not garanteed non-null
even after the null check

see https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/functions.html#weak_global_references
for more details

Test: atest android.media.tv.tuner.cts
Bug: 176190716
Change-Id: I81215c18cda413c5ddee0e46480ce3783dfe4be9
parent 7658b9e2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment