[Android Webapp] Catch IllegalStateException thrown by requestPinShorctcut()
According to the docs (https://developer.android.com/reference/android/content/pm/ShortcutManager.html) ShortcutManager#requestPinShortcut() throws an IllegalStateException if "The caller doesn't have a foreground activity or a foreground service, or the device is locked." We create a home screen shortcut if WebAPK install fails. WebAPK installs time out and fail out after 3 minutes. A user may be using a different app by the time that the time out occurs. This CL catches and ignores IllegalStateExceptions thrown by ShortcutHelper#requestPinShortcut() Bug=819725 Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs Change-Id: Iceab1a25a0d80b9869cfc523f091c3af8e590a76 Reviewed-on: https://chromium-review.googlesource.com/959751 Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org> Reviewed-by:Dominick Ng <dominickn@chromium.org> Cr-Commit-Position: refs/heads/master@{#542813}
Showing
Please register or sign in to comment