Merge "Add missing setAccessible to Choreographer's threadInstance" into nyc-dev

This commit is contained in:
Deepanshu Gupta
2016-04-06 19:32:00 +00:00
committed by Android (Google) Code Review

View File

@@ -71,6 +71,7 @@ public class Choreographer_Delegate {
public static void dispose() { public static void dispose() {
try { try {
Field threadInstanceField = Choreographer.class.getDeclaredField("sThreadInstance"); Field threadInstanceField = Choreographer.class.getDeclaredField("sThreadInstance");
threadInstanceField.setAccessible(true);
@SuppressWarnings("unchecked") ThreadLocal<Choreographer> threadInstance = @SuppressWarnings("unchecked") ThreadLocal<Choreographer> threadInstance =
(ThreadLocal<Choreographer>) threadInstanceField.get(null); (ThreadLocal<Choreographer>) threadInstanceField.get(null);
threadInstance.remove(); threadInstance.remove();