From d5e47f6da5b08b13ecdfa7f1edc7e12aeb83fab9 Mon Sep 17 00:00:00 2001 From: Eric Erfanian Date: Wed, 15 Mar 2017 14:41:07 -0700 Subject: Update Dialer source from latest green build. * Refactor voicemail component * Add new enriched calling components Test: treehugger, manual aosp testing Change-Id: I521a0f86327d4b42e14d93927c7d613044ed5942 --- java/com/android/dialer/backup/AndroidManifest.xml | 3 +- .../android/dialer/backup/DialerBackupAgent.java | 18 +- .../android/dialer/backup/DialerBackupUtils.java | 44 +++ .../android/dialer/backup/nano/VoicemailInfo.java | 399 +++++++++++++++++++++ .../android/dialer/backup/proto/VoicemailInfo.java | 377 ------------------- 5 files changed, 457 insertions(+), 384 deletions(-) create mode 100644 java/com/android/dialer/backup/nano/VoicemailInfo.java delete mode 100644 java/com/android/dialer/backup/proto/VoicemailInfo.java (limited to 'java/com/android/dialer/backup') diff --git a/java/com/android/dialer/backup/AndroidManifest.xml b/java/com/android/dialer/backup/AndroidManifest.xml index cfdb3d93d..1cbbe5339 100644 --- a/java/com/android/dialer/backup/AndroidManifest.xml +++ b/java/com/android/dialer/backup/AndroidManifest.xml @@ -21,7 +21,6 @@ android:backupAgent="com.android.dialer.backup.DialerBackupAgent" android:fullBackupOnly="true" android:restoreAnyVersion="true" - android:name="com.android.dialer.app.DialerApplication" /> - \ No newline at end of file + diff --git a/java/com/android/dialer/backup/DialerBackupAgent.java b/java/com/android/dialer/backup/DialerBackupAgent.java index 391a93f29..2f8684aa2 100644 --- a/java/com/android/dialer/backup/DialerBackupAgent.java +++ b/java/com/android/dialer/backup/DialerBackupAgent.java @@ -31,6 +31,7 @@ import android.provider.CallLog; import android.provider.CallLog.Calls; 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; @@ -42,6 +43,7 @@ import com.android.dialer.telecom.TelecomUtil; import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.util.List; import java.util.Locale; /** @@ -100,9 +102,11 @@ public class DialerBackupAgent extends BackupAgent { ConfigProviderBindings.get(this).getBoolean("enable_autobackup", true); boolean vmBackupEnabled = ConfigProviderBindings.get(this).getBoolean("enable_vm_backup", false); + List phoneAccountsToArchive = + DialerBackupUtils.getPhoneAccountsToArchive(this); if (autoBackupEnabled) { - if (!maxVoicemailBackupReached && vmBackupEnabled) { + if (!maxVoicemailBackupReached && vmBackupEnabled && !phoneAccountsToArchive.isEmpty()) { voicemailsBackedupSoFar = 0; sizeOfVoicemailsBackedupSoFar = 0; @@ -123,9 +127,12 @@ public class DialerBackupAgent extends BackupAgent { uri, null, String.format( - "(%s = ? AND deleted = 0 AND %s = ?)", Calls.TYPE, Voicemails.SOURCE_PACKAGE), + "(%s = ? AND deleted = 0 AND %s = ? AND ?)", + Calls.TYPE, Voicemails.SOURCE_PACKAGE), new String[] { - Integer.toString(CallLog.Calls.VOICEMAIL_TYPE), VOICEMAIL_SOURCE_PACKAGE + Integer.toString(CallLog.Calls.VOICEMAIL_TYPE), + VOICEMAIL_SOURCE_PACKAGE, + DialerBackupUtils.getPhoneAccountClause(phoneAccountsToArchive) }, ORDER_BY_DATE, null)) { @@ -150,11 +157,12 @@ public class DialerBackupAgent extends BackupAgent { LogUtil.i( "DialerBackupAgent.onFullBackup", "vm files backed up: %d, vm size backed up:%d, " - + "max vm backup reached:%b, vm backup enabled:%b", + + "max vm backup reached:%b, vm backup enabled:%b phone accounts to archive: %d", voicemailsBackedupSoFar, sizeOfVoicemailsBackedupSoFar, maxVoicemailBackupReached, - vmBackupEnabled); + vmBackupEnabled, + phoneAccountsToArchive.size()); super.onFullBackup(data); Logger.get(this).logImpression(DialerImpression.Type.BACKUP_FULL_BACKED_UP); } else { diff --git a/java/com/android/dialer/backup/DialerBackupUtils.java b/java/com/android/dialer/backup/DialerBackupUtils.java index ff0cb4f7c..410772ff0 100644 --- a/java/com/android/dialer/backup/DialerBackupUtils.java +++ b/java/com/android/dialer/backup/DialerBackupUtils.java @@ -27,10 +27,14 @@ import android.provider.VoicemailContract; import android.provider.VoicemailContract.Voicemails; import android.support.annotation.NonNull; 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; @@ -40,6 +44,8 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.ArrayList; +import java.util.List; /** Helper functions for DialerBackupAgent */ public class DialerBackupUtils { @@ -317,4 +323,42 @@ public class DialerBackupUtils { } return false; } + + public static String getPhoneAccountClause(List phoneAccountsToArchive) { + Assert.checkArgument(!phoneAccountsToArchive.isEmpty()); + StringBuilder whereQuery = new StringBuilder(); + + whereQuery.append("("); + + for (int i = 0; i < phoneAccountsToArchive.size(); i++) { + whereQuery.append( + Voicemails.PHONE_ACCOUNT_ID + " = " + phoneAccountsToArchive.get(i).getId()); + + if (phoneAccountsToArchive.size() > 1 && i < phoneAccountsToArchive.size() - 1) { + whereQuery.append(" OR "); + } + } + whereQuery.append(")"); + return whereQuery.toString(); + } + + public static List getPhoneAccountsToArchive(Context context) { + List phoneAccountsToBackUp = new ArrayList<>(); + + for (PhoneAccountHandle handle : + context.getSystemService(TelecomManager.class).getCallCapablePhoneAccounts()) { + + if (VoicemailComponent.get(context) + .getVoicemailClient() + .isVoicemailArchiveEnabled(context, handle)) { + phoneAccountsToBackUp.add(handle); + LogUtil.i( + "DialerBackupUtils.getPhoneAccountsToArchive", "enabled for: " + handle.toString()); + } else { + LogUtil.i( + "DialerBackupUtils.getPhoneAccountsToArchive", "not enabled for: " + handle.toString()); + } + } + return phoneAccountsToBackUp; + } } diff --git a/java/com/android/dialer/backup/nano/VoicemailInfo.java b/java/com/android/dialer/backup/nano/VoicemailInfo.java new file mode 100644 index 000000000..f11595ec2 --- /dev/null +++ b/java/com/android/dialer/backup/nano/VoicemailInfo.java @@ -0,0 +1,399 @@ +/* + * 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 { + + 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/VoicemailInfo.java b/java/com/android/dialer/backup/proto/VoicemailInfo.java deleted file mode 100644 index 9ff8423f3..000000000 --- a/java/com/android/dialer/backup/proto/VoicemailInfo.java +++ /dev/null @@ -1,377 +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; - -@SuppressWarnings("hiding") -public final class VoicemailInfo extends - com.google.protobuf.nano.ExtendableMessageNano { - - 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); - } -} -- cgit v1.2.3