summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/backup
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-05-03 10:27:13 -0700
committerEric Erfanian <erfanian@google.com>2017-05-03 12:01:21 -0700
commit8369df095a73a77b3715f8ae7ba06089cebca4ce (patch)
tree1a45d60921e293c6088efeaf4d9c408456f3e0e2 /java/com/android/dialer/backup
parentafa29d4a8659eeffc8d92a6216b154f594eeb895 (diff)
This change reflects the Dialer V10 RC00 branch.
RC00 is based on: branch: dialer-android_release_branch/153304843.1 synced to: 153304843 following the instructions at go/dialer-aosp-release. In this release: * Removes final apache sources. * Uses native lite compilation. More drops will follow with subsequent release candidates until we reach our final v10 release, in cadence with our prebuilt drops. Test: TreeHugger, on device Change-Id: Ic9684057230f9b579c777820c746cd21bf45ec0f
Diffstat (limited to 'java/com/android/dialer/backup')
-rw-r--r--java/com/android/dialer/backup/DialerBackupAgent.java5
-rw-r--r--java/com/android/dialer/backup/DialerBackupUtils.java111
-rw-r--r--java/com/android/dialer/backup/nano/VoicemailInfo.java399
-rw-r--r--java/com/android/dialer/backup/proto/voicemail_info.proto30
4 files changed, 87 insertions, 458 deletions
diff --git a/java/com/android/dialer/backup/DialerBackupAgent.java b/java/com/android/dialer/backup/DialerBackupAgent.java
index 0841e82e7..27dfc29f4 100644
--- a/java/com/android/dialer/backup/DialerBackupAgent.java
+++ b/java/com/android/dialer/backup/DialerBackupAgent.java
@@ -33,12 +33,11 @@ import android.provider.VoicemailContract;
import android.provider.VoicemailContract.Voicemails;
import android.telecom.PhoneAccountHandle;
import android.util.Pair;
-import com.android.dialer.backup.nano.VoicemailInfo;
import com.android.dialer.common.Assert;
import com.android.dialer.common.ConfigProviderBindings;
import com.android.dialer.common.LogUtil;
+import com.android.dialer.logging.DialerImpression;
import com.android.dialer.logging.Logger;
-import com.android.dialer.logging.nano.DialerImpression;
import com.android.dialer.telecom.TelecomUtil;
import java.io.File;
import java.io.IOException;
@@ -59,7 +58,7 @@ public class DialerBackupAgent extends BackupAgent {
// Voicemail Uri Column
public static final String VOICEMAIL_URI = "voicemail_uri";
// Voicemail packages to backup
- public static final String VOICEMAIL_SOURCE_PACKAGE = "com.android.phone";
+ public static final String VOICEMAIL_SOURCE_PACKAGE = "com.google.android.dialer";
private long voicemailsBackedupSoFar = 0;
private long sizeOfVoicemailsBackedupSoFar = 0;
diff --git a/java/com/android/dialer/backup/DialerBackupUtils.java b/java/com/android/dialer/backup/DialerBackupUtils.java
index 410772ff0..17e82e45d 100644
--- a/java/com/android/dialer/backup/DialerBackupUtils.java
+++ b/java/com/android/dialer/backup/DialerBackupUtils.java
@@ -30,16 +30,14 @@ import android.support.annotation.Nullable;
import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.util.Pair;
-import com.android.dialer.backup.nano.VoicemailInfo;
import com.android.dialer.common.Assert;
import com.android.dialer.common.ConfigProviderBindings;
import com.android.dialer.common.LogUtil;
import com.android.voicemail.VoicemailComponent;
import com.google.common.io.ByteStreams;
import com.google.common.io.Files;
-import com.google.protobuf.nano.MessageNano;
+import com.google.protobuf.ByteString;
import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -66,15 +64,14 @@ public class DialerBackupUtils {
ByteStreams.copy(decodedStream, restoreStream);
}
- public static @Nullable byte[] audioStreamToByteArray(@NonNull InputStream stream)
+ public static @Nullable ByteString audioStreamToByteString(@NonNull InputStream stream)
throws IOException {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
if (stream.available() > 0) {
- ByteStreams.copy(stream, buffer);
+ return ByteString.readFrom(stream);
} else {
LogUtil.i("DialerBackupUtils.audioStreamToByteArray", "no audio stream to backup");
}
- return buffer.toByteArray();
+ return ByteString.EMPTY;
}
public static void writeProtoToFile(@NonNull File file, @NonNull VoicemailInfo voicemailInfo)
@@ -83,7 +80,7 @@ public class DialerBackupUtils {
"DialerBackupUtils.writeProtoToFile",
"backup " + voicemailInfo + " to " + file.getAbsolutePath());
- byte[] bytes = MessageNano.toByteArray(voicemailInfo);
+ byte[] bytes = voicemailInfo.toByteArray();
Files.write(bytes, file);
}
@@ -111,7 +108,7 @@ public class DialerBackupUtils {
public static VoicemailInfo convertVoicemailCursorRowToProto(
@NonNull Cursor cursor, @NonNull ContentResolver contentResolver) throws IOException {
- VoicemailInfo voicemailInfo = new VoicemailInfo();
+ VoicemailInfo.Builder voicemailInfo = VoicemailInfo.newBuilder();
for (int i = 0; i < cursor.getColumnCount(); ++i) {
String name = cursor.getColumnName(i);
@@ -126,56 +123,56 @@ public class DialerBackupUtils {
switch (name) {
case Voicemails.DATE:
- voicemailInfo.date = value;
+ voicemailInfo.setDate(value);
break;
case Voicemails.DELETED:
- voicemailInfo.deleted = value;
+ voicemailInfo.setDeleted(value);
break;
case Voicemails.DIRTY:
- voicemailInfo.dirty = value;
+ voicemailInfo.setDirty(value);
break;
case Voicemails.DIR_TYPE:
- voicemailInfo.dirType = value;
+ voicemailInfo.setDirType(value);
break;
case Voicemails.DURATION:
- voicemailInfo.duration = value;
+ voicemailInfo.setDuration(value);
break;
case Voicemails.HAS_CONTENT:
- voicemailInfo.hasContent = value;
+ voicemailInfo.setHasContent(value);
break;
case Voicemails.IS_READ:
- voicemailInfo.isRead = value;
+ voicemailInfo.setIsRead(value);
break;
case Voicemails.ITEM_TYPE:
- voicemailInfo.itemType = value;
+ voicemailInfo.setItemType(value);
break;
case Voicemails.LAST_MODIFIED:
- voicemailInfo.lastModified = value;
+ voicemailInfo.setLastModified(value);
break;
case Voicemails.MIME_TYPE:
- voicemailInfo.mimeType = value;
+ voicemailInfo.setMimeType(value);
break;
case Voicemails.NUMBER:
- voicemailInfo.number = value;
+ voicemailInfo.setNumber(value);
break;
case Voicemails.PHONE_ACCOUNT_COMPONENT_NAME:
- voicemailInfo.phoneAccountComponentName = value;
+ voicemailInfo.setPhoneAccountComponentName(value);
break;
case Voicemails.PHONE_ACCOUNT_ID:
- voicemailInfo.phoneAccountId = value;
+ voicemailInfo.setPhoneAccountId(value);
break;
case Voicemails.SOURCE_DATA:
- voicemailInfo.sourceData = value;
+ voicemailInfo.setSourceData(value);
break;
case Voicemails.SOURCE_PACKAGE:
- voicemailInfo.sourcePackage = value;
+ voicemailInfo.setSourcePackage(value);
break;
case Voicemails.TRANSCRIPTION:
- voicemailInfo.transcription = value;
+ voicemailInfo.setTranscription(value);
break;
case DialerBackupAgent.VOICEMAIL_URI:
try (InputStream audioStream = contentResolver.openInputStream(Uri.parse(value))) {
- voicemailInfo.encodedVoicemailKey = audioStreamToByteArray(audioStream);
+ voicemailInfo.setEncodedVoicemailKey(audioStreamToByteString(audioStream));
}
break;
default:
@@ -187,7 +184,7 @@ public class DialerBackupUtils {
break;
}
}
- return voicemailInfo;
+ return voicemailInfo.build();
}
public static Pair<ContentValues, byte[]> convertVoicemailProtoFileToContentValueAndAudioBytes(
@@ -209,45 +206,45 @@ public class DialerBackupUtils {
} else {
ContentValues contentValues = new ContentValues();
- if (!voicemailInfo.date.isEmpty()) {
- contentValues.put(Voicemails.DATE, voicemailInfo.date);
+ if (voicemailInfo.hasDate()) {
+ contentValues.put(Voicemails.DATE, voicemailInfo.getDate());
}
- if (!voicemailInfo.deleted.isEmpty()) {
- contentValues.put(Voicemails.DELETED, voicemailInfo.deleted);
+ if (voicemailInfo.hasDeleted()) {
+ contentValues.put(Voicemails.DELETED, voicemailInfo.getDeleted());
}
- if (!voicemailInfo.dirty.isEmpty()) {
- contentValues.put(Voicemails.DIRTY, voicemailInfo.dirty);
+ if (!voicemailInfo.hasDirty()) {
+ contentValues.put(Voicemails.DIRTY, voicemailInfo.getDirty());
}
- if (!voicemailInfo.duration.isEmpty()) {
- contentValues.put(Voicemails.DURATION, voicemailInfo.duration);
+ if (!voicemailInfo.hasDuration()) {
+ contentValues.put(Voicemails.DURATION, voicemailInfo.getDuration());
}
- if (!voicemailInfo.isRead.isEmpty()) {
- contentValues.put(Voicemails.IS_READ, voicemailInfo.isRead);
+ if (!voicemailInfo.hasIsRead()) {
+ contentValues.put(Voicemails.IS_READ, voicemailInfo.getIsRead());
}
- if (!voicemailInfo.lastModified.isEmpty()) {
- contentValues.put(Voicemails.LAST_MODIFIED, voicemailInfo.lastModified);
+ if (!voicemailInfo.hasLastModified()) {
+ contentValues.put(Voicemails.LAST_MODIFIED, voicemailInfo.getLastModified());
}
- if (!voicemailInfo.mimeType.isEmpty()) {
- contentValues.put(Voicemails.MIME_TYPE, voicemailInfo.mimeType);
+ if (!voicemailInfo.hasMimeType()) {
+ contentValues.put(Voicemails.MIME_TYPE, voicemailInfo.getMimeType());
}
- if (!voicemailInfo.number.isEmpty()) {
- contentValues.put(Voicemails.NUMBER, voicemailInfo.number);
+ if (!voicemailInfo.hasNumber()) {
+ contentValues.put(Voicemails.NUMBER, voicemailInfo.getNumber());
}
- if (!voicemailInfo.phoneAccountComponentName.isEmpty()) {
+ if (!voicemailInfo.hasPhoneAccountComponentName()) {
contentValues.put(
- Voicemails.PHONE_ACCOUNT_COMPONENT_NAME, voicemailInfo.phoneAccountComponentName);
+ Voicemails.PHONE_ACCOUNT_COMPONENT_NAME, voicemailInfo.getPhoneAccountComponentName());
}
- if (!voicemailInfo.phoneAccountId.isEmpty()) {
- contentValues.put(Voicemails.PHONE_ACCOUNT_ID, voicemailInfo.phoneAccountId);
+ if (!voicemailInfo.hasPhoneAccountId()) {
+ contentValues.put(Voicemails.PHONE_ACCOUNT_ID, voicemailInfo.getPhoneAccountId());
}
- if (!voicemailInfo.sourceData.isEmpty()) {
- contentValues.put(Voicemails.SOURCE_DATA, voicemailInfo.sourceData);
+ if (!voicemailInfo.hasSourceData()) {
+ contentValues.put(Voicemails.SOURCE_DATA, voicemailInfo.getSourceData());
}
- if (!voicemailInfo.sourcePackage.isEmpty()) {
- contentValues.put(Voicemails.SOURCE_PACKAGE, voicemailInfo.sourcePackage);
+ if (!voicemailInfo.hasSourcePackage()) {
+ contentValues.put(Voicemails.SOURCE_PACKAGE, voicemailInfo.getSourcePackage());
}
- if (!voicemailInfo.transcription.isEmpty()) {
- contentValues.put(Voicemails.TRANSCRIPTION, voicemailInfo.transcription);
+ if (!voicemailInfo.hasTranscription()) {
+ contentValues.put(Voicemails.TRANSCRIPTION, voicemailInfo.getTranscription());
}
contentValues.put(VoicemailContract.Voicemails.HAS_CONTENT, 1);
contentValues.put(RESTORED_COLUMN, "1");
@@ -257,7 +254,7 @@ public class DialerBackupUtils {
"DialerBackupUtils.convertVoicemailProtoFileToContentValueAndEncodedAudio",
"cv: " + contentValues);
- return Pair.create(contentValues, voicemailInfo.encodedVoicemailKey);
+ return Pair.create(contentValues, voicemailInfo.getEncodedVoicemailKey().toByteArray());
}
}
@@ -276,7 +273,7 @@ public class DialerBackupUtils {
}
if (ConfigProviderBindings.get(context)
.getBoolean("voicemail_restore_check_archive_for_source_package", true)) {
- if ("1".equals(voicemailInfo.archived)) {
+ if ("1".equals(voicemailInfo.getArchived())) {
LogUtil.i(
"DialerBackupUtils.getSourcePackage",
"voicemail was archived, using app source package");
@@ -312,7 +309,9 @@ public class DialerBackupUtils {
String.format(
"(%s = ? AND %s = ? AND %s = ?)",
Voicemails.NUMBER, Voicemails.DATE, Voicemails.DURATION),
- new String[] {voicemailInfo.number, voicemailInfo.date, voicemailInfo.duration},
+ new String[] {
+ voicemailInfo.getNumber(), voicemailInfo.getDate(), voicemailInfo.getDuration()
+ },
null,
null)) {
if (cursor.moveToFirst()
diff --git a/java/com/android/dialer/backup/nano/VoicemailInfo.java b/java/com/android/dialer/backup/nano/VoicemailInfo.java
deleted file mode 100644
index f11595ec2..000000000
--- a/java/com/android/dialer/backup/nano/VoicemailInfo.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * Copyright (C) 2017 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Generated by the protocol buffer compiler. DO NOT EDIT!
-
-package com.android.dialer.backup.nano;
-
-/** This file is autogenerated, but javadoc required. */
-@SuppressWarnings("hiding")
-public final class VoicemailInfo
- extends com.google.protobuf.nano.ExtendableMessageNano<VoicemailInfo> {
-
- private static volatile VoicemailInfo[] _emptyArray;
-
- public static VoicemailInfo[] emptyArray() {
- // Lazily initializes the empty array
- if (_emptyArray == null) {
- synchronized (com.google.protobuf.nano.InternalNano.LAZY_INIT_LOCK) {
- if (_emptyArray == null) {
- _emptyArray = new VoicemailInfo[0];
- }
- }
- }
- return _emptyArray;
- }
-
- // optional string date = 1;
- public java.lang.String date;
-
- // optional string deleted = 2;
- public java.lang.String deleted;
-
- // optional string dirty = 3;
- public java.lang.String dirty;
-
- // optional string dir_type = 4;
- public java.lang.String dirType;
-
- // optional string duration = 5;
- public java.lang.String duration;
-
- // optional string has_content = 6;
- public java.lang.String hasContent;
-
- // optional string is_read = 7;
- public java.lang.String isRead;
-
- // optional string item_type = 8;
- public java.lang.String itemType;
-
- // optional string last_modified = 9;
- public java.lang.String lastModified;
-
- // optional string mime_type = 10;
- public java.lang.String mimeType;
-
- // optional string number = 11;
- public java.lang.String number;
-
- // optional string phone_account_component_name = 12;
- public java.lang.String phoneAccountComponentName;
-
- // optional string phone_account_id = 13;
- public java.lang.String phoneAccountId;
-
- // optional string source_data = 14;
- public java.lang.String sourceData;
-
- // optional string source_package = 15;
- public java.lang.String sourcePackage;
-
- // optional string transcription = 16;
- public java.lang.String transcription;
-
- // optional string voicemail_uri = 17;
- public java.lang.String voicemailUri;
-
- // optional bytes encoded_voicemail_key = 18;
- public byte[] encodedVoicemailKey;
-
- // optional string archived = 19;
- public java.lang.String archived;
-
- // @@protoc_insertion_point(class_scope:com.android.dialer.backup.VoicemailInfo)
-
- public VoicemailInfo() {
- clear();
- }
-
- public VoicemailInfo clear() {
- date = "";
- deleted = "";
- dirty = "";
- dirType = "";
- duration = "";
- hasContent = "";
- isRead = "";
- itemType = "";
- lastModified = "";
- mimeType = "";
- number = "";
- phoneAccountComponentName = "";
- phoneAccountId = "";
- sourceData = "";
- sourcePackage = "";
- transcription = "";
- voicemailUri = "";
- encodedVoicemailKey = com.google.protobuf.nano.WireFormatNano.EMPTY_BYTES;
- archived = "";
- unknownFieldData = null;
- cachedSize = -1;
- return this;
- }
-
- @Override
- public void writeTo(com.google.protobuf.nano.CodedOutputByteBufferNano output)
- throws java.io.IOException {
- if (this.date != null && !this.date.equals("")) {
- output.writeString(1, this.date);
- }
- if (this.deleted != null && !this.deleted.equals("")) {
- output.writeString(2, this.deleted);
- }
- if (this.dirty != null && !this.dirty.equals("")) {
- output.writeString(3, this.dirty);
- }
- if (this.dirType != null && !this.dirType.equals("")) {
- output.writeString(4, this.dirType);
- }
- if (this.duration != null && !this.duration.equals("")) {
- output.writeString(5, this.duration);
- }
- if (this.hasContent != null && !this.hasContent.equals("")) {
- output.writeString(6, this.hasContent);
- }
- if (this.isRead != null && !this.isRead.equals("")) {
- output.writeString(7, this.isRead);
- }
- if (this.itemType != null && !this.itemType.equals("")) {
- output.writeString(8, this.itemType);
- }
- if (this.lastModified != null && !this.lastModified.equals("")) {
- output.writeString(9, this.lastModified);
- }
- if (this.mimeType != null && !this.mimeType.equals("")) {
- output.writeString(10, this.mimeType);
- }
- if (this.number != null && !this.number.equals("")) {
- output.writeString(11, this.number);
- }
- if (this.phoneAccountComponentName != null && !this.phoneAccountComponentName.equals("")) {
- output.writeString(12, this.phoneAccountComponentName);
- }
- if (this.phoneAccountId != null && !this.phoneAccountId.equals("")) {
- output.writeString(13, this.phoneAccountId);
- }
- if (this.sourceData != null && !this.sourceData.equals("")) {
- output.writeString(14, this.sourceData);
- }
- if (this.sourcePackage != null && !this.sourcePackage.equals("")) {
- output.writeString(15, this.sourcePackage);
- }
- if (this.transcription != null && !this.transcription.equals("")) {
- output.writeString(16, this.transcription);
- }
- if (this.voicemailUri != null && !this.voicemailUri.equals("")) {
- output.writeString(17, this.voicemailUri);
- }
- if (!java.util.Arrays.equals(
- this.encodedVoicemailKey, com.google.protobuf.nano.WireFormatNano.EMPTY_BYTES)) {
- output.writeBytes(18, this.encodedVoicemailKey);
- }
- if (this.archived != null && !this.archived.equals("")) {
- output.writeString(19, this.archived);
- }
- super.writeTo(output);
- }
-
- @Override
- protected int computeSerializedSize() {
- int size = super.computeSerializedSize();
- if (this.date != null && !this.date.equals("")) {
- size += com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(1, this.date);
- }
- if (this.deleted != null && !this.deleted.equals("")) {
- size += com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(2, this.deleted);
- }
- if (this.dirty != null && !this.dirty.equals("")) {
- size += com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(3, this.dirty);
- }
- if (this.dirType != null && !this.dirType.equals("")) {
- size += com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(4, this.dirType);
- }
- if (this.duration != null && !this.duration.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(5, this.duration);
- }
- if (this.hasContent != null && !this.hasContent.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(6, this.hasContent);
- }
- if (this.isRead != null && !this.isRead.equals("")) {
- size += com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(7, this.isRead);
- }
- if (this.itemType != null && !this.itemType.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(8, this.itemType);
- }
- if (this.lastModified != null && !this.lastModified.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(
- 9, this.lastModified);
- }
- if (this.mimeType != null && !this.mimeType.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(10, this.mimeType);
- }
- if (this.number != null && !this.number.equals("")) {
- size += com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(11, this.number);
- }
- if (this.phoneAccountComponentName != null && !this.phoneAccountComponentName.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(
- 12, this.phoneAccountComponentName);
- }
- if (this.phoneAccountId != null && !this.phoneAccountId.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(
- 13, this.phoneAccountId);
- }
- if (this.sourceData != null && !this.sourceData.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(14, this.sourceData);
- }
- if (this.sourcePackage != null && !this.sourcePackage.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(
- 15, this.sourcePackage);
- }
- if (this.transcription != null && !this.transcription.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(
- 16, this.transcription);
- }
- if (this.voicemailUri != null && !this.voicemailUri.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(
- 17, this.voicemailUri);
- }
- if (!java.util.Arrays.equals(
- this.encodedVoicemailKey, com.google.protobuf.nano.WireFormatNano.EMPTY_BYTES)) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeBytesSize(
- 18, this.encodedVoicemailKey);
- }
- if (this.archived != null && !this.archived.equals("")) {
- size +=
- com.google.protobuf.nano.CodedOutputByteBufferNano.computeStringSize(19, this.archived);
- }
- return size;
- }
-
- @Override
- public VoicemailInfo mergeFrom(com.google.protobuf.nano.CodedInputByteBufferNano input)
- throws java.io.IOException {
- while (true) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- return this;
- default:
- {
- if (!super.storeUnknownField(input, tag)) {
- return this;
- }
- break;
- }
- case 10:
- {
- this.date = input.readString();
- break;
- }
- case 18:
- {
- this.deleted = input.readString();
- break;
- }
- case 26:
- {
- this.dirty = input.readString();
- break;
- }
- case 34:
- {
- this.dirType = input.readString();
- break;
- }
- case 42:
- {
- this.duration = input.readString();
- break;
- }
- case 50:
- {
- this.hasContent = input.readString();
- break;
- }
- case 58:
- {
- this.isRead = input.readString();
- break;
- }
- case 66:
- {
- this.itemType = input.readString();
- break;
- }
- case 74:
- {
- this.lastModified = input.readString();
- break;
- }
- case 82:
- {
- this.mimeType = input.readString();
- break;
- }
- case 90:
- {
- this.number = input.readString();
- break;
- }
- case 98:
- {
- this.phoneAccountComponentName = input.readString();
- break;
- }
- case 106:
- {
- this.phoneAccountId = input.readString();
- break;
- }
- case 114:
- {
- this.sourceData = input.readString();
- break;
- }
- case 122:
- {
- this.sourcePackage = input.readString();
- break;
- }
- case 130:
- {
- this.transcription = input.readString();
- break;
- }
- case 138:
- {
- this.voicemailUri = input.readString();
- break;
- }
- case 146:
- {
- this.encodedVoicemailKey = input.readBytes();
- break;
- }
- case 154:
- {
- this.archived = input.readString();
- break;
- }
- }
- }
- }
-
- public static VoicemailInfo parseFrom(byte[] data)
- throws com.google.protobuf.nano.InvalidProtocolBufferNanoException {
- return com.google.protobuf.nano.MessageNano.mergeFrom(new VoicemailInfo(), data);
- }
-
- public static VoicemailInfo parseFrom(com.google.protobuf.nano.CodedInputByteBufferNano input)
- throws java.io.IOException {
- return new VoicemailInfo().mergeFrom(input);
- }
-}
diff --git a/java/com/android/dialer/backup/proto/voicemail_info.proto b/java/com/android/dialer/backup/proto/voicemail_info.proto
new file mode 100644
index 000000000..b74cce954
--- /dev/null
+++ b/java/com/android/dialer/backup/proto/voicemail_info.proto
@@ -0,0 +1,30 @@
+syntax = "proto2";
+
+option java_package = "com.android.dialer.backup";
+option java_multiple_files = true;
+option optimize_for = LITE_RUNTIME;
+
+package com.android.dialer.backup;
+
+// Next id: 20
+message VoicemailInfo {
+ optional string date = 1;
+ optional string deleted = 2;
+ optional string dirty = 3;
+ optional string dir_type = 4;
+ optional string duration = 5;
+ optional string has_content = 6;
+ optional string is_read = 7;
+ optional string item_type = 8;
+ optional string last_modified = 9;
+ optional string mime_type = 10;
+ optional string number = 11;
+ optional string phone_account_component_name = 12;
+ optional string phone_account_id = 13;
+ optional string source_data = 14;
+ optional string source_package = 15;
+ optional string transcription = 16;
+ optional string voicemail_uri = 17;
+ optional bytes encoded_voicemail_key = 18;
+ optional string archived = 19;
+}