How do you force AccountManager to show the “Access Request” screen after a user has already allowed access?

前端 未结 4 1458
一生所求
一生所求 2020-12-03 05:52

When using AccountManager::getAuthTokenByFeatures, an Access Request screen is shown for the user to allow or deny access to the account. After a user allows access, subsequ

4条回答
  •  -上瘾入骨i
    2020-12-03 06:21

    The only solution I've found is to manually clear out the data stored in the system's accounts.db. Run the following from the command line to clear out all account grants on the system.

    For the emulator:

    adb -e shell 'sqlite3 /data/system/accounts.db "delete from grants;"'
    

    For a device (must be rooted and have the sqlite3 binary installed):

    adb -d shell 'echo sqlite3 /data/system/accounts.db \"delete from grants\;\" | su'
    

提交回复
热议问题