commit | b5b32d479d44c55922e06395861c21b0ea6bd024 | [log] [tgz] |
---|---|---|
author | Riddle Hsu <riddlehsu@google.com> | Wed Mar 02 22:14:20 2022 -0600 |
committer | Riddle Hsu <riddlehsu@google.com> | Thu Mar 03 00:33:22 2022 +0800 |
tree | 39a037b027a32f1183e0785692a932ac05404e88 | |
parent | c67b2ca345187b6f22cef58a1c964a69dadc6d3b [diff] |
Fix NPE in WakeLock#finalize for unit test The stubbed method of "mock(PowerManager.WakeLock.class)" will lose effect after clearInlineMocks. And then finalizer runs the real method finalize() that cause NPE because the mocked object didn't initialize fields. Bug: 219640050 Test: atest WmTests Change-Id: If8ee4fbc98c9e33d6ab6ba75a65ba177fa06f09c