Cleanup ActivityRecord#frontOfTask and its usage

The field caches the 'is this the root of the task' flag. However,
we need to re-compute this every time there is some movement in the
task, or if some activity finished. This approach is also
error-prone, since we need to remember to trigger this update.

This CL switches from caching this field to using a method to check
if an activity is the root when needed.

Bug: 137329632
Test: atest WmTests:TaskRecordTests
Test: atest CtsWindowManagerDeviceTestCases:IntentTests
Change-Id: I7d9115680f023d3d49b018140c6366873555c929
6 files changed