Skip to content
Sam Zhao edited this page Nov 29, 2016 · 17 revisions

EDB search (done):

Signal supports search based on contacts. We can expand this search based on message body, given that the messages are stored in EDB. This way we can build upon the existing search UI.

Current functionality

  1. The UI starts in ConversationListActivity.
  2. The activity initializes search within initializeSearch, which sets a callback for query submission on ConversationListFragment. This callback passes the search query string as a filter to ConversationListFragment.queryFilter.
  3. The ConversationListFragment is re-created / re-loaded once the queryFilter is set to display the filtered conversations. The reload is through ConversationListLoader (in ConversationListFragment.onCreateLoader), which uses the queryFilter as the filter.
  4. The ConversationListLoader creates a cursor on the database to perform search based on the filter. Currently it supports only search based on contacts.
  5. The ConversationListLoader returns a cursor of a list of conversations, filtered by phone numbers indicated by the filter. First, it retrieves the phone numbers that contains the searched words in the filter from the Android contacts (ContactAccessor#getNumbersForThreadSearchFilter). Then it uses these phone numbers to retrieve threads from thread table.

When clicking a conversation from the conversation list:

  1. This is during setup time: ConversationListAdapter.onCreateItemViewHolder sets a on-click callback for ConversationListItem.
  2. ConversationListFragment.onItemClick gets called.
  3. ConversationListActivity.onCreateConversation
  4. ConversationActivity

TODO (done)

Expand the search based on message body.

  1. (done) filter conversation list by searched keyword
  2. (done) filter conversation list by searched keyword
  3. (done) filter messages within a conversation by searched keyword

EDB setup (done)

The main issue with EDB setup is that it needs to build a multi-map for messages. After installing Signal, the sms table is empty. The only way to add tuples to the table is through receiving new text messages or importing from an existing SMS app.

EDB setup from existing Signal SMS (done)

This is easiest to test on an Android Emulator. We assume there are existing SMS in Signal (either from importing form another SMS app or from receiving SMS to Signal). We provide a button in the Export tab to set up an EDB on the existing Signal SMS. To handle new incoming SMS after the EDB setup, please refer to EDB update.

TODO (done)

  1. (done) Add a button to ExportFragment view about "Set up EDB".
  2. (done) Add handler for EDBSetup.
  3. (done) Create cursor to read each messages from the EDB and create a multi-map of each word in a given message body to the message id.
  4. (done) Create LEX2lev. Find a place to store this instance.

EDB setup from existing SMS app (not supported)

Signal supports importing from a pre-existing SMS app. We can simply redirect the data into a LEX2lev EDB.

EDB update (done)

We need to use RH2lev as the construction in Edb.