summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--api/current.txt2
-rw-r--r--api/system-current.txt2
-rw-r--r--core/java/android/app/backup/BackupManager.java29
3 files changed, 11 insertions, 22 deletions
diff --git a/api/current.txt b/api/current.txt
index 0035e22d2442..719205635e38 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -6938,7 +6938,7 @@ package android.app.backup {
ctor public BackupManager(android.content.Context);
method public void dataChanged();
method public static void dataChanged(java.lang.String);
- method public int requestRestore(android.app.backup.RestoreObserver);
+ method public deprecated int requestRestore(android.app.backup.RestoreObserver);
}
public class FileBackupHelper implements android.app.backup.BackupHelper {
diff --git a/api/system-current.txt b/api/system-current.txt
index 10ce02803f0c..fd25e1bcd1e2 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -450,7 +450,7 @@ package android.app.backup {
method public java.lang.String[] listAllTransports();
method public int requestBackup(java.lang.String[], android.app.backup.BackupObserver);
method public int requestBackup(java.lang.String[], android.app.backup.BackupObserver, android.app.backup.BackupManagerMonitor, int);
- method public int requestRestore(android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
+ method public deprecated int requestRestore(android.app.backup.RestoreObserver, android.app.backup.BackupManagerMonitor);
method public deprecated java.lang.String selectBackupTransport(java.lang.String);
method public void selectBackupTransport(android.content.ComponentName, android.app.backup.SelectBackupTransportCallback);
method public void setAutoRestore(boolean);
diff --git a/core/java/android/app/backup/BackupManager.java b/core/java/android/app/backup/BackupManager.java
index 12f4483141f4..6ec0969771c6 100644
--- a/core/java/android/app/backup/BackupManager.java
+++ b/core/java/android/app/backup/BackupManager.java
@@ -252,6 +252,8 @@ public class BackupManager {
}
/**
+ * @deprecated Since Android P app can no longer request restoring of its backup.
+ *
* Restore the calling application from backup. The data will be restored from the
* current backup dataset if the application has stored data there, or from
* the dataset used during the last full device setup operation if the current
@@ -269,6 +271,7 @@ public class BackupManager {
*
* @return Zero on success; nonzero on error.
*/
+ @Deprecated
public int requestRestore(RestoreObserver observer) {
return requestRestore(observer, null);
}
@@ -276,6 +279,8 @@ public class BackupManager {
// system APIs start here
/**
+ * @deprecated Since Android P app can no longer request restoring of its backup.
+ *
* Restore the calling application from backup. The data will be restored from the
* current backup dataset if the application has stored data there, or from
* the dataset used during the last full device setup operation if the current
@@ -298,28 +303,12 @@ public class BackupManager {
*
* @hide
*/
+ @Deprecated
@SystemApi
public int requestRestore(RestoreObserver observer, BackupManagerMonitor monitor) {
- int result = -1;
- checkServiceBinder();
- if (sService != null) {
- RestoreSession session = null;
- try {
- IRestoreSession binder = sService.beginRestoreSession(mContext.getPackageName(),
- null);
- if (binder != null) {
- session = new RestoreSession(mContext, binder);
- result = session.restorePackage(mContext.getPackageName(), observer, monitor);
- }
- } catch (RemoteException e) {
- Log.e(TAG, "restoreSelf() unable to contact service");
- } finally {
- if (session != null) {
- session.endRestoreSession();
- }
- }
- }
- return result;
+ Log.w(TAG, "requestRestore(): Since Android P app can no longer request restoring"
+ + " of its backup.");
+ return -1;
}
/**