Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / aosp-stubs / src / main / java / android / app / backup / BackupTransport.java
BackupTransport.java147 lines · 3.8 KiBRaw
| 1 | package android.app.backup; |
| 2 | |
| 3 | import android.content.Intent; |
| 4 | import android.content.pm.PackageInfo; |
| 5 | import android.os.IBinder; |
| 6 | import android.os.ParcelFileDescriptor; |
| 7 | |
| 8 | /** |
| 9 | * Compile-only stub of the framework's {@code @SystemApi} |
| 10 | * {@code android.app.backup.BackupTransport}. Mirrors the AOSP surface (method |
| 11 | * signatures and constant values) that a backup transport implements. Not packaged; |
| 12 | * the real class is provided by the framework at runtime on a system image. |
| 13 | */ |
| 14 | public class BackupTransport { |
| 15 | // Result codes — values must match AOSP because they are inlined into callers. |
| 16 | public static final int TRANSPORT_OK = 0; |
| 17 | public static final int TRANSPORT_ERROR = 1; |
| 18 | public static final int TRANSPORT_NOT_INITIALIZED = 2; |
| 19 | public static final int TRANSPORT_PACKAGE_REJECTED = 3; |
| 20 | public static final int AGENT_ERROR = 4; |
| 21 | public static final int AGENT_UNKNOWN = 5; |
| 22 | public static final int TRANSPORT_QUOTA_EXCEEDED = 6; |
| 23 | public static final int TRANSPORT_NON_INCREMENTAL_BACKUP_REQUIRED = 7; |
| 24 | |
| 25 | // Sentinel returned by getNextFullRestoreDataChunk when a stream is exhausted. |
| 26 | public static final int NO_MORE_DATA = -1; |
| 27 | |
| 28 | // performBackup / performFullBackup flags. |
| 29 | public static final int FLAG_USER_INITIATED = 1; |
| 30 | public static final int FLAG_NON_INCREMENTAL = 1 << 1; |
| 31 | public static final int FLAG_INCREMENTAL = 1 << 2; |
| 32 | public static final int FLAG_DATA_NOT_CHANGED = 1 << 3; |
| 33 | |
| 34 | public IBinder getBinder() { |
| 35 | return null; |
| 36 | } |
| 37 | |
| 38 | public String name() { |
| 39 | return null; |
| 40 | } |
| 41 | |
| 42 | public Intent configurationIntent() { |
| 43 | return null; |
| 44 | } |
| 45 | |
| 46 | public String currentDestinationString() { |
| 47 | return null; |
| 48 | } |
| 49 | |
| 50 | public Intent dataManagementIntent() { |
| 51 | return null; |
| 52 | } |
| 53 | |
| 54 | public CharSequence dataManagementIntentLabel() { |
| 55 | return null; |
| 56 | } |
| 57 | |
| 58 | public String transportDirName() { |
| 59 | return null; |
| 60 | } |
| 61 | |
| 62 | public long requestBackupTime() { |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | public int initializeDevice() { |
| 67 | return TRANSPORT_ERROR; |
| 68 | } |
| 69 | |
| 70 | public int performBackup(PackageInfo packageInfo, ParcelFileDescriptor inFd) { |
| 71 | return TRANSPORT_ERROR; |
| 72 | } |
| 73 | |
| 74 | public int performBackup(PackageInfo packageInfo, ParcelFileDescriptor inFd, int flags) { |
| 75 | return performBackup(packageInfo, inFd); |
| 76 | } |
| 77 | |
| 78 | public int clearBackupData(PackageInfo packageInfo) { |
| 79 | return TRANSPORT_ERROR; |
| 80 | } |
| 81 | |
| 82 | public int finishBackup() { |
| 83 | return TRANSPORT_ERROR; |
| 84 | } |
| 85 | |
| 86 | public RestoreSet[] getAvailableRestoreSets() { |
| 87 | return null; |
| 88 | } |
| 89 | |
| 90 | public long getCurrentRestoreSet() { |
| 91 | return 0; |
| 92 | } |
| 93 | |
| 94 | public int startRestore(long token, PackageInfo[] packages) { |
| 95 | return TRANSPORT_ERROR; |
| 96 | } |
| 97 | |
| 98 | public RestoreDescription nextRestorePackage() { |
| 99 | return null; |
| 100 | } |
| 101 | |
| 102 | public int getRestoreData(ParcelFileDescriptor outFd) { |
| 103 | return TRANSPORT_ERROR; |
| 104 | } |
| 105 | |
| 106 | public void finishRestore() { |
| 107 | } |
| 108 | |
| 109 | public long requestFullBackupTime() { |
| 110 | return 0; |
| 111 | } |
| 112 | |
| 113 | public int checkFullBackupSize(long size) { |
| 114 | return TRANSPORT_OK; |
| 115 | } |
| 116 | |
| 117 | public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor socket) { |
| 118 | return TRANSPORT_ERROR; |
| 119 | } |
| 120 | |
| 121 | public int performFullBackup(PackageInfo targetPackage, ParcelFileDescriptor socket, int flags) { |
| 122 | return performFullBackup(targetPackage, socket); |
| 123 | } |
| 124 | |
| 125 | public int sendBackupData(int numBytes) { |
| 126 | return TRANSPORT_ERROR; |
| 127 | } |
| 128 | |
| 129 | public void cancelFullBackup() { |
| 130 | } |
| 131 | |
| 132 | public int getTransportFlags() { |
| 133 | return 0; |
| 134 | } |
| 135 | |
| 136 | public long getBackupQuota(String packageName, boolean isFullBackup) { |
| 137 | return Long.MAX_VALUE; |
| 138 | } |
| 139 | |
| 140 | public int getNextFullRestoreDataChunk(ParcelFileDescriptor socket) { |
| 141 | return NO_MORE_DATA; |
| 142 | } |
| 143 | |
| 144 | public int abortFullRestore() { |
| 145 | return TRANSPORT_OK; |
| 146 | } |
| 147 | } |