19b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate/* 29b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * Copyright (C) 2009 The Android Open Source Project 39b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * 49b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * Licensed under the Apache License, Version 2.0 (the "License"); 59b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * you may not use this file except in compliance with the License. 69b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * You may obtain a copy of the License at 79b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * 89b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * http://www.apache.org/licenses/LICENSE-2.0 99b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * 109b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * Unless required by applicable law or agreed to in writing, software 119b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * distributed under the License is distributed on an "AS IS" BASIS, 129b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 139b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * See the License for the specific language governing permissions and 149b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * limitations under the License. 159b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate */ 169b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 174528186e0d65fc68ef0dd1941aa2ac8aefcd55a3Christopher Tatepackage android.app.backup; 189b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 199b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tateimport android.os.Parcel; 209b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tateimport android.os.Parcelable; 219b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 229b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate/** 239b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * Descriptive information about a set of backed-up app data available for restore. 249b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * Used by IRestoreSession clients. 259b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * 269b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * @hide 279b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate */ 289b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tatepublic class RestoreSet implements Parcelable { 299b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate /** 309b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * Name of this restore set. May be user generated, may simply be the name 319b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * of the handset model, e.g. "T-Mobile G1". 329b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate */ 339b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate public String name; 349b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 359b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate /** 369b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * Identifier of the device whose data this is. This will be as unique as 379b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * is practically possible; for example, it might be an IMEI. 389b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate */ 399b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate public String device; 409b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 419b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate /** 429b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * Token that identifies this backup set unambiguously to the backup/restore 439b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * transport. This is guaranteed to be valid for the duration of a restore 449b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate * session, but is meaningless once the session has ended. 459b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate */ 46efe52647f6b41993be43a5f47d1178bb0468cec8Dan Egnor public long token; 479b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 489b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 49f68eb500f99361541049e09eb7f9ddd6f4ef4efaChristopher Tate public RestoreSet() { 509b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate // Leave everything zero / null 519b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate } 529b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 53efe52647f6b41993be43a5f47d1178bb0468cec8Dan Egnor public RestoreSet(String _name, String _dev, long _token) { 549b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate name = _name; 559b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate device = _dev; 569b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate token = _token; 579b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate } 589b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 599b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 609b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate // Parcelable implementation 619b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate public int describeContents() { 629b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate return 0; 639b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate } 649b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 659b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate public void writeToParcel(Parcel out, int flags) { 669b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate out.writeString(name); 679b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate out.writeString(device); 68efe52647f6b41993be43a5f47d1178bb0468cec8Dan Egnor out.writeLong(token); 699b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate } 709b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 719b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate public static final Parcelable.Creator<RestoreSet> CREATOR 729b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate = new Parcelable.Creator<RestoreSet>() { 739b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate public RestoreSet createFromParcel(Parcel in) { 749b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate return new RestoreSet(in); 759b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate } 769b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 779b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate public RestoreSet[] newArray(int size) { 789b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate return new RestoreSet[size]; 799b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate } 809b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate }; 819b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate 829b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate private RestoreSet(Parcel in) { 839b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate name = in.readString(); 849b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate device = in.readString(); 85efe52647f6b41993be43a5f47d1178bb0468cec8Dan Egnor token = in.readLong(); 869b3905c4a25f2d785ce7535d1f2e1540b46bb561Christopher Tate } 87efe52647f6b41993be43a5f47d1178bb0468cec8Dan Egnor} 88