android-backup-service

Device-Owner now disables the Backup service

喜夏-厌秋 提交于 2019-12-05 17:35:23
I've had an issue with my device-owner App : before Android 5.1 it was working nicely, but now after the update to Android 5.1, installing a device-owner App disables the Backup Service. Now in the device settings, when going into the Backup & reset option, the Backup service is greyed out, saying this: Backup service is inactive. This is set by your device policy I could find this source on the google git repository... The code is not very long and easy to understand, they use android.app.backup.IBackupManager to disable the service... But easier is the commit comment: Shutdown backup manager

Unclear SecurityException when using Android Service Backup (Cloud Backup)

喜夏-厌秋 提交于 2019-12-05 16:10:32
I try to use my application, which contains usage of Android Backup Service with my own BackupAgent , on Android Emulator . But backup doesn't work , despite of permission written in AndroidManifest.xml. Permission: <uses-permission android:name="android.permission.BACKUP"/> Warning in log: 09-17 09:05:58.553: WARN/PackageManager(73): Not granting permission android.permission.BACKUP to package my.package (protectionLevel=3 flags=0x1be46) Exception in log (when I try to call requestRestore() ): java.lang.SecurityException: getCurrentTransport: Neither user 10040 nor current process has android

Mysterious ClassNotFoundException when Android system engage BackupAgent

坚强是说给别人听的谎言 提交于 2019-12-05 14:39:14
I have got a few (4) error reports on my app from when the Android system decides to do the backup to Google cloud using the BackupAgent. I am using the SharedPreferencesBackupHelper. The stack trace looks like this (my real package name is replaced below by com.xxx.yyy): java.lang.RuntimeException: Unable to create BackupAgent com.xxx.yyy.MyBackupAgent: java.lang.ClassNotFoundException: com.xxx.yyy.MyBackupAgent in loader dalvik.system.PathClassLoader[/mnt/asec/com.xxx.yyy-1/pkg.apk] at android.app.ActivityThread.handleCreateBackupAgent(ActivityThread.java:2114) at android.app.ActivityThread

Why a lint warning about fullBackupContent warning when allowBackup is false?

放肆的年华 提交于 2019-12-05 02:29:31
问题 For an app with android:allowBackup="false" , Android lint reports: Should explicitly set 'android:fullBackupContent' to avoid backing up the GCM device specific regId. Is this just a bug in the lint rule, or do I really need to be concerned about the regId getting backed up and restored onto another device? 回答1: This was indeed a bug that was fixed in AS 1.4. Now you only get this lint warning when allowBackup="true" or the attribute is missing (which defaults to true) 来源: https:/

Problems restoring to multiple devices using Android BackupManager

人走茶凉 提交于 2019-12-04 10:13:11
I've implemented backup/restore of SharedPreferences using BackupManager as per the Android docs , but I'm having trouble restoring preferences to a second device. I believe the implementation is fine, since I can restore settings to a single device, i.e. if I run the app, make changes, uninstall and reinstall I get the modified preferences that I expect. However, if I subsequently install the app on a second device, I don't see the changes, even if I use the bmgr tool to force a backup on the first device and force a restore on the second device. Both devices have the same Google accounts,

Android auto backup error

让人想犯罪 __ 提交于 2019-12-04 04:57:46
问题 I'm trying to implement android auto backup (Android 6.0) but it doesn't work. I get the same error with 10-28 22:58:06.980 600-5578/? I/PFTBT: Initiating full-data transport backup of com.myapp.package 10-28 22:58:06.981 7891-14015/? I/GmsBackupTransport: Attempt to do full backup on com.myapp.package 10-28 22:58:06.982 600-5578/? I/PFTBT: Transport rejected backup of com.myapp.package, skipping 10-28 22:58:06.982 600-5578/? I/PFTBT: Full backup completed. 10-28 22:58:06.982 600-610/? D

BackupAgent: “unable to restore package …”

被刻印的时光 ゝ 提交于 2019-12-04 04:27:22
I have implemented the BackupAgent as described at Data Backup , registered an API key and declared the BackupAgent in my Manifest. The Backup part work's quite well, I think; When I run adb shell bmgr run in command line, the following output appears in LogCat: 01-11 22:23:09.002: DEBUG/PerformBackupThread(97): starting agent for backup of BackupRequest{app=ApplicationInfo{4547c5b8 com.meins.nightclock} full=false} 01-11 22:23:09.002: DEBUG/BackupManagerService(97): awaiting agent for ApplicationInfo{4547c5b8 com.meins.nightclock} 01-11 22:23:09.013: DEBUG/BackupManagerService(97):

What is the file name used by default shared preferences?

巧了我就是萌 提交于 2019-12-03 23:35:55
Android Backup Service requires a filename to backup shared preferences: public static final String PREFS = "PrefFile"; SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(this, PREFS); It is clear what to use if filename is given during preferences creation like public static final String PREF_FILE_NAME = "PrefFile"; SharedPreferences preferences = getSharedPreferences(PREF_FILE_NAME, MODE_PRIVATE); But I use default shared preferences: SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); What should I pass as PREFS value to

Android Data Backup service

巧了我就是萌 提交于 2019-12-03 21:30:38
问题 I am trying to use the Data Backup service, in order to save the user shared preferences, as described here. However, I have experienced the following problems when trying to test it in different Android versions. Android 2.3.4: After extending the BackupAgentHelper, while trying to test the service using the bmgr tool (by following the steps here), in my Motorola Atrix with Android 2.3.4, I see the following messages: W/BackupTransportService(1618): Unknown package in backup request: @pm@ W

Why a lint warning about fullBackupContent warning when allowBackup is false?

六眼飞鱼酱① 提交于 2019-12-03 21:21:17
For an app with android:allowBackup="false" , Android lint reports: Should explicitly set 'android:fullBackupContent' to avoid backing up the GCM device specific regId. Is this just a bug in the lint rule, or do I really need to be concerned about the regId getting backed up and restored onto another device? This was indeed a bug that was fixed in AS 1.4. Now you only get this lint warning when allowBackup="true" or the attribute is missing (which defaults to true) 来源: https://stackoverflow.com/questions/31767619/why-a-lint-warning-about-fullbackupcontent-warning-when-allowbackup-is-false