PlayServicesDriveAuthManager

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun authorize(): AuthorizeOutcome

Request the drive.appdata scope. Returns AuthorizeOutcome.Authorized when consent already exists (silent), or AuthorizeOutcome.NeedsConsent carrying an IntentSender the UI must launch.

Link copied to clipboard
open suspend override fun revoke()

Revoke the Drive appDataFolder grant (#246 — true backup disable). After this the app no longer has Drive access; the next authorize returns AuthorizeOutcome.NeedsConsent. No-op if nothing is currently granted. Best-effort: a network failure to reach the revoke endpoint is logged, not thrown (the local grant is gone from the user's intent either way).

Link copied to clipboard

Returns a drive.appdata access token without UI, or throws if consent has not been granted yet. Use from headless paths (e.g. the dust backup coordinator during a routine refresh) — the first-time consent must come from a UI flow (DriveAuthManager.authorize + launching the IntentSender).

Link copied to clipboard
open override fun tokenFromConsent(data: Intent?): DriveAuth

Extract the token from the consent activity result Intent.