Refactor android.backup => android.app.backup
Change-Id: I0b21316ff890d7f3c7d4b82837bb60670724c2e8
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.app;
|
||||
|
||||
import android.app.backup.BackupAgent;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.ComponentCallbacks;
|
||||
import android.content.ComponentName;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package android.app;
|
||||
|
||||
import android.backup.BackupDataInput;
|
||||
import android.backup.BackupDataOutput;
|
||||
import android.backup.FileBackupHelper;
|
||||
import android.app.backup.BackupAgent;
|
||||
import android.app.backup.BackupDataInput;
|
||||
import android.app.backup.BackupDataOutput;
|
||||
import android.app.backup.FileBackupHelper;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
|
||||
package android.app;
|
||||
|
||||
import android.backup.IBackupManager;
|
||||
import android.app.backup.IBackupManager;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
/**
|
||||
* Interface presented by applications being asked to participate in the
|
||||
* backup & restore mechanism. End user code does not typically implement
|
||||
* this interface; they subclass BackupAgent instead.
|
||||
* backup & restore mechanism. End user code will not typically implement
|
||||
* this interface directly; they subclass BackupAgent instead.
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
@@ -14,12 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.app;
|
||||
package android.app.backup;
|
||||
|
||||
import android.app.IBackupAgent;
|
||||
import android.backup.BackupDataInput;
|
||||
import android.backup.BackupDataOutput;
|
||||
import android.backup.IBackupManager;
|
||||
import android.app.backup.IBackupManager;
|
||||
import android.content.Context;
|
||||
import android.content.ContextWrapper;
|
||||
import android.os.Binder;
|
||||
@@ -39,7 +37,7 @@ import java.io.IOException;
|
||||
* respectively.
|
||||
* <p>
|
||||
* A backup agent based on convenient helper classes is available in
|
||||
* {@link android.backup.BackupHelperAgent} for less complex implementation
|
||||
* {@link android.app.backup.BackupHelperAgent} for less complex implementation
|
||||
* requirements.
|
||||
* <p>
|
||||
* STOPSHIP write more documentation about the backup process here.
|
||||
@@ -87,7 +85,7 @@ public abstract class BackupAgent extends ContextWrapper {
|
||||
* The application is being restored from backup and should replace any
|
||||
* existing data with the contents of the backup. The backup data is
|
||||
* provided in the file descriptor pointed to by the
|
||||
* {@link android.backup.BackupDataInput} instance <code>data</code>. Once
|
||||
* {@link android.app.backup.BackupDataInput} instance <code>data</code>. Once
|
||||
* the restore is finished, the application should write a representation of
|
||||
* the final state to the <code>newState</code> file descriptor.
|
||||
* <p>
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
@@ -131,7 +131,7 @@ public class BackupDataInput {
|
||||
|
||||
/**
|
||||
* Consume the current record's data without actually reading it into a buffer
|
||||
* for further processing. This allows a {@link android.app.BackupAgent} to
|
||||
* for further processing. This allows a {@link android.app.backup.BackupAgent} to
|
||||
* efficiently discard obsolete or otherwise uninteresting records during the
|
||||
* restore operation.
|
||||
*
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.IOException;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
@@ -14,13 +14,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
/**
|
||||
* A convenient interface to be used with the
|
||||
* {@link android.backup.BackupHelperAgent} to implement backup and restore of
|
||||
* {@link android.app.backup.BackupHelperAgent} to implement backup and restore of
|
||||
* arbitrary data types.
|
||||
* <p>
|
||||
* STOPSHOP: document!
|
||||
@@ -14,9 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.app.BackupAgent;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
@@ -14,9 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.backup.RestoreSession;
|
||||
import android.app.backup.RestoreSession;
|
||||
import android.app.backup.IBackupManager;
|
||||
import android.app.backup.IRestoreSession;
|
||||
import android.content.Context;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
@@ -34,12 +36,12 @@ import android.util.Log;
|
||||
* operation actually occurs.
|
||||
* <p>
|
||||
* The backup operation itself begins with the system launching the
|
||||
* {@link android.app.BackupAgent} subclass declared in your manifest. See the
|
||||
* documentation for {@link android.app.BackupAgent} for a detailed description
|
||||
* {@link android.app.backup.BackupAgent} subclass declared in your manifest. See the
|
||||
* documentation for {@link android.app.backup.BackupAgent} for a detailed description
|
||||
* of how the backup then proceeds.
|
||||
* <p>
|
||||
* A simple implementation of a BackupAgent useful for backing up Preferences
|
||||
* and files is available by using {@link android.backup.BackupHelperAgent}.
|
||||
* and files is available by using {@link android.app.backup.BackupHelperAgent}.
|
||||
* <p>
|
||||
* STOPSHIP: more documentation!
|
||||
* <p>
|
||||
@@ -82,7 +84,7 @@ public class BackupManager {
|
||||
/**
|
||||
* Notifies the Android backup system that your application wishes to back up
|
||||
* new changes to its data. A backup operation using your application's
|
||||
* {@link android.app.BackupAgent} subclass will be scheduled when you call this method.
|
||||
* {@link android.app.backup.BackupAgent} subclass will be scheduled when you call this method.
|
||||
*/
|
||||
public void dataChanged() {
|
||||
checkServiceBinder();
|
||||
@@ -116,7 +118,7 @@ public class BackupManager {
|
||||
|
||||
/**
|
||||
* Begin the process of restoring data from backup. See the
|
||||
* {@link android.backup.RestoreSession} class for documentation on that process.
|
||||
* {@link android.app.backup.RestoreSession} class for documentation on that process.
|
||||
*/
|
||||
public RestoreSession beginRestoreSession() {
|
||||
RestoreSession session = null;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
@@ -24,7 +24,7 @@ import java.io.File;
|
||||
|
||||
/**
|
||||
* A helper class which can be used in conjunction with
|
||||
* {@link android.backup.BackupHelperAgent} to manage the backup of a set of
|
||||
* {@link android.app.backup.BackupHelperAgent} to manage the backup of a set of
|
||||
* files. Whenever backup is performed, all files changed since the last backup
|
||||
* will be saved in their entirety. During the first time the backup happens,
|
||||
* all the files in the list will be backed up. Note that this should only be
|
||||
@@ -69,9 +69,9 @@ public class FileBackupHelper extends FileBackupHelperBase implements BackupHelp
|
||||
* now. When <code>oldState</code> is <code>null</code>, all the files will
|
||||
* be backed up.
|
||||
* <p>
|
||||
* This should be called from {@link android.backup.BackupHelperAgent}
|
||||
* This should be called from {@link android.app.backup.BackupHelperAgent}
|
||||
* directly. See
|
||||
* {@link android.app.BackupAgent#onBackup(ParcelFileDescriptor, BackupDataOutput, ParcelFileDescriptor)}
|
||||
* {@link android.app.backup.BackupAgent#onBackup(ParcelFileDescriptor, BackupDataOutput, ParcelFileDescriptor)}
|
||||
* for a description of parameter meanings.
|
||||
*/
|
||||
public void performBackup(ParcelFileDescriptor oldState, BackupDataOutput data,
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
@@ -24,7 +24,7 @@ import java.io.File;
|
||||
import java.io.FileDescriptor;
|
||||
|
||||
/**
|
||||
* Base class for the {@link android.backup.FileBackupHelper} implementation.
|
||||
* Base class for the {@link android.app.backup.FileBackupHelper} implementation.
|
||||
*/
|
||||
class FileBackupHelperBase {
|
||||
private static final String TAG = "FileBackupHelperBase";
|
||||
@@ -14,16 +14,16 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.backup.IRestoreSession;
|
||||
import android.app.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
|
||||
* data it wishes to back up, so the system should run a backup pass.
|
||||
*
|
||||
* Apps will use the {@link android.backup.BackupManager} class rather than going through
|
||||
* Apps will use the {@link android.app.backup.BackupManager} class rather than going through
|
||||
* this Binder interface directly.
|
||||
*
|
||||
* {@hide}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
/**
|
||||
* Callback class for receiving progress reports during a restore operation.
|
||||
@@ -14,10 +14,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.backup.RestoreSet;
|
||||
import android.backup.IRestoreObserver;
|
||||
import android.app.backup.RestoreSet;
|
||||
import android.app.backup.IRestoreObserver;
|
||||
|
||||
/**
|
||||
* Binder interface used by clients who wish to manage a restore operation. Every
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
/**
|
||||
* Callback class for receiving progress reports during a restore operation. These
|
||||
@@ -14,11 +14,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.backup.IRestoreSession;
|
||||
import android.backup.RestoreObserver;
|
||||
import android.backup.RestoreSet;
|
||||
import android.app.backup.RestoreObserver;
|
||||
import android.app.backup.RestoreSet;
|
||||
import android.app.backup.IRestoreObserver;
|
||||
import android.app.backup.IRestoreSession;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@@ -14,6 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
parcelable RestoreSet;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.backup;
|
||||
package android.app.backup;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -25,7 +25,7 @@ import java.io.File;
|
||||
|
||||
/**
|
||||
* A helper class which can be used in conjunction with
|
||||
* {@link android.backup.BackupHelperAgent} to manage the backup of
|
||||
* {@link android.app.backup.BackupHelperAgent} to manage the backup of
|
||||
* {@link android.content.SharedPreferences}. Whenever backup is performed it
|
||||
* will back up all named shared preferences which have changed since the last
|
||||
* backup.
|
||||
@@ -1489,7 +1489,7 @@ public abstract class Context {
|
||||
|
||||
/**
|
||||
* Use with {@link #getSystemService} to retrieve an
|
||||
* {@link android.backup.IBackupManager IBackupManager} for communicating
|
||||
* {@link android.app.backup.IBackupManager IBackupManager} for communicating
|
||||
* with the backup mechanism.
|
||||
* @hide
|
||||
*
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
package com.android.internal.backup;
|
||||
|
||||
import android.backup.RestoreSet;
|
||||
import android.app.backup.RestoreSet;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.android.internal.backup;
|
||||
|
||||
import android.backup.BackupDataInput;
|
||||
import android.backup.BackupDataOutput;
|
||||
import android.backup.RestoreSet;
|
||||
import android.app.backup.BackupDataInput;
|
||||
import android.app.backup.BackupDataOutput;
|
||||
import android.app.backup.RestoreSet;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
Reference in New Issue
Block a user