安卓Q : Permissions maintaining state after uninstall

标签 android android-10.0

我有一个针对 android 27 API 的应用程序。我正在 Android Q 设备上的 Playstore 中测试此应用程序,该设备适用于托管设备。 我在构建版本 6 的 Android Q 设备上遵循的步骤-

  1. 已安装应用并授予所有权限(附加权限也是自定义权限)。
  2. 已从设备卸载应用。
  3. 再次从 Play 商店安装应用,发现该应用仅请求自定义权限,而不是没有权限。

这是预期的行为吗?有谁知道这是怎么回事吗?

最佳答案

这就是 Auto Backup .

已备份的文件

By default, Auto Backup includes files in most of the directories that are assigned to your app by the system:

  1. Shared preferences files.
  2. Files saved to your app's internal storage, accessed by getFilesDir() or getDir(String, int).
  3. Files in the directory returned by getDatabasePath(String), which also includes files created with the SQLiteOpenHelper class.
  4. Files on external storage in the directory returned by getExternalFilesDir(String).

Auto Backup excludes files in directories returned by getCacheDir(), getCodeCacheDir(), or getNoBackupFilesDir(). The files saved in these locations are only needed temporarily, or are intentionally excluded from backup operations.

您可以通过AndroidManifest.xml进行管理。请参阅android:allowBackup

<manifest ... >
    ...
    <application android:allowBackup="true" ... >
        ...
    </application>
</manifest>

编辑

android:fullBackupContent="false"
android:fullBackupOnly="false"

还有 2 条规则可供设置。

编辑2

我刚刚在android官方网站上找到了更多有用的信息。请参阅here

Note: Any permissions a user grants to your app are automatically backed up and restored by the system on devices running Android 7.0 (API 24) or newer. However, if a user uninstalls your app, then the system clears any granted permission and the user must grant them again.

我最好的猜测是,在用户设置/权限将从系统设备/云中删除之前,应该有一些差异(例如 24 小时)。

希望这能以某种方式回答您的疑问。

关于安卓Q : Permissions maintaining state after uninstall,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57754846/

相关文章:

Android Q后台限制

android - GPS跟踪的前台服务在一段时间后停止工作

android - android Q 中无法识别 MediaProjection 服务类型

android - Toast 未在 Android Q 中显示

Android 加速度计数据类

java - Android 10 设备不开始发现 wifi direct

android - GPS Mock - 我只能模拟一次位置

android - android中动态创建的自定义进度对话框

Android Maps Library V2 缩放控件自定义位置

android - 使用 dagger-2 在 fragment 中注入(inject)首选项时出现 NullPointerException