你如何强制的AccountManager显示"访问请求"一个用户后,屏幕上已允许访问? [英] How do you force AccountManager to show the "Access Request" screen after a user has already allowed access?

查看:226
本文介绍了你如何强制的AccountManager显示"访问请求"一个用户后,屏幕上已允许访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用<一个href="http://developer.android.com/reference/android/accounts/AccountManager.html#getAuthTokenByFeatures%28java.lang.String,%20java.lang.String,%20java.lang.String%5b%5d,%20android.app.Activity,%20android.os.Bundle,%20android.os.Bundle,%20android.accounts.AccountManagerCallback%3Candroid.os.Bundle%3E,%20android.os.Handler%29">AccountManager::getAuthTokenByFeatures,接入请求屏幕示出了用于用户以允许或拒绝访问该帐户。在用户允许访问,后续调用(使用相同的参数)返回的身份验证令牌不提示用户。

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, subsequent calls (with the same arguments) return the auth token without prompting the user.

如何清除状态,以确保出现的访问请求的提示? (这将至少是用于开发,测试,和演示目的有用。)

How do you clear the state to make sure the Access Request prompt appears? (This would useful at the very least for development, testing, and demo purposes.)

推荐答案

我发现的唯一的解决办法就是手动清除出存储在系统中的accounts.db数据。运行在命令行下,以清除系统中的所有帐户的补助金。

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.

有关仿真器:

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

有关的设备(必须植根并安装了sqlite3的二进制文件):

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'

这篇关于你如何强制的AccountManager显示&QUOT;访问请求&QUOT;一个用户后,屏幕上已允许访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆