Why android:fullBackupOnly default value is false?

假如想象 提交于 2019-12-11 18:46:06

问题


In https://developer.android.com/guide/topics/manifest/application-element,

android:fullBackupOnly

This attribute indicates whether or not to use Auto Backup on devices where it is available. If set to true, then your app performs Auto Backup when installed on a device running Android 6.0 (API level 23) or higher. On older devices, your app ignores this attribute and performs Key/Value Backups. The default value is "false".

If the default value is false, does that mean all Android version will prefer legacy Android Backup Service over modern Android Auto Backup?

But, according to https://developer.android.com/guide/topics/data/autobackup

Auto Backup for Apps automatically backs up a user's data from apps that target and run on Android 6.0 (API level 23) or later.

Seem like modern Android Auto Backup is the default choice. If so, why the default value for android:fullBackupOnly is false?


回答1:


The language that is used in documentation is confusing indeed. There are two ways to backup data: Auto-backup and Key-value backup. When you define a BackupAgentHelper in you manifest, you are using Key-value backup.

  • android:fullBackupOnly=true means that you will always do Auto-backup, even if you have a BackupAgentHelper defined in your manifest.
  • android:fullBackupOnly=false means that you do Auto-backup if no BackupAgentHelper is defined, and Key-value when a BackupAgentHelper is defined.


来源:https://stackoverflow.com/questions/57357731/why-androidfullbackuponly-default-value-is-false

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!