diff options
author | sail <sail@google.com> | 2017-08-18 12:51:42 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-30 15:46:20 +0000 |
commit | 945b28c5d8e911f99315c97f23dad05a86c0e1bc (patch) | |
tree | 0593d4bc537e25762c85934c7b799e122ce78284 /java/com/android/dialer/databasepopulator | |
parent | 8f136644f7ba29ee742719dcb766b49902ac3341 (diff) |
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
Diffstat (limited to 'java/com/android/dialer/databasepopulator')
-rw-r--r-- | java/com/android/dialer/databasepopulator/VoicemailPopulator.java | 32 |
1 files changed, 17 insertions, 15 deletions
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(); } } |