Merge changes 3953,3954 into donut
* changes: Make the file backup helper not crash if a file you requested can't be stated. This means you don't need to know if the files you are backing up exist or not -- we'll figure it out for you. Fix SharedPrefsBackupHelper so it doesn't hard code the paths to the files.
This commit is contained in:
@ -29035,6 +29035,19 @@
|
|||||||
<parameter name="mode" type="int">
|
<parameter name="mode" type="int">
|
||||||
</parameter>
|
</parameter>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="getSharedPrefsFile"
|
||||||
|
return="java.io.File"
|
||||||
|
abstract="false"
|
||||||
|
native="false"
|
||||||
|
synchronized="false"
|
||||||
|
static="false"
|
||||||
|
final="false"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
<parameter name="name" type="java.lang.String">
|
||||||
|
</parameter>
|
||||||
|
</method>
|
||||||
<method name="getSystemService"
|
<method name="getSystemService"
|
||||||
return="java.lang.Object"
|
return="java.lang.Object"
|
||||||
abstract="false"
|
abstract="false"
|
||||||
@ -115907,6 +115920,19 @@
|
|||||||
<parameter name="mode" type="int">
|
<parameter name="mode" type="int">
|
||||||
</parameter>
|
</parameter>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="getSharedPrefsFile"
|
||||||
|
return="java.io.File"
|
||||||
|
abstract="false"
|
||||||
|
native="false"
|
||||||
|
synchronized="false"
|
||||||
|
static="false"
|
||||||
|
final="false"
|
||||||
|
deprecated="not deprecated"
|
||||||
|
visibility="public"
|
||||||
|
>
|
||||||
|
<parameter name="name" type="java.lang.String">
|
||||||
|
</parameter>
|
||||||
|
</method>
|
||||||
<method name="getSystemService"
|
<method name="getSystemService"
|
||||||
return="java.lang.Object"
|
return="java.lang.Object"
|
||||||
abstract="false"
|
abstract="false"
|
||||||
|
@ -300,10 +300,14 @@ class ApplicationContext extends Context {
|
|||||||
return new File(prefsFile.getPath() + ".bak");
|
return new File(prefsFile.getPath() + ".bak");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public File getSharedPrefsFile(String name) {
|
||||||
|
return makeFilename(getPreferencesDir(), name + ".xml");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||||
SharedPreferencesImpl sp;
|
SharedPreferencesImpl sp;
|
||||||
File f = makeFilename(getPreferencesDir(), name + ".xml");
|
File f = getSharedPrefsFile(name);
|
||||||
synchronized (sSharedPrefs) {
|
synchronized (sSharedPrefs) {
|
||||||
sp = sSharedPrefs.get(f);
|
sp = sSharedPrefs.get(f);
|
||||||
if (sp != null && !sp.hasFileChanged()) {
|
if (sp != null && !sp.hasFileChanged()) {
|
||||||
|
@ -20,6 +20,7 @@ import android.content.Context;
|
|||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
@ -34,22 +35,34 @@ public class FileBackupHelper {
|
|||||||
public static void performBackup(Context context,
|
public static void performBackup(Context context,
|
||||||
ParcelFileDescriptor oldState, BackupDataOutput data,
|
ParcelFileDescriptor oldState, BackupDataOutput data,
|
||||||
ParcelFileDescriptor newState, String[] files) {
|
ParcelFileDescriptor newState, String[] files) {
|
||||||
String basePath = context.getFilesDir().getAbsolutePath();
|
File base = context.getFilesDir();
|
||||||
performBackup_checked(basePath, oldState, data, newState, files);
|
final int N = files.length;
|
||||||
|
String[] fullPaths = new String[N];
|
||||||
|
for (int i=0; i<N; i++) {
|
||||||
|
fullPaths[i] = (new File(base, files[i])).getAbsolutePath();
|
||||||
|
}
|
||||||
|
performBackup_checked(oldState, data, newState, fullPaths, files);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the parameters so the native code doens't have to throw all the exceptions
|
* Check the parameters so the native code doens't have to throw all the exceptions
|
||||||
* since it's easier to do that from java.
|
* since it's easier to do that from java.
|
||||||
*/
|
*/
|
||||||
static void performBackup_checked(String basePath,
|
static void performBackup_checked(ParcelFileDescriptor oldState, BackupDataOutput data,
|
||||||
ParcelFileDescriptor oldState, BackupDataOutput data,
|
ParcelFileDescriptor newState, String[] files, String[] keys) {
|
||||||
ParcelFileDescriptor newState, String[] files) {
|
|
||||||
if (files.length == 0) {
|
if (files.length == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (basePath == null) {
|
// files must be all absolute paths
|
||||||
throw new NullPointerException();
|
for (String f: files) {
|
||||||
|
if (f.charAt(0) != '/') {
|
||||||
|
throw new RuntimeException("files must have all absolute paths: " + f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// the length of files and keys must be the same
|
||||||
|
if (files.length != keys.length) {
|
||||||
|
throw new RuntimeException("files.length=" + files.length
|
||||||
|
+ " keys.length=" + keys.length);
|
||||||
}
|
}
|
||||||
// oldStateFd can be null
|
// oldStateFd can be null
|
||||||
FileDescriptor oldStateFd = oldState != null ? oldState.getFileDescriptor() : null;
|
FileDescriptor oldStateFd = oldState != null ? oldState.getFileDescriptor() : null;
|
||||||
@ -58,13 +71,14 @@ public class FileBackupHelper {
|
|||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
}
|
}
|
||||||
|
|
||||||
int err = performBackup_native(basePath, oldStateFd, data.mBackupWriter, newStateFd, files);
|
int err = performBackup_native(oldStateFd, data.mBackupWriter, newStateFd, files, keys);
|
||||||
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
throw new RuntimeException("Backup failed"); // TODO: more here
|
// TODO: more here
|
||||||
|
throw new RuntimeException("Backup failed 0x" + Integer.toHexString(err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
native private static int performBackup_native(String basePath, FileDescriptor oldState,
|
native private static int performBackup_native(FileDescriptor oldState,
|
||||||
int data, FileDescriptor newState, String[] files);
|
int data, FileDescriptor newState, String[] files, String[] keys);
|
||||||
}
|
}
|
||||||
|
@ -26,16 +26,14 @@ public class SharedPreferencesBackupHelper {
|
|||||||
public static void performBackup(Context context,
|
public static void performBackup(Context context,
|
||||||
ParcelFileDescriptor oldSnapshot, ParcelFileDescriptor newSnapshot,
|
ParcelFileDescriptor oldSnapshot, ParcelFileDescriptor newSnapshot,
|
||||||
BackupDataOutput data, String[] prefGroups) {
|
BackupDataOutput data, String[] prefGroups) {
|
||||||
String basePath = "/xxx"; //context.getPreferencesDir();
|
|
||||||
|
|
||||||
// make filenames for the prefGroups
|
// make filenames for the prefGroups
|
||||||
final int N = prefGroups.length;
|
final int N = prefGroups.length;
|
||||||
String[] files = new String[N];
|
String[] files = new String[N];
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
files[i] = prefGroups[i] + ".xml";
|
files[i] = context.getSharedPrefsFile(prefGroups[i]).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
FileBackupHelper.performBackup_checked(basePath, oldSnapshot, data, newSnapshot, files);
|
FileBackupHelper.performBackup_checked(oldSnapshot, data, newSnapshot, files, prefGroups);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,11 +254,19 @@ public abstract class Context {
|
|||||||
* <p>Note: this is not generally useful for applications, since they should
|
* <p>Note: this is not generally useful for applications, since they should
|
||||||
* not be directly accessing the file system.
|
* not be directly accessing the file system.
|
||||||
*
|
*
|
||||||
*
|
|
||||||
* @return String Path to the code and assets.
|
* @return String Path to the code and assets.
|
||||||
*/
|
*/
|
||||||
public abstract String getPackageCodePath();
|
public abstract String getPackageCodePath();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@hide}
|
||||||
|
* Return the full path to the shared prefs file for the given prefs group name.
|
||||||
|
*
|
||||||
|
* <p>Note: this is not generally useful for applications, since they should
|
||||||
|
* not be directly accessing the file system.
|
||||||
|
*/
|
||||||
|
public abstract File getSharedPrefsFile(String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve and hold the contents of the preferences file 'name', returning
|
* Retrieve and hold the contents of the preferences file 'name', returning
|
||||||
* a SharedPreferences through which you can retrieve and modify its
|
* a SharedPreferences through which you can retrieve and modify its
|
||||||
|
@ -129,6 +129,11 @@ public class ContextWrapper extends Context {
|
|||||||
return mBase.getPackageCodePath();
|
return mBase.getPackageCodePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public File getSharedPrefsFile(String name) {
|
||||||
|
return mBase.getSharedPrefsFile(name);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences(String name, int mode) {
|
public SharedPreferences getSharedPreferences(String name, int mode) {
|
||||||
return mBase.getSharedPreferences(name, mode);
|
return mBase.getSharedPreferences(name, mode);
|
||||||
|
@ -28,8 +28,8 @@ namespace android
|
|||||||
static jfieldID s_descriptorField = 0;
|
static jfieldID s_descriptorField = 0;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
performBackup_native(JNIEnv* env, jobject clazz, jstring basePath, jobject oldState, int data,
|
performBackup_native(JNIEnv* env, jobject clazz, jobject oldState, int data,
|
||||||
jobject newState, jobjectArray files)
|
jobject newState, jobjectArray files, jobjectArray keys)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -39,29 +39,37 @@ performBackup_native(JNIEnv* env, jobject clazz, jstring basePath, jobject oldSt
|
|||||||
int newStateFD = env->GetIntField(newState, s_descriptorField);
|
int newStateFD = env->GetIntField(newState, s_descriptorField);
|
||||||
BackupDataWriter* dataStream = (BackupDataWriter*)data;
|
BackupDataWriter* dataStream = (BackupDataWriter*)data;
|
||||||
|
|
||||||
char const* basePathUTF = env->GetStringUTFChars(basePath, NULL);
|
|
||||||
LOGD("basePathUTF=\"%s\"\n", basePathUTF);
|
|
||||||
const int fileCount = env->GetArrayLength(files);
|
const int fileCount = env->GetArrayLength(files);
|
||||||
char const** filesUTF = (char const**)malloc(sizeof(char*)*fileCount);
|
char const** filesUTF = (char const**)malloc(sizeof(char*)*fileCount);
|
||||||
for (int i=0; i<fileCount; i++) {
|
for (int i=0; i<fileCount; i++) {
|
||||||
filesUTF[i] = env->GetStringUTFChars((jstring)env->GetObjectArrayElement(files, i), NULL);
|
filesUTF[i] = env->GetStringUTFChars((jstring)env->GetObjectArrayElement(files, i), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = back_up_files(oldStateFD, dataStream, newStateFD, basePathUTF, filesUTF, fileCount);
|
const int keyCount = env->GetArrayLength(keys);
|
||||||
|
char const** keysUTF = (char const**)malloc(sizeof(char*)*keyCount);
|
||||||
|
for (int i=0; i<keyCount; i++) {
|
||||||
|
keysUTF[i] = env->GetStringUTFChars((jstring)env->GetObjectArrayElement(keys, i), NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
err = back_up_files(oldStateFD, dataStream, newStateFD, filesUTF, keysUTF, fileCount);
|
||||||
|
|
||||||
for (int i=0; i<fileCount; i++) {
|
for (int i=0; i<fileCount; i++) {
|
||||||
env->ReleaseStringUTFChars((jstring)env->GetObjectArrayElement(files, i), filesUTF[i]);
|
env->ReleaseStringUTFChars((jstring)env->GetObjectArrayElement(files, i), filesUTF[i]);
|
||||||
}
|
}
|
||||||
free(filesUTF);
|
free(filesUTF);
|
||||||
env->ReleaseStringUTFChars(basePath, basePathUTF);
|
|
||||||
|
for (int i=0; i<keyCount; i++) {
|
||||||
|
env->ReleaseStringUTFChars((jstring)env->GetObjectArrayElement(keys, i), keysUTF[i]);
|
||||||
|
}
|
||||||
|
free(keysUTF);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const JNINativeMethod g_methods[] = {
|
static const JNINativeMethod g_methods[] = {
|
||||||
{ "performBackup_native",
|
{ "performBackup_native",
|
||||||
"(Ljava/lang/String;Ljava/io/FileDescriptor;ILjava/io/FileDescriptor;[Ljava/lang/String;)I",
|
"(Ljava/io/FileDescriptor;ILjava/io/FileDescriptor;[Ljava/lang/String;[Ljava/lang/String;)I",
|
||||||
(void*)performBackup_native },
|
(void*)performBackup_native },
|
||||||
};
|
};
|
||||||
|
|
||||||
int register_android_backup_FileBackupHelper(JNIEnv* env)
|
int register_android_backup_FileBackupHelper(JNIEnv* env)
|
||||||
|
@ -118,7 +118,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
int back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD,
|
int back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD,
|
||||||
char const* fileBase, char const* const* files, int fileCount);
|
char const* const* files, char const* const *keys, int fileCount);
|
||||||
|
|
||||||
|
|
||||||
#define TEST_BACKUP_HELPERS 1
|
#define TEST_BACKUP_HELPERS 1
|
||||||
@ -127,6 +127,8 @@ int back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapsh
|
|||||||
int backup_helper_test_empty();
|
int backup_helper_test_empty();
|
||||||
int backup_helper_test_four();
|
int backup_helper_test_four();
|
||||||
int backup_helper_test_files();
|
int backup_helper_test_files();
|
||||||
|
int backup_helper_test_null_base();
|
||||||
|
int backup_helper_test_missing_file();
|
||||||
int backup_helper_test_data_writer();
|
int backup_helper_test_data_writer();
|
||||||
int backup_helper_test_data_reader();
|
int backup_helper_test_data_reader();
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,8 +41,8 @@ namespace android {
|
|||||||
#define MAGIC0 0x70616e53 // Snap
|
#define MAGIC0 0x70616e53 // Snap
|
||||||
#define MAGIC1 0x656c6946 // File
|
#define MAGIC1 0x656c6946 // File
|
||||||
|
|
||||||
#if 0 // TEST_BACKUP_HELPERS
|
#if 1 // TEST_BACKUP_HELPERS
|
||||||
#define LOGP(x...) printf(x)
|
#define LOGP(f, x...) printf(f "\n", x)
|
||||||
#else
|
#else
|
||||||
#define LOGP(x...) LOGD(x)
|
#define LOGP(x...) LOGD(x)
|
||||||
#endif
|
#endif
|
||||||
@ -62,6 +62,12 @@ struct FileState {
|
|||||||
int nameLen;
|
int nameLen;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct FileRec {
|
||||||
|
char const* file; // this object does not own this string
|
||||||
|
bool deleted;
|
||||||
|
FileState s;
|
||||||
|
};
|
||||||
|
|
||||||
const static int ROUND_UP[4] = { 0, 3, 2, 1 };
|
const static int ROUND_UP[4] = { 0, 3, 2, 1 };
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
@ -92,8 +98,8 @@ read_snapshot_file(int fd, KeyedVector<String8,FileState>* snapshot)
|
|||||||
FileState file;
|
FileState file;
|
||||||
char filenameBuf[128];
|
char filenameBuf[128];
|
||||||
|
|
||||||
amt = read(fd, &file, sizeof(file));
|
amt = read(fd, &file, sizeof(FileState));
|
||||||
if (amt != sizeof(file)) {
|
if (amt != sizeof(FileState)) {
|
||||||
LOGW("read_snapshot_file FileState truncated/error with read at %d bytes\n", bytesRead);
|
LOGW("read_snapshot_file FileState truncated/error with read at %d bytes\n", bytesRead);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -128,20 +134,25 @@ read_snapshot_file(int fd, KeyedVector<String8,FileState>* snapshot)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
write_snapshot_file(int fd, const KeyedVector<String8,FileState>& snapshot)
|
write_snapshot_file(int fd, const KeyedVector<String8,FileRec>& snapshot)
|
||||||
{
|
{
|
||||||
|
int fileCount = 0;
|
||||||
int bytesWritten = sizeof(SnapshotHeader);
|
int bytesWritten = sizeof(SnapshotHeader);
|
||||||
// preflight size
|
// preflight size
|
||||||
const int N = snapshot.size();
|
const int N = snapshot.size();
|
||||||
for (int i=0; i<N; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
const String8& name = snapshot.keyAt(i);
|
const FileRec& g = snapshot.valueAt(i);
|
||||||
bytesWritten += sizeof(FileState) + round_up(name.length());
|
if (!g.deleted) {
|
||||||
|
const String8& name = snapshot.keyAt(i);
|
||||||
|
bytesWritten += sizeof(FileState) + round_up(name.length());
|
||||||
|
fileCount++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGP("write_snapshot_file fd=%d\n", fd);
|
LOGP("write_snapshot_file fd=%d\n", fd);
|
||||||
|
|
||||||
int amt;
|
int amt;
|
||||||
SnapshotHeader header = { MAGIC0, N, MAGIC1, bytesWritten };
|
SnapshotHeader header = { MAGIC0, fileCount, MAGIC1, bytesWritten };
|
||||||
|
|
||||||
amt = write(fd, &header, sizeof(header));
|
amt = write(fd, &header, sizeof(header));
|
||||||
if (amt != sizeof(header)) {
|
if (amt != sizeof(header)) {
|
||||||
@ -149,32 +160,34 @@ write_snapshot_file(int fd, const KeyedVector<String8,FileState>& snapshot)
|
|||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<header.fileCount; i++) {
|
for (int i=0; i<N; i++) {
|
||||||
const String8& name = snapshot.keyAt(i);
|
FileRec r = snapshot.valueAt(i);
|
||||||
FileState file = snapshot.valueAt(i);
|
if (!r.deleted) {
|
||||||
int nameLen = file.nameLen = name.length();
|
const String8& name = snapshot.keyAt(i);
|
||||||
|
int nameLen = r.s.nameLen = name.length();
|
||||||
|
|
||||||
amt = write(fd, &file, sizeof(file));
|
amt = write(fd, &r.s, sizeof(FileState));
|
||||||
if (amt != sizeof(file)) {
|
if (amt != sizeof(FileState)) {
|
||||||
LOGW("write_snapshot_file error writing header %s", strerror(errno));
|
LOGW("write_snapshot_file error writing header %s", strerror(errno));
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// filename is not NULL terminated, but it is padded
|
|
||||||
amt = write(fd, name.string(), nameLen);
|
|
||||||
if (amt != nameLen) {
|
|
||||||
LOGW("write_snapshot_file error writing filename %s", strerror(errno));
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
int paddingLen = ROUND_UP[nameLen % 4];
|
|
||||||
if (paddingLen != 0) {
|
|
||||||
int padding = 0xabababab;
|
|
||||||
amt = write(fd, &padding, paddingLen);
|
|
||||||
if (amt != paddingLen) {
|
|
||||||
LOGW("write_snapshot_file error writing %d bytes of filename padding %s",
|
|
||||||
paddingLen, strerror(errno));
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// filename is not NULL terminated, but it is padded
|
||||||
|
amt = write(fd, name.string(), nameLen);
|
||||||
|
if (amt != nameLen) {
|
||||||
|
LOGW("write_snapshot_file error writing filename %s", strerror(errno));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
int paddingLen = ROUND_UP[nameLen % 4];
|
||||||
|
if (paddingLen != 0) {
|
||||||
|
int padding = 0xabababab;
|
||||||
|
amt = write(fd, &padding, paddingLen);
|
||||||
|
if (amt != paddingLen) {
|
||||||
|
LOGW("write_snapshot_file error writing %d bytes of filename padding %s",
|
||||||
|
paddingLen, strerror(errno));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,9 +203,9 @@ write_delete_file(BackupDataWriter* dataStream, const String8& key)
|
|||||||
|
|
||||||
static int
|
static int
|
||||||
write_update_file(BackupDataWriter* dataStream, int fd, const String8& key,
|
write_update_file(BackupDataWriter* dataStream, int fd, const String8& key,
|
||||||
const String8& realFilename)
|
char const* realFilename)
|
||||||
{
|
{
|
||||||
LOGP("write_update_file %s (%s)\n", realFilename.string(), key.string());
|
LOGP("write_update_file %s (%s)\n", realFilename, key.string());
|
||||||
|
|
||||||
const int bufsize = 4*1024;
|
const int bufsize = 4*1024;
|
||||||
int err;
|
int err;
|
||||||
@ -237,8 +250,7 @@ write_update_file(BackupDataWriter* dataStream, int fd, const String8& key,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOGE("write_update_file size mismatch for %s. expected=%d actual=%d."
|
LOGE("write_update_file size mismatch for %s. expected=%d actual=%d."
|
||||||
" You aren't doing proper locking!",
|
" You aren't doing proper locking!", realFilename, fileSize, fileSize-bytesLeft);
|
||||||
realFilename.string(), fileSize, fileSize-bytesLeft);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(buf);
|
free(buf);
|
||||||
@ -247,10 +259,10 @@ write_update_file(BackupDataWriter* dataStream, int fd, const String8& key,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
write_update_file(BackupDataWriter* dataStream, const String8& key, const String8& realFilename)
|
write_update_file(BackupDataWriter* dataStream, const String8& key, char const* realFilename)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
int fd = open(realFilename.string(), O_RDONLY);
|
int fd = open(realFilename, O_RDONLY);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
@ -281,12 +293,11 @@ compute_crc32(int fd)
|
|||||||
|
|
||||||
int
|
int
|
||||||
back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD,
|
back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD,
|
||||||
char const* fileBase, char const* const* files, int fileCount)
|
char const* const* files, char const* const* keys, int fileCount)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
const String8 base(fileBase);
|
|
||||||
KeyedVector<String8,FileState> oldSnapshot;
|
KeyedVector<String8,FileState> oldSnapshot;
|
||||||
KeyedVector<String8,FileState> newSnapshot;
|
KeyedVector<String8,FileRec> newSnapshot;
|
||||||
|
|
||||||
if (oldSnapshotFD != -1) {
|
if (oldSnapshotFD != -1) {
|
||||||
err = read_snapshot_file(oldSnapshotFD, &oldSnapshot);
|
err = read_snapshot_file(oldSnapshotFD, &oldSnapshot);
|
||||||
@ -297,26 +308,29 @@ back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i<fileCount; i++) {
|
for (int i=0; i<fileCount; i++) {
|
||||||
String8 name(files[i]);
|
String8 key(keys[i]);
|
||||||
FileState s;
|
FileRec r;
|
||||||
|
char const* file = r.file = files[i];
|
||||||
struct stat st;
|
struct stat st;
|
||||||
String8 realFilename(base);
|
|
||||||
realFilename.appendPath(name);
|
|
||||||
|
|
||||||
err = stat(realFilename.string(), &st);
|
err = stat(file, &st);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
LOGW("Error stating file %s", realFilename.string());
|
LOGW("Error stating file %s", file);
|
||||||
continue;
|
r.deleted = true;
|
||||||
|
} else {
|
||||||
|
r.deleted = false;
|
||||||
|
r.s.modTime_sec = st.st_mtime;
|
||||||
|
r.s.modTime_nsec = 0; // workaround sim breakage
|
||||||
|
//r.s.modTime_nsec = st.st_mtime_nsec;
|
||||||
|
r.s.size = st.st_size;
|
||||||
|
// we compute the crc32 later down below, when we already have the file open.
|
||||||
|
|
||||||
|
if (newSnapshot.indexOfKey(key) >= 0) {
|
||||||
|
LOGP("back_up_files key already in use '%s'", key.string());
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
newSnapshot.add(key, r);
|
||||||
s.modTime_sec = st.st_mtime;
|
|
||||||
s.modTime_nsec = 0; // workaround sim breakage
|
|
||||||
//s.modTime_nsec = st.st_mtime_nsec;
|
|
||||||
s.size = st.st_size;
|
|
||||||
|
|
||||||
// we compute the crc32 later down below, when we already have the file open.
|
|
||||||
|
|
||||||
newSnapshot.add(name, s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int n = 0;
|
int n = 0;
|
||||||
@ -326,46 +340,42 @@ back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD
|
|||||||
while (n<N && m<fileCount) {
|
while (n<N && m<fileCount) {
|
||||||
const String8& p = oldSnapshot.keyAt(n);
|
const String8& p = oldSnapshot.keyAt(n);
|
||||||
const String8& q = newSnapshot.keyAt(m);
|
const String8& q = newSnapshot.keyAt(m);
|
||||||
|
FileRec& g = newSnapshot.editValueAt(m);
|
||||||
int cmp = p.compare(q);
|
int cmp = p.compare(q);
|
||||||
if (cmp > 0) {
|
if (g.deleted || cmp < 0) {
|
||||||
// file added
|
|
||||||
String8 realFilename(base);
|
|
||||||
realFilename.appendPath(q);
|
|
||||||
LOGP("file added: %s\n", realFilename.string());
|
|
||||||
write_update_file(dataStream, q, realFilename);
|
|
||||||
m++;
|
|
||||||
}
|
|
||||||
else if (cmp < 0) {
|
|
||||||
// file removed
|
// file removed
|
||||||
LOGP("file removed: %s\n", p.string());
|
LOGP("file removed: %s", p.string());
|
||||||
|
g.deleted = true; // They didn't mention the file, but we noticed that it's gone.
|
||||||
dataStream->WriteEntityHeader(p, -1);
|
dataStream->WriteEntityHeader(p, -1);
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
else if (cmp > 0) {
|
||||||
|
// file added
|
||||||
|
LOGP("file added: %s", g.file);
|
||||||
|
write_update_file(dataStream, q, g.file);
|
||||||
|
m++;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
// both files exist, check them
|
// both files exist, check them
|
||||||
String8 realFilename(base);
|
|
||||||
realFilename.appendPath(q);
|
|
||||||
const FileState& f = oldSnapshot.valueAt(n);
|
const FileState& f = oldSnapshot.valueAt(n);
|
||||||
FileState& g = newSnapshot.editValueAt(m);
|
|
||||||
|
|
||||||
int fd = open(realFilename.string(), O_RDONLY);
|
int fd = open(g.file, O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
// We can't open the file. Don't report it as a delete either. Let the
|
// We can't open the file. Don't report it as a delete either. Let the
|
||||||
// server keep the old version. Maybe they'll be able to deal with it
|
// server keep the old version. Maybe they'll be able to deal with it
|
||||||
// on restore.
|
// on restore.
|
||||||
LOGP("Unable to open file %s - skipping", realFilename.string());
|
LOGP("Unable to open file %s - skipping", g.file);
|
||||||
} else {
|
} else {
|
||||||
g.crc32 = compute_crc32(fd);
|
g.s.crc32 = compute_crc32(fd);
|
||||||
|
|
||||||
LOGP("%s\n", q.string());
|
LOGP("%s", q.string());
|
||||||
LOGP(" new: modTime=%d,%d size=%-3d crc32=0x%08x\n",
|
LOGP(" new: modTime=%d,%d size=%-3d crc32=0x%08x",
|
||||||
f.modTime_sec, f.modTime_nsec, f.size, f.crc32);
|
f.modTime_sec, f.modTime_nsec, f.size, f.crc32);
|
||||||
LOGP(" old: modTime=%d,%d size=%-3d crc32=0x%08x\n",
|
LOGP(" old: modTime=%d,%d size=%-3d crc32=0x%08x",
|
||||||
g.modTime_sec, g.modTime_nsec, g.size, g.crc32);
|
g.s.modTime_sec, g.s.modTime_nsec, g.s.size, g.s.crc32);
|
||||||
if (f.modTime_sec != g.modTime_sec || f.modTime_nsec != g.modTime_nsec
|
if (f.modTime_sec != g.s.modTime_sec || f.modTime_nsec != g.s.modTime_nsec
|
||||||
|| f.size != g.size || f.crc32 != g.crc32) {
|
|| f.size != g.s.size || f.crc32 != g.s.crc32) {
|
||||||
write_update_file(dataStream, fd, p, realFilename);
|
write_update_file(dataStream, fd, p, g.file);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(fd);
|
close(fd);
|
||||||
@ -384,9 +394,8 @@ back_up_files(int oldSnapshotFD, BackupDataWriter* dataStream, int newSnapshotFD
|
|||||||
// these were added
|
// these were added
|
||||||
while (m<fileCount) {
|
while (m<fileCount) {
|
||||||
const String8& q = newSnapshot.keyAt(m);
|
const String8& q = newSnapshot.keyAt(m);
|
||||||
String8 realFilename(base);
|
FileRec& g = newSnapshot.editValueAt(m);
|
||||||
realFilename.appendPath(q);
|
write_update_file(dataStream, q, g.file);
|
||||||
write_update_file(dataStream, q, realFilename);
|
|
||||||
m++;
|
m++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,7 +484,7 @@ backup_helper_test_empty()
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
int fd;
|
int fd;
|
||||||
KeyedVector<String8,FileState> snapshot;
|
KeyedVector<String8,FileRec> snapshot;
|
||||||
const char* filename = SCRATCH_DIR "backup_helper_test_empty.snap";
|
const char* filename = SCRATCH_DIR "backup_helper_test_empty.snap";
|
||||||
|
|
||||||
system("rm -r " SCRATCH_DIR);
|
system("rm -r " SCRATCH_DIR);
|
||||||
@ -534,7 +543,7 @@ backup_helper_test_four()
|
|||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
int fd;
|
int fd;
|
||||||
KeyedVector<String8,FileState> snapshot;
|
KeyedVector<String8,FileRec> snapshot;
|
||||||
const char* filename = SCRATCH_DIR "backup_helper_test_four.snap";
|
const char* filename = SCRATCH_DIR "backup_helper_test_four.snap";
|
||||||
|
|
||||||
system("rm -r " SCRATCH_DIR);
|
system("rm -r " SCRATCH_DIR);
|
||||||
@ -549,38 +558,45 @@ backup_helper_test_four()
|
|||||||
|
|
||||||
String8 filenames[4];
|
String8 filenames[4];
|
||||||
FileState states[4];
|
FileState states[4];
|
||||||
|
FileRec r;
|
||||||
|
r.deleted = false;
|
||||||
|
r.file = NULL;
|
||||||
|
|
||||||
states[0].modTime_sec = 0xfedcba98;
|
states[0].modTime_sec = 0xfedcba98;
|
||||||
states[0].modTime_nsec = 0xdeadbeef;
|
states[0].modTime_nsec = 0xdeadbeef;
|
||||||
states[0].size = 0xababbcbc;
|
states[0].size = 0xababbcbc;
|
||||||
states[0].crc32 = 0x12345678;
|
states[0].crc32 = 0x12345678;
|
||||||
states[0].nameLen = -12;
|
states[0].nameLen = -12;
|
||||||
|
r.s = states[0];
|
||||||
filenames[0] = String8("bytes_of_padding");
|
filenames[0] = String8("bytes_of_padding");
|
||||||
snapshot.add(filenames[0], states[0]);
|
snapshot.add(filenames[0], r);
|
||||||
|
|
||||||
states[1].modTime_sec = 0x93400031;
|
states[1].modTime_sec = 0x93400031;
|
||||||
states[1].modTime_nsec = 0xdeadbeef;
|
states[1].modTime_nsec = 0xdeadbeef;
|
||||||
states[1].size = 0x88557766;
|
states[1].size = 0x88557766;
|
||||||
states[1].crc32 = 0x22334422;
|
states[1].crc32 = 0x22334422;
|
||||||
states[1].nameLen = -1;
|
states[1].nameLen = -1;
|
||||||
|
r.s = states[1];
|
||||||
filenames[1] = String8("bytes_of_padding3");
|
filenames[1] = String8("bytes_of_padding3");
|
||||||
snapshot.add(filenames[1], states[1]);
|
snapshot.add(filenames[1], r);
|
||||||
|
|
||||||
states[2].modTime_sec = 0x33221144;
|
states[2].modTime_sec = 0x33221144;
|
||||||
states[2].modTime_nsec = 0xdeadbeef;
|
states[2].modTime_nsec = 0xdeadbeef;
|
||||||
states[2].size = 0x11223344;
|
states[2].size = 0x11223344;
|
||||||
states[2].crc32 = 0x01122334;
|
states[2].crc32 = 0x01122334;
|
||||||
states[2].nameLen = 0;
|
states[2].nameLen = 0;
|
||||||
|
r.s = states[2];
|
||||||
filenames[2] = String8("bytes_of_padding_2");
|
filenames[2] = String8("bytes_of_padding_2");
|
||||||
snapshot.add(filenames[2], states[2]);
|
snapshot.add(filenames[2], r);
|
||||||
|
|
||||||
states[3].modTime_sec = 0x33221144;
|
states[3].modTime_sec = 0x33221144;
|
||||||
states[3].modTime_nsec = 0xdeadbeef;
|
states[3].modTime_nsec = 0xdeadbeef;
|
||||||
states[3].size = 0x11223344;
|
states[3].size = 0x11223344;
|
||||||
states[3].crc32 = 0x01122334;
|
states[3].crc32 = 0x01122334;
|
||||||
states[3].nameLen = 0;
|
states[3].nameLen = 0;
|
||||||
|
r.s = states[3];
|
||||||
filenames[3] = String8("bytes_of_padding__1");
|
filenames[3] = String8("bytes_of_padding__1");
|
||||||
snapshot.add(filenames[3], states[3]);
|
snapshot.add(filenames[3], r);
|
||||||
|
|
||||||
err = write_snapshot_file(fd, snapshot);
|
err = write_snapshot_file(fd, snapshot);
|
||||||
|
|
||||||
@ -982,6 +998,14 @@ backup_helper_test_files()
|
|||||||
write_text_file(SCRATCH_DIR "data/h", "h\nhh\n");
|
write_text_file(SCRATCH_DIR "data/h", "h\nhh\n");
|
||||||
|
|
||||||
char const* files_before[] = {
|
char const* files_before[] = {
|
||||||
|
SCRATCH_DIR "data/b",
|
||||||
|
SCRATCH_DIR "data/c",
|
||||||
|
SCRATCH_DIR "data/d",
|
||||||
|
SCRATCH_DIR "data/e",
|
||||||
|
SCRATCH_DIR "data/f"
|
||||||
|
};
|
||||||
|
|
||||||
|
char const* keys_before[] = {
|
||||||
"data/b",
|
"data/b",
|
||||||
"data/c",
|
"data/c",
|
||||||
"data/d",
|
"data/d",
|
||||||
@ -1004,7 +1028,7 @@ backup_helper_test_files()
|
|||||||
{
|
{
|
||||||
BackupDataWriter dataStream(dataStreamFD);
|
BackupDataWriter dataStream(dataStreamFD);
|
||||||
|
|
||||||
err = back_up_files(-1, &dataStream, newSnapshotFD, SCRATCH_DIR, files_before, 5);
|
err = back_up_files(-1, &dataStream, newSnapshotFD, files_before, keys_before, 5);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -1035,6 +1059,15 @@ backup_helper_test_files()
|
|||||||
unlink(SCRATCH_DIR "data/f");
|
unlink(SCRATCH_DIR "data/f");
|
||||||
|
|
||||||
char const* files_after[] = {
|
char const* files_after[] = {
|
||||||
|
SCRATCH_DIR "data/a", // added
|
||||||
|
SCRATCH_DIR "data/b", // same
|
||||||
|
SCRATCH_DIR "data/c", // different mod time
|
||||||
|
SCRATCH_DIR "data/d", // different size (same mod time)
|
||||||
|
SCRATCH_DIR "data/e", // different contents (same mod time, same size)
|
||||||
|
SCRATCH_DIR "data/g" // added
|
||||||
|
};
|
||||||
|
|
||||||
|
char const* keys_after[] = {
|
||||||
"data/a", // added
|
"data/a", // added
|
||||||
"data/b", // same
|
"data/b", // same
|
||||||
"data/c", // different mod time
|
"data/c", // different mod time
|
||||||
@ -1064,8 +1097,7 @@ backup_helper_test_files()
|
|||||||
{
|
{
|
||||||
BackupDataWriter dataStream(dataStreamFD);
|
BackupDataWriter dataStream(dataStreamFD);
|
||||||
|
|
||||||
err = back_up_files(oldSnapshotFD, &dataStream, newSnapshotFD, SCRATCH_DIR,
|
err = back_up_files(oldSnapshotFD, &dataStream, newSnapshotFD, files_after, keys_after, 6);
|
||||||
files_after, 6);
|
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -1078,6 +1110,109 @@ backup_helper_test_files()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
backup_helper_test_null_base()
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
int oldSnapshotFD;
|
||||||
|
int dataStreamFD;
|
||||||
|
int newSnapshotFD;
|
||||||
|
|
||||||
|
system("rm -r " SCRATCH_DIR);
|
||||||
|
mkdir(SCRATCH_DIR, 0777);
|
||||||
|
mkdir(SCRATCH_DIR "data", 0777);
|
||||||
|
|
||||||
|
write_text_file(SCRATCH_DIR "data/a", "a\naa\n");
|
||||||
|
|
||||||
|
char const* files[] = {
|
||||||
|
SCRATCH_DIR "data/a",
|
||||||
|
};
|
||||||
|
|
||||||
|
char const* keys[] = {
|
||||||
|
"a",
|
||||||
|
};
|
||||||
|
|
||||||
|
dataStreamFD = creat(SCRATCH_DIR "null_base.data", 0666);
|
||||||
|
if (dataStreamFD == -1) {
|
||||||
|
fprintf(stderr, "error creating: %s\n", strerror(errno));
|
||||||
|
return errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
newSnapshotFD = creat(SCRATCH_DIR "null_base.snap", 0666);
|
||||||
|
if (newSnapshotFD == -1) {
|
||||||
|
fprintf(stderr, "error creating: %s\n", strerror(errno));
|
||||||
|
return errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
BackupDataWriter dataStream(dataStreamFD);
|
||||||
|
|
||||||
|
err = back_up_files(-1, &dataStream, newSnapshotFD, files, keys, 1);
|
||||||
|
if (err != 0) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close(dataStreamFD);
|
||||||
|
close(newSnapshotFD);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
backup_helper_test_missing_file()
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
int oldSnapshotFD;
|
||||||
|
int dataStreamFD;
|
||||||
|
int newSnapshotFD;
|
||||||
|
|
||||||
|
system("rm -r " SCRATCH_DIR);
|
||||||
|
mkdir(SCRATCH_DIR, 0777);
|
||||||
|
mkdir(SCRATCH_DIR "data", 0777);
|
||||||
|
|
||||||
|
write_text_file(SCRATCH_DIR "data/b", "b\nbb\n");
|
||||||
|
|
||||||
|
char const* files[] = {
|
||||||
|
SCRATCH_DIR "data/a",
|
||||||
|
SCRATCH_DIR "data/b",
|
||||||
|
SCRATCH_DIR "data/c",
|
||||||
|
};
|
||||||
|
|
||||||
|
char const* keys[] = {
|
||||||
|
"a",
|
||||||
|
"b",
|
||||||
|
"c",
|
||||||
|
};
|
||||||
|
|
||||||
|
dataStreamFD = creat(SCRATCH_DIR "null_base.data", 0666);
|
||||||
|
if (dataStreamFD == -1) {
|
||||||
|
fprintf(stderr, "error creating: %s\n", strerror(errno));
|
||||||
|
return errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
newSnapshotFD = creat(SCRATCH_DIR "null_base.snap", 0666);
|
||||||
|
if (newSnapshotFD == -1) {
|
||||||
|
fprintf(stderr, "error creating: %s\n", strerror(errno));
|
||||||
|
return errno;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
BackupDataWriter dataStream(dataStreamFD);
|
||||||
|
|
||||||
|
err = back_up_files(-1, &dataStream, newSnapshotFD, files, keys, 1);
|
||||||
|
if (err != 0) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
close(dataStreamFD);
|
||||||
|
close(newSnapshotFD);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif // TEST_BACKUP_HELPERS
|
#endif // TEST_BACKUP_HELPERS
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -104,6 +104,11 @@ public class MockContext extends Context {
|
|||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public File getSharedPrefsFile(String name) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPackageCodePath() {
|
public String getPackageCodePath() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
|
@ -38,6 +38,8 @@ Test TESTS[] = {
|
|||||||
{ "backup_helper_test_empty", backup_helper_test_empty, 0, false },
|
{ "backup_helper_test_empty", backup_helper_test_empty, 0, false },
|
||||||
{ "backup_helper_test_four", backup_helper_test_four, 0, false },
|
{ "backup_helper_test_four", backup_helper_test_four, 0, false },
|
||||||
{ "backup_helper_test_files", backup_helper_test_files, 0, false },
|
{ "backup_helper_test_files", backup_helper_test_files, 0, false },
|
||||||
|
{ "backup_helper_test_null_base", backup_helper_test_null_base, 0, false },
|
||||||
|
{ "backup_helper_test_missing_file", backup_helper_test_missing_file, 0, false },
|
||||||
{ "backup_helper_test_data_writer", backup_helper_test_data_writer, 0, false },
|
{ "backup_helper_test_data_writer", backup_helper_test_data_writer, 0, false },
|
||||||
{ "backup_helper_test_data_reader", backup_helper_test_data_reader, 0, false },
|
{ "backup_helper_test_data_reader", backup_helper_test_data_reader, 0, false },
|
||||||
{ 0, NULL, 0, false}
|
{ 0, NULL, 0, false}
|
||||||
|
@ -965,6 +965,12 @@ public final class BridgeContext extends Context {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public File getSharedPrefsFile(String name) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences getSharedPreferences(String arg0, int arg1) {
|
public SharedPreferences getSharedPreferences(String arg0, int arg1) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
|
Reference in New Issue
Block a user