[Android][TouchToFill] Check and recreate Android view before usage
Relying on GetWindowAndroid() returning a non-null value causes crashes in various instances. With this CL, the window is null-checked before use an creation is deferred to when it's actually used. If creation doesn't succeed on first try (e.g. because the window isn't yet attached), a consecutive call might succeed. This approach also has the advantage that the interface remains clean and doesn't require handling the rare Android failure explicitly. This is acceptable since failing to create the surface means, that the UI isn't ready to show any information anyway or anymore. Bug: 1049090 Change-Id: Iebc556e33226151cbc4fb8060653290ae0e22dc3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037573 Commit-Queue: Friedrich [CET] <fhorschig@chromium.org> Reviewed-by:Jan Wilken Dörrie <jdoerrie@chromium.org> Cr-Commit-Position: refs/heads/master@{#739347}
Showing
Please register or sign in to comment