I posted a question about the new behavior of Android 5.1, which disables the backup service when setting up the device owner on the device here ...
A possible solution could be (I think) to use reflection to fix the problem: I could find some examples of reflection using a specific method in a hidden class, but this case looks more complex, with a constructor that uses another hidden class (ServiceManager), etc. D. And I donβt know how to do it ...
The code that annoys me is in DevicePolicyManagerService.java (can be found here ) on lines 3739 through 3749:
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); }
And my goal would be to turn on the backup service again, ideally it would call something like:
ibm.setBackupServiceActive(UserHandle.USER_OWNER, false);
Could you help me do this?
android reflection
Jba
source share