Home | History | Annotate | Download | only in launcher3

Lines Matching defs:journal

48 import com.android.launcher3.backup.nano.BackupProtos.Journal;
84 // Journal key is such that it is always smaller than any dynamically generated
186 private void applyJournal(Journal journal) {
187 mLastBackupRestoreTime = journal.t;
189 if (journal.key != null) {
190 for (Key key : journal.key) {
194 restoredBackupVersion = journal.backupVersion;
200 * <P>The journal is a timestamp and a list of keys that were saved as of that time.
213 Journal in = readJournal(oldState);
269 // We store the journal at two places.
272 Journal state = getCurrentStateJournal();
288 private boolean isBackupCompatible(Journal oldState) {
333 * It assumes that the keys will arrive in lexical order. So if the journal was present in the
362 if (VERBOSE) Log.v(TAG, "Journal entry restored");
364 // We received the journal key after a restore key.
370 Journal journal = new Journal();
371 MessageNano.mergeFrom(journal, readCheckedBytes(mBuffer, dataSize));
372 applyJournal(journal);
373 restoreSuccessful = isBackupCompatible(journal);
420 private Journal getCurrentStateJournal() {
421 Journal journal = new Journal();
422 journal.t = mLastBackupRestoreTime;
423 journal.key = mKeys.toArray(new BackupProtos.Key[mKeys.size()]);
424 journal.appVersion = getAppVersion();
425 journal.backupVersion = BACKUP_VERSION;
426 journal.profile = mDeviceProfileData;
427 return journal;
1043 * Read the old journal from the input file.
1045 * In the event of any error, just pretend we didn't have a journal,
1048 * @param oldState the read-0only file descriptor pointing to the old journal
1049 * @return a Journal protocol buffer
1051 private Journal readJournal(ParcelFileDescriptor oldState) {
1052 Journal journal = new Journal();
1054 return journal;
1076 Log.w(TAG, "unexpected end of file while reading journal.");
1085 // check the buffer to see if we have a valid journal
1087 MessageNano.mergeFrom(journal, readCheckedBytes(buffer, bytesRead));
1088 // if we are here, then we have read a valid, checksum-verified journal
1091 if (VERBOSE) Log.v(TAG, "read " + bytesRead + " bytes of journal");
1093 // if we don't have the whole journal yet, mergeFrom will throw. keep going.
1095 journal.clear();
1098 if (DEBUG) Log.d(TAG, "journal bytes read: " + bytesRead);
1100 Log.w(TAG, "could not find a valid journal", lastProtoException);
1104 Log.w(TAG, "failed to close the journal", e);
1106 return journal;
1124 * Write the new journal to the output file.
1126 * In the event of any error, just pretend we didn't have a journal,
1129 * @param newState the write-only file descriptor pointing to the new journal
1130 * @param journal a Journal protocol buffer
1132 private void writeJournal(ParcelFileDescriptor newState, Journal journal) {
1135 final byte[] journalBytes = writeCheckedBytes(journal);
1137 if (VERBOSE) Log.v(TAG, "wrote " + journalBytes.length + " bytes of journal");
1139 Log.w(TAG, "failed to write backup journal", e);