diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-08-31 16:17:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-08-31 16:17:04 +0000 |
commit | c39ea3c55fac807c0b98aabdf56c70dc8a49036c (patch) | |
tree | e282668a9587cf6c1ec7b604dea860400c75c6c7 /java/com/android/dialer/simulator/impl/SimulatorActionProvider.java | |
parent | 68038172793ee0e2ab3e2e56ddfbeb82879d1f58 (diff) | |
parent | 2ca4318cc1ee57dda907ba2069bd61d162b1baef (diff) |
Merge "Update Dialer source to latest internal Google revision."
Diffstat (limited to 'java/com/android/dialer/simulator/impl/SimulatorActionProvider.java')
-rw-r--r-- | java/com/android/dialer/simulator/impl/SimulatorActionProvider.java | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/java/com/android/dialer/simulator/impl/SimulatorActionProvider.java b/java/com/android/dialer/simulator/impl/SimulatorActionProvider.java index 8257d9853..f095a5993 100644 --- a/java/com/android/dialer/simulator/impl/SimulatorActionProvider.java +++ b/java/com/android/dialer/simulator/impl/SimulatorActionProvider.java @@ -30,6 +30,10 @@ import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutor.Worker; import com.android.dialer.common.concurrent.DialerExecutors; +import com.android.dialer.databasepopulator.CallLogPopulator; +import com.android.dialer.databasepopulator.ContactsPopulator; +import com.android.dialer.databasepopulator.VoicemailPopulator; +import com.android.dialer.enrichedcall.simulator.EnrichedCallSimulatorActivity; import com.android.dialer.persistentlog.PersistentLogger; /** Implements the simulator submenu. */ @@ -73,6 +77,7 @@ final class SimulatorActionProvider extends ActionProvider { super.onPrepareSubMenu(subMenu); LogUtil.enterBlock("SimulatorActionProvider.onPrepareSubMenu"); subMenu.clear(); + subMenu .add("Add call") .setOnMenuItemClickListener( @@ -80,6 +85,10 @@ final class SimulatorActionProvider extends ActionProvider { SimulatorVoiceCall.addNewIncomingCall(context); return true; }); + + subMenu + .add("Notifiations") + .setActionProvider(SimulatorNotifications.getActionProvider(context)); subMenu .add("Populate database") .setOnMenuItemClickListener( @@ -88,6 +97,13 @@ final class SimulatorActionProvider extends ActionProvider { return true; }); subMenu + .add("Clean database") + .setOnMenuItemClickListener( + (item) -> { + cleanDatabase(); + return true; + }); + subMenu .add("Sync Voicemail") .setOnMenuItemClickListener( (item) -> { @@ -114,15 +130,34 @@ final class SimulatorActionProvider extends ActionProvider { .executeSerial(null); return true; }); + subMenu + .add("Enriched call simulator") + .setOnMenuItemClickListener( + (item) -> { + context.startActivity(EnrichedCallSimulatorActivity.newIntent(context)); + return true; + }); } private void populateDatabase() { new AsyncTask<Void, Void, Void>() { @Override public Void doInBackground(Void... params) { - SimulatorContacts.populateContacts(context); - SimulatorCallLog.populateCallLog(context); - SimulatorVoicemail.populateVoicemail(context); + ContactsPopulator.populateContacts(context); + CallLogPopulator.populateCallLog(context); + VoicemailPopulator.populateVoicemail(context); + return null; + } + }.execute(); + } + + private void cleanDatabase() { + new AsyncTask<Void, Void, Void>() { + @Override + public Void doInBackground(Void... params) { + ContactsPopulator.deleteAllContacts(context); + CallLogPopulator.deleteAllCallLog(context); + VoicemailPopulator.deleteAllVoicemail(context); return null; } }.execute(); |