commit | 03079387da09c1588d84015b6955e484dccfe69b | [log] [tgz] |
---|---|---|
author | Amy Zhang <amyjojo@google.com> | Mon Feb 22 18:22:12 2021 -0800 |
committer | Amy Zhang <amyjojo@google.com> | Mon Feb 22 18:32:29 2021 -0800 |
tree | 0ff0dad1af7b8f17996f698af7cf264e3150f811 | |
parent | 7658b9e205002bdf80e1836b01bb30e6bb558d26 [diff] |
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