Device owner now disables backup service

I had a problem with my App owner device: before Android 5.1, it worked fine, but now, after upgrading to Android 5.1, installing the device owner app disables the backup service.

Now, being in the device settings, when switching to the "Backup" and "

I could find this source in google git repository ... The code is not very long and clear, they use android.app.backup.IBackupManager to disable the service ... But it is easier to comment on the comment:

Backup Manager service when setting the device owner

Here is what they do:

import android.app.backup.IBackupManager; // Shutting down backup manager service permanently. long ident = Binder.clearCallingIdentity(); try { IBackupManager ibm = IBackupManager.Stub.asInterface( ServiceManager.getService(Context.BACKUP_SERVICE)); ibm.setBackupServiceActive(UserHandle.USER_OWNER, false); } catch (RemoteException e) { throw new IllegalStateException("Failed deactivating backup service.", e); } finally { Binder.restoreCallingIdentity(ident); } 

Wow ... this makes a serious mistake for my project! Do not joke: now it is really impossible for the user to have backup copies of data when the device owner’s application is installed?

So, hope someone here can have information or experience about this? Unfortunately, I am not familiar with this, but perhaps with a reflection that can be corrected after that?

Thanks for reading!

+1
android android-backup-service device-owner
source share
2 answers

Because it's the best Google search for device owner and backup

Starting with Android O, you can enable it using DevicePolicyManager

 setBackupServiceEnabled (ComponentName admin, Boolean enabled) 

https://developer.android.com/reference/android/app/admin/DevicePolicyManager.html

You can check if isBackupServiceEnabled

Or install it

+1
source share

I have the same problem, in addition, the adb backup will not start because the connection was rejected (I assume the backup service is not working). As a reference, this is one of the errors I saw in logcat:

 W/main(22253): type=1400 audit(0.0:106): avc: denied { ioctl } for path="socket:[76146]" dev="sockfs" ino=76146 ioctlcmd=7704 scontext=u:r:shell:s0tcontext=u:r:adbd:s0 tclass=unix_stream_socket permissive=0 

Although I still have not figured out how to restart the backup service (and I believe there is a way), I found a very useful alternative to adb backup for accessing data: fooobar.com/questions/42219 / ...

I have physical access to the devices on which my application is running, so this solution works well in my case. Hope this helps at least recover your data in the development environment.

0
source share

All Articles