What about the case where you get a blob? Does the download manager actually pass a File object with a name that you could use here?  Or does it pass a name in the activity in some other way?

I find it confusing that you don't have an if/else for the blob and url possibilities.