Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean: Should explicitly set 'android:fullBackupContent' to avoid backing up the GCM device specific regId?

Tags:

What does this Lint warning mean:

Should explicitly set 'android:fullBackupContent' to avoid backing up the GCM device specific regId?

I've googled but haven't found anything yet.

like image 741
Alexander Kulyakhtin Avatar asked Jun 12 '15 13:06

Alexander Kulyakhtin


People also ask

What is fullBackupContent in Android?

For this we have android:fullBackupContent in the application tag, which points to a XML file that contains full backup rules for Auto Backup. These rules determine what files get backed up.

Where are backup files stored in Android?

Backup data is stored in a private folder in the user's Google Drive account, limited to 25MB per app. The saved data does not count towards the user's personal Google Drive quota. Only the most recent backup is stored. When a backup is made, the previous backup (if one exists) is deleted.

How do Android users backup their data?

Backup options. Android provides two ways for apps to back up their data to the cloud: Auto backup for apps and Key/Value Backup. Auto Backup, which is available on Android version 6.0 and higher, preserves data by uploading it to the user's Google Drive account.


2 Answers

Part of the disturbing "auto backup for apps" is the ability to control what files get backed up, via android:fullBackupContent. That attribute points to an XML resource (e.g., @xml/backup_rulez), that describes either a whitelist or a blacklist controlling what gets backed up.

What the Lint warning is warning you about is not backing up the GCM registration ID, as that is per-device, and so it would need to be re-generated if your app's data is restored from the backup onto a new device. Personally, off the top of my head, I don't know where GCM is storing that registration ID.

like image 50
CommonsWare Avatar answered Sep 18 '22 22:09

CommonsWare


CommonsWare is correct. However, GCM does not store that regid for you - The GCM quickstarter used to suggest (it has since been updated) that you store it yourself in a shared prefs file. The lint rule is detecting that you have declared a receiver for GCM and therefore assumes that you are stashing the regid somewhere. Because you haven't declared a fullBackupContent flag in your manifest it is warning you that your app will likely break across restore. You use the fullBackupContent to exclude or include whatever data you would like to not leave the device and be restored on another device (gcm instance id token is one example)

more details here

like image 35
43matthew Avatar answered Sep 17 '22 22:09

43matthew