blob: 40ad383e7d58e9d97d305300d0a53689a8490fd1 [file] [log] [blame]
Christopher Tate181fafa2009-05-14 11:12:14 -07001/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server.am;
18
Christopher Tate181fafa2009-05-14 11:12:14 -070019import android.content.pm.ApplicationInfo;
20
21/** @hide */
Dianne Hackbornbe4e6aa2013-06-07 13:25:29 -070022final class BackupRecord {
Christopher Tate181fafa2009-05-14 11:12:14 -070023 // backup/restore modes
24 public static final int BACKUP_NORMAL = 0;
25 public static final int BACKUP_FULL = 1;
26 public static final int RESTORE = 2;
Christopher Tate75a99702011-05-18 16:28:19 -070027 public static final int RESTORE_FULL = 3;
Christopher Tate181fafa2009-05-14 11:12:14 -070028
Christopher Tate181fafa2009-05-14 11:12:14 -070029 String stringName; // cached toString() output
30 final ApplicationInfo appInfo; // information about BackupAgent's app
31 final int backupMode; // full backup / incremental / restore
32 ProcessRecord app; // where this agent is running or null
33
34 // ----- Implementation -----
35
Bookatzfc099272018-08-15 15:13:02 -070036 BackupRecord(ApplicationInfo _appInfo, int _backupMode) {
Christopher Tate181fafa2009-05-14 11:12:14 -070037 appInfo = _appInfo;
38 backupMode = _backupMode;
39 }
40
41 public String toString() {
42 if (stringName != null) {
43 return stringName;
44 }
45 StringBuilder sb = new StringBuilder(128);
46 sb.append("BackupRecord{")
47 .append(Integer.toHexString(System.identityHashCode(this)))
48 .append(' ').append(appInfo.packageName)
49 .append(' ').append(appInfo.name)
50 .append(' ').append(appInfo.backupAgentName).append('}');
51 return stringName = sb.toString();
52 }
Joe Onorato8a9b2202010-02-26 18:56:32 -080053}