Loading Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ LOCAL_SRC_FILES += \ core/java/android/app/IWallpaperService.aidl \ core/java/android/app/IWallpaperServiceCallback.aidl \ core/java/android/backup/IBackupManager.aidl \ core/java/android/backup/IRestoreSession.aidl \ core/java/android/bluetooth/IBluetoothA2dp.aidl \ core/java/android/bluetooth/IBluetoothDevice.aidl \ core/java/android/bluetooth/IBluetoothDeviceCallback.aidl \ Loading core/java/android/backup/IBackupManager.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.backup; import android.backup.IRestoreSession; /** * Direct interface to the Backup Manager Service that applications invoke on. The only * operation currently needed is a simple notification that the app has made changes to Loading Loading @@ -60,4 +62,12 @@ interface IBackupManager { * @return The ID of the previously selected transport. */ int selectBackupTransport(int transportID); /** * Begin a restore session with the given transport (which may differ from the * currently-active backup transport). * * @return An interface to the restore session, or null on error. */ IRestoreSession beginRestoreSession(int transportID); } core/java/android/backup/IRestoreSession.aidl 0 → 100644 +52 −0 Original line number Diff line number Diff line /* * Copyright (C) 2009 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 android.backup; import android.os.Bundle; /** * Binder interface used by clients who wish to manage a restore operation. Every * method in this interface requires the android.permission.BACKUP permission. * * {@hide} */ interface IRestoreSession { /** * Ask the current transport what the available restore sets are. * * @return A bundle containing two elements: an int array under the key * "tokens" whose entries are a transport-private identifier for each backup set; * and a String array under the key "names" whose entries are the user-meaningful * text corresponding to the backup sets at each index in the tokens array. */ Bundle getAvailableRestoreSets(); /** * Restore the given set onto the device, replacing the current data of any app * contained in the restore set with the data previously backed up. * * @param token The token from {@link getAvailableRestoreSets()} corresponding to * the restore set that should be used. */ int performRestore(int token); /** * End this restore session. After this method is called, the IRestoreSession binder * is no longer valid. */ void endRestoreSession(); } core/java/com/android/internal/backup/AdbTransport.java +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public class AdbTransport extends IBackupTransport.Stub { } // Restore handling public Bundle getAvailableBackups() throws android.os.RemoteException { public Bundle getAvailableRestoreSets() throws android.os.RemoteException { // !!! TODO: real implementation Bundle b = new Bundle(); b.putIntArray("tokens", new int[0]); Loading core/java/com/android/internal/backup/GoogleTransport.java +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ public class GoogleTransport extends IBackupTransport.Stub { } // Restore handling public Bundle getAvailableBackups() throws android.os.RemoteException { public Bundle getAvailableRestoreSets() throws android.os.RemoteException { // !!! TODO: real implementation Bundle b = new Bundle(); b.putIntArray("tokens", new int[0]); Loading Loading
Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ LOCAL_SRC_FILES += \ core/java/android/app/IWallpaperService.aidl \ core/java/android/app/IWallpaperServiceCallback.aidl \ core/java/android/backup/IBackupManager.aidl \ core/java/android/backup/IRestoreSession.aidl \ core/java/android/bluetooth/IBluetoothA2dp.aidl \ core/java/android/bluetooth/IBluetoothDevice.aidl \ core/java/android/bluetooth/IBluetoothDeviceCallback.aidl \ Loading
core/java/android/backup/IBackupManager.aidl +10 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package android.backup; import android.backup.IRestoreSession; /** * Direct interface to the Backup Manager Service that applications invoke on. The only * operation currently needed is a simple notification that the app has made changes to Loading Loading @@ -60,4 +62,12 @@ interface IBackupManager { * @return The ID of the previously selected transport. */ int selectBackupTransport(int transportID); /** * Begin a restore session with the given transport (which may differ from the * currently-active backup transport). * * @return An interface to the restore session, or null on error. */ IRestoreSession beginRestoreSession(int transportID); }
core/java/android/backup/IRestoreSession.aidl 0 → 100644 +52 −0 Original line number Diff line number Diff line /* * Copyright (C) 2009 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 android.backup; import android.os.Bundle; /** * Binder interface used by clients who wish to manage a restore operation. Every * method in this interface requires the android.permission.BACKUP permission. * * {@hide} */ interface IRestoreSession { /** * Ask the current transport what the available restore sets are. * * @return A bundle containing two elements: an int array under the key * "tokens" whose entries are a transport-private identifier for each backup set; * and a String array under the key "names" whose entries are the user-meaningful * text corresponding to the backup sets at each index in the tokens array. */ Bundle getAvailableRestoreSets(); /** * Restore the given set onto the device, replacing the current data of any app * contained in the restore set with the data previously backed up. * * @param token The token from {@link getAvailableRestoreSets()} corresponding to * the restore set that should be used. */ int performRestore(int token); /** * End this restore session. After this method is called, the IRestoreSession binder * is no longer valid. */ void endRestoreSession(); }
core/java/com/android/internal/backup/AdbTransport.java +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ public class AdbTransport extends IBackupTransport.Stub { } // Restore handling public Bundle getAvailableBackups() throws android.os.RemoteException { public Bundle getAvailableRestoreSets() throws android.os.RemoteException { // !!! TODO: real implementation Bundle b = new Bundle(); b.putIntArray("tokens", new int[0]); Loading
core/java/com/android/internal/backup/GoogleTransport.java +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ public class GoogleTransport extends IBackupTransport.Stub { } // Restore handling public Bundle getAvailableBackups() throws android.os.RemoteException { public Bundle getAvailableRestoreSets() throws android.os.RemoteException { // !!! TODO: real implementation Bundle b = new Bundle(); b.putIntArray("tokens", new int[0]); Loading