Replace Bitmap's finalizers with PhantomReferences.
This change also removes the use of SoftReferences for View's
drawing cache.
A bitmap now creates a PhantomReference enqueued in a reference
queue provided by the new Finalizers class. This queue is polled
from a thread started after forking zygote. That thread is in charge
of clearing the references after GC runs and of calling reclaim()
on them. The reclaim() method is now how finalizers are run.
Note that a PhantomReference cannot be kept in the instance it
refers to, which is why they are kept in a separate List.
Change-Id: If3c1a5e9dc23fa49e34857860d730f5cf5ad5926
4 files changed