Loading core/java/android/app/backup/IBackupManager.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -303,4 +303,11 @@ interface IBackupManager { * {@code false} otherwise. */ void setBackupServiceActive(int whichUser, boolean makeActive); /** * Queries the activity status of backup service as set by {@link #setBackupServiceActive}. * @param whichUser User handle of the defined user whose backup active state * is being queried. */ boolean isBackupServiceActive(int whichUser); } services/backup/java/com/android/server/backup/Trampoline.java +16 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ public class Trampoline extends IBackupManager.Stub { if (userHandle == UserHandle.USER_OWNER) { synchronized (this) { if (makeActive != (mService != null)) { if (makeActive != isBackupServiceActive(userHandle)) { Slog.i(TAG, "Making backup " + (makeActive ? "" : "in") + "active in user " + userHandle); if (makeActive) { Loading @@ -113,6 +113,21 @@ public class Trampoline extends IBackupManager.Stub { } } /** * Querying activity state of backup service. Calling this method before initialize yields * undefined result. * @param userHandle The user in which the activity state of backup service is queried. * @return true if the service is active. */ public boolean isBackupServiceActive(final int userHandle) { if (userHandle == UserHandle.USER_OWNER) { synchronized (this) { return mService != null; } } return false; } // IBackupManager binder API @Override public void dataChanged(String packageName) throws RemoteException { Loading Loading
core/java/android/app/backup/IBackupManager.aidl +7 −0 Original line number Diff line number Diff line Loading @@ -303,4 +303,11 @@ interface IBackupManager { * {@code false} otherwise. */ void setBackupServiceActive(int whichUser, boolean makeActive); /** * Queries the activity status of backup service as set by {@link #setBackupServiceActive}. * @param whichUser User handle of the defined user whose backup active state * is being queried. */ boolean isBackupServiceActive(int whichUser); }
services/backup/java/com/android/server/backup/Trampoline.java +16 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ public class Trampoline extends IBackupManager.Stub { if (userHandle == UserHandle.USER_OWNER) { synchronized (this) { if (makeActive != (mService != null)) { if (makeActive != isBackupServiceActive(userHandle)) { Slog.i(TAG, "Making backup " + (makeActive ? "" : "in") + "active in user " + userHandle); if (makeActive) { Loading @@ -113,6 +113,21 @@ public class Trampoline extends IBackupManager.Stub { } } /** * Querying activity state of backup service. Calling this method before initialize yields * undefined result. * @param userHandle The user in which the activity state of backup service is queried. * @return true if the service is active. */ public boolean isBackupServiceActive(final int userHandle) { if (userHandle == UserHandle.USER_OWNER) { synchronized (this) { return mService != null; } } return false; } // IBackupManager binder API @Override public void dataChanged(String packageName) throws RemoteException { Loading