More accurate editorTooltype from handwriting receiver

We used to propagate user tap from ViewRoot to the IME, which does not
preserve EditorInfo#initialToolType across different ViewRoots.
By switching to using handwriting listener(spy), we can always provide more
accurate initialToolType and onUpdateEditorToolType to IME.

EditorInfo#initialToolType is essential for apps and previously a stylus tap
that results in navigation to new Window/ViewRoot wasn't set. With the new
flow, the initial value could be set either when
HandwritingModeController receives a new toolType or last known value.

Bug: 298149197
Test: atest StylusHandwritingTest
Change-Id: I86952bc6591c9f6d29ab2dc94027d4903db6a762
4 files changed