Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ada1f001 authored by Artem Iglikov's avatar Artem Iglikov
Browse files

Rename IBackupManagerService to BackupManagerServiceInterface.

As per comment in ag/2047840

Test: not required

Bug: 36850431
Change-Id: I296830b7ac17ffacb219a3e8296659910e89585f
parent 05c4205a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
public class BackupManagerService implements IBackupManagerService {
public class BackupManagerService implements BackupManagerServiceInterface {
    private static final String TAG = "BackupManagerService";
    static final boolean DEBUG = true;
+1 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ import java.io.PrintWriter;
 * Current and future implementations of BackupManagerService should use this interface, so that
 * Trampoline is able to switch between them.
 */
public interface IBackupManagerService {
public interface BackupManagerServiceInterface {

  boolean setBackupPassword(String currentPw, String newPw);

+33 −33
Original line number Diff line number Diff line
@@ -139,7 +139,7 @@ public class Trampoline extends IBackupManager.Stub {
    // IBackupManager binder API
    @Override
    public void dataChanged(String packageName) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.dataChanged(packageName);
        }
@@ -148,7 +148,7 @@ public class Trampoline extends IBackupManager.Stub {
    @Override
    public void clearBackupData(String transportName, String packageName)
            throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.clearBackupData(transportName, packageName);
        }
@@ -156,7 +156,7 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public void agentConnected(String packageName, IBinder agent) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.agentConnected(packageName, agent);
        }
@@ -164,7 +164,7 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public void agentDisconnected(String packageName) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.agentDisconnected(packageName);
        }
@@ -172,7 +172,7 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public void restoreAtInstall(String packageName, int token) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.restoreAtInstall(packageName, token);
        }
@@ -180,7 +180,7 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public void setBackupEnabled(boolean isEnabled) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.setBackupEnabled(isEnabled);
        }
@@ -188,7 +188,7 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public void setAutoRestore(boolean doAutoRestore) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.setAutoRestore(doAutoRestore);
        }
@@ -196,7 +196,7 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public void setBackupProvisioned(boolean isProvisioned) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.setBackupProvisioned(isProvisioned);
        }
@@ -204,25 +204,25 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public boolean isBackupEnabled() throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.isBackupEnabled() : false;
    }

    @Override
    public boolean setBackupPassword(String currentPw, String newPw) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.setBackupPassword(currentPw, newPw) : false;
    }

    @Override
    public boolean hasBackupPassword() throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.hasBackupPassword() : false;
    }

    @Override
    public void backupNow() throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.backupNow();
        }
@@ -233,7 +233,7 @@ public class Trampoline extends IBackupManager.Stub {
            boolean includeShared, boolean doWidgets, boolean allApps,
            boolean allIncludesSystem, boolean doCompress, boolean doKeyValue, String[] packageNames)
                    throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.adbBackup(fd, includeApks, includeObbs, includeShared, doWidgets,
                    allApps, allIncludesSystem, doCompress, doKeyValue, packageNames);
@@ -242,7 +242,7 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public void fullTransportBackup(String[] packageNames) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.fullTransportBackup(packageNames);
        }
@@ -250,7 +250,7 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public void adbRestore(ParcelFileDescriptor fd) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.adbRestore(fd);
        }
@@ -260,7 +260,7 @@ public class Trampoline extends IBackupManager.Stub {
    public void acknowledgeFullBackupOrRestore(int token, boolean allow, String curPassword,
            String encryptionPassword, IFullBackupRestoreObserver observer)
                    throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.acknowledgeAdbBackupOrRestore(token, allow,
                    curPassword, encryptionPassword, observer);
@@ -269,38 +269,38 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public String getCurrentTransport() throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.getCurrentTransport() : null;
    }

    @Override
    public String[] listAllTransports() throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.listAllTransports() : null;
    }

    @Override
    public ComponentName[] listAllTransportComponents() throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.listAllTransportComponents() : null;
    }

    @Override
    public String[] getTransportWhitelist() {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.getTransportWhitelist() : null;
    }

    @Override
    public String selectBackupTransport(String transport) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.selectBackupTransport(transport) : null;
    }

    @Override
    public void selectBackupTransportAsync(ComponentName transport,
            ISelectBackupTransportCallback listener) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.selectBackupTransportAsync(transport, listener);
        }
@@ -308,38 +308,38 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public Intent getConfigurationIntent(String transport) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.getConfigurationIntent(transport) : null;
    }

    @Override
    public String getDestinationString(String transport) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.getDestinationString(transport) : null;
    }

    @Override
    public Intent getDataManagementIntent(String transport) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.getDataManagementIntent(transport) : null;
    }

    @Override
    public String getDataManagementLabel(String transport) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.getDataManagementLabel(transport) : null;
    }

    @Override
    public IRestoreSession beginRestoreSession(String packageName, String transportID)
            throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.beginRestoreSession(packageName, transportID) : null;
    }

    @Override
    public void opComplete(int token, long result) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.opComplete(token, result);
        }
@@ -347,26 +347,26 @@ public class Trampoline extends IBackupManager.Stub {

    @Override
    public long getAvailableRestoreToken(String packageName) {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.getAvailableRestoreToken(packageName) : 0;
    }

    @Override
    public boolean isAppEligibleForBackup(String packageName) {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.isAppEligibleForBackup(packageName) : false;
    }

    @Override
    public int requestBackup(String[] packages, IBackupObserver observer,
            IBackupManagerMonitor monitor, int flags) throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        return (svc != null) ? svc.requestBackup(packages, observer, monitor, flags) : null;
    }

    @Override
    public void cancelBackups() throws RemoteException {
        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.cancelBackups();
        }
@@ -376,7 +376,7 @@ public class Trampoline extends IBackupManager.Stub {
    public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
        if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;

        IBackupManagerService svc = mService;
        BackupManagerServiceInterface svc = mService;
        if (svc != null) {
            svc.dump(fd, pw, args);
        } else {