Fix MediaRouter leaks.

There was a cyclic reference from the value of a WeakHashMap
to its key which resulted in MediaRouter instances and associated
Contexts being leaked.  Fixed this by avoiding the cycle but
there is now a little more burden on the application to ensure
that it holds a reference to the MediaRouter instance as long
as it is required.

If we wanted to make the support library MediaRouter behave more
like an object returned by Context.getSystemService() then we
would have to arrange for the Context to hold a strong reference
to the MediaRouter to keep it alive but there isn't any good API
to accomplish this.

Bug: 9189100
Change-Id: I15b214ae9dbad3f08be04ec852b07cc61a00886e
1 file changed
tree: 418ec82327dff5402ebd3ac73f2bb58b6a32594b
  1. renderscript/
  2. v13/
  3. v4/
  4. v7/
  5. CleanSpec.mk