diff options
Diffstat (limited to 'java/com/android/voicemail/impl/utils/VoicemailDatabaseUtil.java')
-rw-r--r-- | java/com/android/voicemail/impl/utils/VoicemailDatabaseUtil.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/java/com/android/voicemail/impl/utils/VoicemailDatabaseUtil.java b/java/com/android/voicemail/impl/utils/VoicemailDatabaseUtil.java index 711d6a8a4..ef5447d32 100644 --- a/java/com/android/voicemail/impl/utils/VoicemailDatabaseUtil.java +++ b/java/com/android/voicemail/impl/utils/VoicemailDatabaseUtil.java @@ -57,6 +57,16 @@ public class VoicemailDatabaseUtil { return voicemails.size(); } + /** + * Delete all the voicemails whose source_package field matches this package + * + * @return the number of voicemails deleted + */ + public static int deleteAll(Context context) { + ContentResolver contentResolver = context.getContentResolver(); + return contentResolver.delete(Voicemails.buildSourceUri(context.getPackageName()), null, null); + } + /** Maps structured {@link Voicemail} to {@link ContentValues} in content provider. */ private static ContentValues getContentValues(Voicemail voicemail) { ContentValues contentValues = new ContentValues(); |