Fix 3106227: use WeakReferences for receivers in DigitalClock class
This works around a bug in the framework where LockScreen wouldn't
get GC'd under certain circumstances which would lead to an OOM
crash. It now uses WeakReferences for observers inside the
DigitalClock container class and unregisters them if the containing
DigitalClock goes away.
Also removed mLive variable which was unused and could potentially
leak the receivers.
Left mAttached for debugging so we can use it to determine if the
calls to onAttachToWindow() and onDetachFromWindow() are grossly
unbalanced which may be the root cause of the original problem.
Have cleanUp() explicitly clear unused references to make
tracing through hprof references easier.
Change-Id: I99a7e0c356001b05eab5aa729564553666febfea
6 files changed