Catch BadTokenExceptions displaying alert dialogs for incognito intents.
It appears that on certain devices/variations of Android, the implementation of Dialog.show() can end up with the same ViewRootImpl being added to the WindowManager twice, resulting in a BadTokenException. This change adds a safer variant of shouldShowIncognitoIntent, the aptly named shouldShowIncognitoIntentSafe, that returns a boolean to indicate whether we successfully showed the alert dialog or not, allowing us to log the error but handle the failure without crashing. TBR=bshe@chromium.org Bug: 782602 Change-Id: Iea5bd3b8f45c9824e34f581d208653a206b65c1e Reviewed-on: https://chromium-review.googlesource.com/801257 Commit-Queue: Troy Hildebrandt <thildebr@chromium.org> Reviewed-by:Ted Choc <tedchoc@chromium.org> Cr-Commit-Position: refs/heads/master@{#520773}
Showing
Please register or sign in to comment