From 945b28c5d8e911f99315c97f23dad05a86c0e1bc Mon Sep 17 00:00:00 2001 From: sail Date: Fri, 18 Aug 2017 12:51:42 -0700 Subject: Add notifications to simulator This CL adds a new notification menu to the simulator. The menu allows the user to create the following types of notifications: - missed call notifications - voicemail notifications - "was this spam" notification - "report this as not spam" notification For misssed call and spam, we generate these notifications by creating fake incoming calls using the SimulatorConnectionService. To make it easier to use the connection serivce, it now registers as a SIM call manager. This means that the usre doesn't have to enable the connection service in system settings before using the simulator. Bug: 62937258 Test: SimulatorConnectionServiceTest, SimulatorMissedCallCreatorTest, SimulatorNotificationsTest, SimulatorSpamCallCreatorTest PiperOrigin-RevId: 165740575 Change-Id: I2c54e19c6815f151799d7e51e7c61466c3d3a767 --- .../databasepopulator/VoicemailPopulator.java | 32 ++++++++++++---------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'java/com/android/dialer/databasepopulator') diff --git a/java/com/android/dialer/databasepopulator/VoicemailPopulator.java b/java/com/android/dialer/databasepopulator/VoicemailPopulator.java index 581100f03..e99f7c7d4 100644 --- a/java/com/android/dialer/databasepopulator/VoicemailPopulator.java +++ b/java/com/android/dialer/databasepopulator/VoicemailPopulator.java @@ -113,25 +113,26 @@ public final class VoicemailPopulator { context.getContentResolver().insert(Status.buildSourceUri(context.getPackageName()), values); } + /** Data for a single voicemail entry. */ @AutoValue - abstract static class Voicemail { + public abstract static class Voicemail { @NonNull - abstract String getPhoneNumber(); + public abstract String getPhoneNumber(); @NonNull - abstract String getTranscription(); + public abstract String getTranscription(); - abstract long getDurationSeconds(); + public abstract long getDurationSeconds(); - abstract long getTimeMillis(); + public abstract long getTimeMillis(); - abstract boolean getIsRead(); + public abstract boolean getIsRead(); - static Builder builder() { + public static Builder builder() { return new AutoValue_VoicemailPopulator_Voicemail.Builder(); } - ContentValues getAsContentValues(Context context) { + public ContentValues getAsContentValues(Context context) { ContentValues values = new ContentValues(); values.put(Voicemails.DATE, getTimeMillis()); values.put(Voicemails.NUMBER, getPhoneNumber()); @@ -142,19 +143,20 @@ public final class VoicemailPopulator { return values; } + /** Builder for a single voicemail entry. */ @AutoValue.Builder - abstract static class Builder { - abstract Builder setPhoneNumber(@NonNull String phoneNumber); + public abstract static class Builder { + public abstract Builder setPhoneNumber(@NonNull String phoneNumber); - abstract Builder setTranscription(@NonNull String transcription); + public abstract Builder setTranscription(@NonNull String transcription); - abstract Builder setDurationSeconds(long durationSeconds); + public abstract Builder setDurationSeconds(long durationSeconds); - abstract Builder setTimeMillis(long timeMillis); + public abstract Builder setTimeMillis(long timeMillis); - abstract Builder setIsRead(boolean isRead); + public abstract Builder setIsRead(boolean isRead); - abstract Voicemail build(); + public abstract Voicemail build(); } } -- cgit v1.2.3