Add cancel method to aot infrastucture

Add cancel method that we can cancel an ongoing trace from app side.
Also implement a timeout mechanism to avoid missing end() call.

Bug: 158756171
Test: atest FrameworksCoreTests:InteractionJankMonitorTest
Test: atest FrameworksCoreTests:FrameTrackerTest
Change-Id: Ie7a23ac9fcd710a221675b1a15c6ebd68efb9a44
4 files changed