Merge "Catching IllegalStateException while device is going to shutdown"