Merge change 817 into donut

* changes:
  Hide the backup stuff for now
This commit is contained in:
Android (Google) Code Review
2009-04-30 12:43:33 -07:00
3 changed files with 17 additions and 114 deletions

View File

@@ -21740,112 +21740,6 @@
</field> </field>
</class> </class>
</package> </package>
<package name="android.backup"
>
<class name="BackupManager"
extends="java.lang.Object"
abstract="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<constructor name="BackupManager"
type="android.backup.BackupManager"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="context" type="android.content.Context">
</parameter>
</constructor>
<method name="dataChanged"
return="void"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</method>
</class>
<class name="BackupService"
extends="android.app.Service"
abstract="true"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<constructor name="BackupService"
type="android.backup.BackupService"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</constructor>
<method name="onBackup"
return="void"
abstract="true"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="oldStateFd" type="int">
</parameter>
<parameter name="dataFd" type="int">
</parameter>
<parameter name="newStateFd" type="int">
</parameter>
</method>
<method name="onBind"
return="android.os.IBinder"
abstract="false"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="intent" type="android.content.Intent">
</parameter>
</method>
<method name="onRestore"
return="void"
abstract="true"
native="false"
synchronized="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<parameter name="dataFd" type="int">
</parameter>
<parameter name="newStateFd" type="int">
</parameter>
</method>
<field name="SERVICE_ACTION"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;android.service.action.BACKUP&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
</class>
</package>
<package name="android.content" <package name="android.content"
> >
<class name="ActivityNotFoundException" <class name="ActivityNotFoundException"

View File

@@ -30,10 +30,12 @@ import android.os.ServiceManager;
* The system will then schedule a backup operation to occur in the near * The system will then schedule a backup operation to occur in the near
* future. Repeated calls to {@link #dataChanged()} have no further effect * future. Repeated calls to {@link #dataChanged()} have no further effect
* until the backup operation actually occurs. * until the backup operation actually occurs.
* *
* <p>The backup operation itself begins with the system launching the * <p>The backup operation itself begins with the system launching the
* {@link BackupService} subclass declared in your manifest. See the documentation * {@link BackupService} subclass declared in your manifest. See the documentation
* for {@link BackupService} for a detailed description of how the backup then proceeds. * for {@link BackupService} for a detailed description of how the backup then proceeds.
*
* @hide pending API solidification
*/ */
public class BackupManager { public class BackupManager {
private Context mContext; private Context mContext;
@@ -42,12 +44,12 @@ public class BackupManager {
/** /**
* Constructs a BackupManager object through which the application can * Constructs a BackupManager object through which the application can
* communicate with the Android backup system. * communicate with the Android backup system.
* *
* @param context The {@link android.content.Context} that was provided when * @param context The {@link android.content.Context} that was provided when
* one of your application's {@link android.app.Activity Activities} * one of your application's {@link android.app.Activity Activities}
* was created. * was created.
*/ */
public BackupManager (Context context) { public BackupManager(Context context) {
mContext = context; mContext = context;
mService = IBackupManager.Stub.asInterface( mService = IBackupManager.Stub.asInterface(
ServiceManager.getService(Context.BACKUP_SERVICE)); ServiceManager.getService(Context.BACKUP_SERVICE));

View File

@@ -42,7 +42,7 @@ import android.util.Log;
* &lt;/intent-filter&gt; * &lt;/intent-filter&gt;
* &lt;/service&gt;</pre> * &lt;/service&gt;</pre>
* *
* <p><em>Not hidden but API subject to change and should not be published</em> * @hide pending API solidification
*/ */
public abstract class BackupService extends Service { public abstract class BackupService extends Service {
@@ -53,7 +53,7 @@ public abstract class BackupService extends Service {
* IntentFilter} that accepts this action. * IntentFilter} that accepts this action.
*/ */
@SdkConstant(SdkConstantType.SERVICE_ACTION) @SdkConstant(SdkConstantType.SERVICE_ACTION)
public static final String SERVICE_ACTION = "android.service.action.BACKUP"; public static final String SERVICE_ACTION = "android.backup.BackupService";
/** /**
* The application is being asked to write any data changed since the * The application is being asked to write any data changed since the
@@ -63,7 +63,7 @@ public abstract class BackupService extends Service {
* should perform a full backup. In both cases, a representation of the * should perform a full backup. In both cases, a representation of the
* final backup state after this pass should be written to the file pointed * final backup state after this pass should be written to the file pointed
* to by the newStateFd file descriptor. * to by the newStateFd file descriptor.
* *
* @param oldStateFd An open, read-only file descriptor pointing to the last * @param oldStateFd An open, read-only file descriptor pointing to the last
* backup state provided by the application. May be negative, * backup state provided by the application. May be negative,
* in which case no prior state is being provided and the * in which case no prior state is being provided and the
@@ -83,7 +83,7 @@ public abstract class BackupService extends Service {
* provided in the file pointed to by the dataFd file descriptor. Once * provided in the file pointed to by the dataFd file descriptor. Once
* the restore is finished, the application should write a representation * the restore is finished, the application should write a representation
* of the final state to the newStateFd file descriptor, * of the final state to the newStateFd file descriptor,
* *
* @param dataFd An open, read-only file descriptor pointing to a full snapshot * @param dataFd An open, read-only file descriptor pointing to a full snapshot
* of the application's data. * of the application's data.
* @param newStateFd An open, read/write file descriptor pointing to an empty * @param newStateFd An open, read/write file descriptor pointing to an empty
@@ -95,8 +95,15 @@ public abstract class BackupService extends Service {
// ----- Core implementation ----- // ----- Core implementation -----
/**
* Returns the private interface called by the backup system. Applications will
* not typically override this.
*/
public IBinder onBind(Intent intent) { public IBinder onBind(Intent intent) {
return mBinder; if (intent.getAction().equals(SERVICE_ACTION)) {
return mBinder;
}
return null;
} }
private final IBinder mBinder = new BackupServiceBinder().asBinder(); private final IBinder mBinder = new BackupServiceBinder().asBinder();