summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2018-02-02 14:16:20 -0800
committerCopybara-Service <copybara-piper@google.com>2018-02-02 15:53:35 -0800
commit668b99f9d6eca8f6d53432cc9ceddc914be7cfb3 (patch)
tree9460ddcf009afb0b4a9b9c65119cf1388d289493 /java
parent056c1911137caad554cdfebb5a0b4a03e3df8c53 (diff)
Add assert check for INVALID NUMBERS in NUI Voicemail
We do not expect any invalid numbers for the voicemail tab. We crash the app if an invalid number is detected in the NUI VM tab, so that we can handle invalid numbers for voicemail accordingly. Bug: 72863479 Test: N/A PiperOrigin-RevId: 184333020 Change-Id: Ifd769da08c7cba3aab555b56eef799de47810fb3
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/voicemail/listui/VoicemailCursorLoader.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/com/android/dialer/voicemail/listui/VoicemailCursorLoader.java b/java/com/android/dialer/voicemail/listui/VoicemailCursorLoader.java
index 7e0381871..74d1b6162 100644
--- a/java/com/android/dialer/voicemail/listui/VoicemailCursorLoader.java
+++ b/java/com/android/dialer/voicemail/listui/VoicemailCursorLoader.java
@@ -23,6 +23,8 @@ import android.support.v4.content.CursorLoader;
import com.android.dialer.DialerPhoneNumber;
import com.android.dialer.NumberAttributes;
import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog;
+import com.android.dialer.common.Assert;
+import com.android.dialer.common.LogUtil;
import com.android.dialer.voicemail.model.VoicemailEntry;
import com.google.protobuf.InvalidProtocolBufferException;
@@ -84,6 +86,13 @@ final class VoicemailCursorLoader extends CursorLoader {
throw new IllegalStateException("Couldn't parse NumberAttributes bytes");
}
+ // Voicemail numbers should always be valid so the CP2 information should never be incomplete,
+ // and there should be no need to query PhoneLookup at render time.
+ Assert.checkArgument(
+ !numberAttributes.getIsCp2InfoIncomplete(),
+ "CP2 info incomplete for number: %s",
+ LogUtil.sanitizePii(number.getNormalizedNumber()));
+
return VoicemailEntry.builder()
.setId(cursor.getInt(ID))
.setTimestamp(cursor.getLong(TIMESTAMP))