Use a weakref hashmap to store controllers

Protects against memory leaks. TaskViewTaskController adds itself to the
map when the object is created.

Bug: 369995920
Test: atest TaskViewTransitionsTest
Test: revert change to fix memory leak with BubbleTaskView cleanup,
  trigger a bubble and swipe to dismiss without opening it, observe from
  dump that TaskViewTransitions is holding on to the TaskViewContorller
  for that task, trigger a gc for systemui, observe that after gc the
  TaskViewController is cleared up from TaskViewTransitions

Flag: com.android.wm.shell.enable_task_view_controller_cleanup
Change-Id: I180f432e6de5200b63ab17c09504b8ecc32a8292
3 files changed