summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/backup/java/com/android/server/backup/BackupManagerService.java36
-rw-r--r--services/backup/java/com/android/server/backup/IBackupManagerService.java153
-rw-r--r--services/backup/java/com/android/server/backup/Trampoline.java66
3 files changed, 221 insertions, 34 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java
index 413746fab911..32ff5c5e84d6 100644
--- a/services/backup/java/com/android/server/backup/BackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/BackupManagerService.java
@@ -189,7 +189,7 @@ import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
-public class BackupManagerService {
+public class BackupManagerService implements IBackupManagerService {
private static final String TAG = "BackupManagerService";
static final boolean DEBUG = true;
@@ -1728,6 +1728,7 @@ public class BackupManagerService {
return false;
}
+ @Override
public boolean setBackupPassword(String currentPw, String newPw) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"setBackupPassword");
@@ -1808,6 +1809,7 @@ public class BackupManagerService {
return false;
}
+ @Override
public boolean hasBackupPassword() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"hasBackupPassword");
@@ -2368,6 +2370,7 @@ public class BackupManagerService {
// Get the restore-set token for the best-available restore set for this package:
// the active set if possible, else the ancestral one. Returns zero if none available.
+ @Override
public long getAvailableRestoreToken(String packageName) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getAvailableRestoreToken");
@@ -2385,10 +2388,12 @@ public class BackupManagerService {
return token;
}
+ @Override
public int requestBackup(String[] packages, IBackupObserver observer, int flags) {
return requestBackup(packages, observer, null, flags);
}
+ @Override
public int requestBackup(String[] packages, IBackupObserver observer,
IBackupManagerMonitor monitor, int flags) {
mContext.enforceCallingPermission(android.Manifest.permission.BACKUP, "requestBackup");
@@ -2460,6 +2465,7 @@ public class BackupManagerService {
}
// Cancel all running backups.
+ @Override
public void cancelBackups(){
mContext.enforceCallingPermission(android.Manifest.permission.BACKUP, "cancelBackups");
if (MORE_DEBUG) {
@@ -9866,6 +9872,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// ----- IBackupManager binder interface -----
+ @Override
public void dataChanged(final String packageName) {
final int callingUserHandle = UserHandle.getCallingUserId();
if (callingUserHandle != UserHandle.USER_SYSTEM) {
@@ -9896,6 +9903,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Clear the given package's backup data from the current transport
+ @Override
public void clearBackupData(String transportName, String packageName) {
if (DEBUG) Slog.v(TAG, "clearBackupData() of " + packageName + " on " + transportName);
PackageInfo info;
@@ -9953,6 +9961,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// Run a backup pass immediately for any applications that have declared
// that they have pending updates.
+ @Override
public void backupNow() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "backupNow");
@@ -9989,6 +9998,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
//
// This is the variant used by 'adb backup'; it requires on-screen confirmation
// by the user because it can be used to offload data over untrusted USB.
+ @Override
public void adbBackup(ParcelFileDescriptor fd, boolean includeApks, boolean includeObbs,
boolean includeShared, boolean doWidgets, boolean doAllApps, boolean includeSystem,
boolean compress, boolean doKeyValue, String[] pkgList) {
@@ -10064,6 +10074,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
}
+ @Override
public void fullTransportBackup(String[] pkgNames) {
mContext.enforceCallingPermission(android.Manifest.permission.BACKUP,
"fullTransportBackup");
@@ -10113,6 +10124,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
}
+ @Override
public void adbRestore(ParcelFileDescriptor fd) {
mContext.enforceCallingPermission(android.Manifest.permission.BACKUP, "adbRestore");
@@ -10211,6 +10223,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// Confirm that the previously-requested full backup/restore operation can proceed. This
// is used to require a user-facing disclosure about the operation.
+ @Override
public void acknowledgeAdbBackupOrRestore(int token, boolean allow,
String curPassword, String encPpassword, IFullBackupRestoreObserver observer) {
if (DEBUG) Slog.d(TAG, "acknowledgeAdbBackupOrRestore : token=" + token
@@ -10311,6 +10324,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Enable/disable backups
+ @Override
public void setBackupEnabled(boolean enable) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"setBackupEnabled");
@@ -10358,6 +10372,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Enable/disable automatic restore of app data at install time
+ @Override
public void setAutoRestore(boolean doAutoRestore) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"setAutoRestore");
@@ -10377,6 +10392,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Mark the backup service as having been provisioned
+ @Override
public void setBackupProvisioned(boolean available) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"setBackupProvisioned");
@@ -10386,12 +10402,14 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Report whether the backup mechanism is currently enabled
+ @Override
public boolean isBackupEnabled() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "isBackupEnabled");
return mEnabled; // no need to synchronize just to read it
}
// Report the name of the currently active transport
+ @Override
public String getCurrentTransport() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getCurrentTransport");
@@ -10401,18 +10419,21 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Report all known, available backup transports
+ @Override
public String[] listAllTransports() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, "listAllTransports");
return mTransportManager.getBoundTransportNames();
}
+ @Override
public ComponentName[] listAllTransportComponents() {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"listAllTransportComponents");
return mTransportManager.getAllTransportCompenents();
}
+ @Override
public String[] getTransportWhitelist() {
// No permission check, intentionally.
Set<ComponentName> whitelistedComponents = mTransportManager.getTransportWhitelist();
@@ -10426,6 +10447,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Select which transport to use for the next backup operation.
+ @Override
public String selectBackupTransport(String transport) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"selectBackupTransport");
@@ -10443,6 +10465,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
}
+ @Override
public void selectBackupTransportAsync(final ComponentName transport,
final ISelectBackupTransportCallback listener) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
@@ -10485,6 +10508,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// Supply the configuration Intent for the given transport. If the name is not one
// of the available transports, or if the transport does not supply any configuration
// UI, the method returns null.
+ @Override
public Intent getConfigurationIntent(String transportName) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getConfigurationIntent");
@@ -10510,6 +10534,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// summary / destination string, the method can return null.
//
// This string is used VERBATIM as the summary text of the relevant Settings item!
+ @Override
public String getDestinationString(String transportName) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getDestinationString");
@@ -10530,6 +10555,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Supply the manage-data intent for the given transport.
+ @Override
public Intent getDataManagementIntent(String transportName) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getDataManagementIntent");
@@ -10552,6 +10578,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// Supply the menu label for affordances that fire the manage-data intent
// for the given transport.
+ @Override
public String getDataManagementLabel(String transportName) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"getDataManagementLabel");
@@ -10573,6 +10600,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// Callback: a requested backup agent has been instantiated. This should only
// be called from the Activity Manager.
+ @Override
public void agentConnected(String packageName, IBinder agentBinder) {
synchronized(mAgentConnectLock) {
if (Binder.getCallingUid() == Process.SYSTEM_UID) {
@@ -10591,6 +10619,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// Callback: a backup agent has failed to come up, or has unexpectedly quit.
// If the agent failed to come up in the first place, the agentBinder argument
// will be null. This should only be called from the Activity Manager.
+ @Override
public void agentDisconnected(String packageName) {
// TODO: handle backup being interrupted
synchronized(mAgentConnectLock) {
@@ -10607,6 +10636,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// An application being installed will need a restore pass, then the Package Manager
// will need to be told when the restore is finished.
+ @Override
public void restoreAtInstall(String packageName, int token) {
if (Binder.getCallingUid() != Process.SYSTEM_UID) {
Slog.w(TAG, "Non-system process uid=" + Binder.getCallingUid()
@@ -10674,6 +10704,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
// Hand off a restore session
+ @Override
public IRestoreSession beginRestoreSession(String packageName, String transport) {
if (DEBUG) Slog.v(TAG, "beginRestoreSession: pkg=" + packageName
+ " transport=" + transport);
@@ -10737,6 +10768,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
// Note that a currently-active backup agent has notified us that it has
// completed the given outstanding asynchronous backup/restore operation.
+ @Override
public void opComplete(int token, long result) {
if (MORE_DEBUG) {
Slog.v(TAG, "opComplete: " + Integer.toHexString(token) + " result=" + result);
@@ -10774,6 +10806,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
}
+ @Override
public boolean isAppEligibleForBackup(String packageName) {
mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP,
"isAppEligibleForBackup");
@@ -11138,6 +11171,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF
}
}
+ @Override
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
if (!DumpUtils.checkDumpAndUsageStatsPermission(mContext, TAG, pw)) return;
diff --git a/services/backup/java/com/android/server/backup/IBackupManagerService.java b/services/backup/java/com/android/server/backup/IBackupManagerService.java
new file mode 100644
index 000000000000..8c6601d3cfcc
--- /dev/null
+++ b/services/backup/java/com/android/server/backup/IBackupManagerService.java
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.server.backup;
+
+import android.app.backup.IBackupManagerMonitor;
+import android.app.backup.IBackupObserver;
+import android.app.backup.IFullBackupRestoreObserver;
+import android.app.backup.IRestoreSession;
+import android.app.backup.ISelectBackupTransportCallback;
+import android.content.ComponentName;
+import android.content.Intent;
+import android.os.IBinder;
+import android.os.ParcelFileDescriptor;
+import java.io.FileDescriptor;
+import java.io.PrintWriter;
+
+/**
+ * Interface for BackupManagerService.
+ *
+ * Current and future implementations of BackupManagerService should use this interface, so that
+ * Trampoline is able to switch between them.
+ */
+public interface IBackupManagerService {
+
+ boolean setBackupPassword(String currentPw, String newPw);
+
+ boolean hasBackupPassword();
+
+ // Get the restore-set token for the best-available restore set for this package:
+ // the active set if possible, else the ancestral one. Returns zero if none available.
+ long getAvailableRestoreToken(String packageName);
+
+ int requestBackup(String[] packages, IBackupObserver observer, int flags);
+
+ int requestBackup(String[] packages, IBackupObserver observer,
+ IBackupManagerMonitor monitor, int flags);
+
+ // Cancel all running backups.
+ void cancelBackups();
+
+ void dataChanged(String packageName);
+
+ // Clear the given package's backup data from the current transport
+ void clearBackupData(String transportName, String packageName);
+
+ // Run a backup pass immediately for any applications that have declared
+ // that they have pending updates.
+ void backupNow();
+
+ // Run a backup pass for the given packages, writing the resulting data stream
+ // to the supplied file descriptor. This method is synchronous and does not return
+ // to the caller until the backup has been completed.
+ //
+ // This is the variant used by 'adb backup'; it requires on-screen confirmation
+ // by the user because it can be used to offload data over untrusted USB.
+ void adbBackup(ParcelFileDescriptor fd, boolean includeApks, boolean includeObbs,
+ boolean includeShared, boolean doWidgets, boolean doAllApps, boolean includeSystem,
+ boolean compress, boolean doKeyValue, String[] pkgList);
+
+ void fullTransportBackup(String[] pkgNames);
+
+ void adbRestore(ParcelFileDescriptor fd);
+
+ // Confirm that the previously-requested full backup/restore operation can proceed. This
+ // is used to require a user-facing disclosure about the operation.
+ void acknowledgeAdbBackupOrRestore(int token, boolean allow,
+ String curPassword, String encPpassword, IFullBackupRestoreObserver observer);
+
+ // Enable/disable backups
+ void setBackupEnabled(boolean enable);
+
+ // Enable/disable automatic restore of app data at install time
+ void setAutoRestore(boolean doAutoRestore);
+
+ // Mark the backup service as having been provisioned
+ void setBackupProvisioned(boolean available);
+
+ // Report whether the backup mechanism is currently enabled
+ boolean isBackupEnabled();
+
+ // Report the name of the currently active transport
+ String getCurrentTransport();
+
+ // Report all known, available backup transports
+ String[] listAllTransports();
+
+ ComponentName[] listAllTransportComponents();
+
+ String[] getTransportWhitelist();
+
+ // Select which transport to use for the next backup operation.
+ String selectBackupTransport(String transport);
+
+ void selectBackupTransportAsync(ComponentName transport,
+ ISelectBackupTransportCallback listener);
+
+ // Supply the configuration Intent for the given transport. If the name is not one
+ // of the available transports, or if the transport does not supply any configuration
+ // UI, the method returns null.
+ Intent getConfigurationIntent(String transportName);
+
+ // Supply the configuration summary string for the given transport. If the name is
+ // not one of the available transports, or if the transport does not supply any
+ // summary / destination string, the method can return null.
+ //
+ // This string is used VERBATIM as the summary text of the relevant Settings item!
+ String getDestinationString(String transportName);
+
+ // Supply the manage-data intent for the given transport.
+ Intent getDataManagementIntent(String transportName);
+
+ // Supply the menu label for affordances that fire the manage-data intent
+ // for the given transport.
+ String getDataManagementLabel(String transportName);
+
+ // Callback: a requested backup agent has been instantiated. This should only
+ // be called from the Activity Manager.
+ void agentConnected(String packageName, IBinder agentBinder);
+
+ // Callback: a backup agent has failed to come up, or has unexpectedly quit.
+ // If the agent failed to come up in the first place, the agentBinder argument
+ // will be null. This should only be called from the Activity Manager.
+ void agentDisconnected(String packageName);
+
+ // An application being installed will need a restore pass, then the Package Manager
+ // will need to be told when the restore is finished.
+ void restoreAtInstall(String packageName, int token);
+
+ // Hand off a restore session
+ IRestoreSession beginRestoreSession(String packageName, String transport);
+
+ // Note that a currently-active backup agent has notified us that it has
+ // completed the given outstanding asynchronous backup/restore operation.
+ void opComplete(int token, long result);
+
+ boolean isAppEligibleForBackup(String packageName);
+
+ void dump(FileDescriptor fd, PrintWriter pw, String[] args);
+}
diff --git a/services/backup/java/com/android/server/backup/Trampoline.java b/services/backup/java/com/android/server/backup/Trampoline.java
index a109e6319faa..83d134aca4ce 100644
--- a/services/backup/java/com/android/server/backup/Trampoline.java
+++ b/services/backup/java/com/android/server/backup/Trampoline.java
@@ -139,7 +139,7 @@ public class Trampoline extends IBackupManager.Stub {
// IBackupManager binder API
@Override
public void dataChanged(String packageName) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
if (svc != null) {
svc.setBackupProvisioned(isProvisioned);
}
@@ -204,25 +204,25 @@ public class Trampoline extends IBackupManager.Stub {
@Override
public boolean isBackupEnabled() throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.isBackupEnabled() : false;
}
@Override
public boolean setBackupPassword(String currentPw, String newPw) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.setBackupPassword(currentPw, newPw) : false;
}
@Override
public boolean hasBackupPassword() throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.hasBackupPassword() : false;
}
@Override
public void backupNow() throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.getCurrentTransport() : null;
}
@Override
public String[] listAllTransports() throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.listAllTransports() : null;
}
@Override
public ComponentName[] listAllTransportComponents() throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.listAllTransportComponents() : null;
}
@Override
public String[] getTransportWhitelist() {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.getTransportWhitelist() : null;
}
@Override
public String selectBackupTransport(String transport) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.selectBackupTransport(transport) : null;
}
@Override
public void selectBackupTransportAsync(ComponentName transport,
ISelectBackupTransportCallback listener) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService 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 {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.getConfigurationIntent(transport) : null;
}
@Override
public String getDestinationString(String transport) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.getDestinationString(transport) : null;
}
@Override
public Intent getDataManagementIntent(String transport) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.getDataManagementIntent(transport) : null;
}
@Override
public String getDataManagementLabel(String transport) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.getDataManagementLabel(transport) : null;
}
@Override
public IRestoreSession beginRestoreSession(String packageName, String transportID)
throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.beginRestoreSession(packageName, transportID) : null;
}
@Override
public void opComplete(int token, long result) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService 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) {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.getAvailableRestoreToken(packageName) : 0;
}
@Override
public boolean isAppEligibleForBackup(String packageName) {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.isAppEligibleForBackup(packageName) : false;
}
@Override
public int requestBackup(String[] packages, IBackupObserver observer,
IBackupManagerMonitor monitor, int flags) throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
return (svc != null) ? svc.requestBackup(packages, observer, monitor, flags) : null;
}
@Override
public void cancelBackups() throws RemoteException {
- BackupManagerService svc = mService;
+ IBackupManagerService 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;
- BackupManagerService svc = mService;
+ IBackupManagerService svc = mService;
if (svc != null) {
svc.dump(fd, pw, args);
} else {