Simplify ResultCallbacks by not using WeakReference
This is a follow up CL to my previous CL [1], which introduced ResultCallbacks in a bit conservative way, that is, to always wrap Completable.* with WeakReference in case the target app fails to respond for some reasons. Using WeakReference would make sense if otherwise we would put more stress on the memory than holding WeakReference object itself. In our case the expected memory stress on extending lifetime of Completable.* objects is still comparable with the memory cost of holding WeakReference objects instead. Let's remove WeakReference from ResultCallbacks in favor of simplicity. This change should be completely transparent to other layers since there is no change in the semantics (except for the lifetime itself of Completable.* object, which is technically observable with APIs such as java.lang.ref.Cleaner). [1]: Ic65a95eb5d0fd56f505a02fd9083bcf6694b6734 f87f7508 Bug: 192412909 Test: atest -c CtsInputMethodTestCases Change-Id: I43966494ccb4fceb8e7f8c60bd6ce3cc7fbfdd82
Loading
Please register or sign in to comment