I'm currently implementing my own DocumentsProvider class in our Android app. But in order for the user to get access to any documents in the application the user has to log in to our servers. It seems like the only way to handle this is by telling the user to login in our app before going to other applications and using us a DocumentProvider. This way we can check if the user has logged in when queried for documents. Is that correct?
Asked
Active
Viewed 39 times
0
-
AFAIK, yes, what you describe is accurate. You can [use `queryRoots()`](https://developer.android.com/guide/topics/providers/create-document-provider.html#security) to only return the roots that are presently valid for the user, based on their authentication status. – CommonsWare Jul 31 '17 at 11:39
-
Okay, so there is no way to prompt the user to login when in another app, right? – stonecompass Jul 31 '17 at 11:46
-
1Not from the Storage Access Framework UI (e.g., the activity displayed by `ACTION_OPEN_DOCUMENT`), AFAIK. IMHO, they ought to provide hooks for that. – CommonsWare Jul 31 '17 at 13:19