Class DndContacts

java.lang.Object
com.aurelienpierre.sioul.DndContacts

final class DndContacts extends Object
The people who may reach you during do-not-disturb, as this phone's contacts have them (crates/sioul-app/src/everywhere.rs): Android lets only starred contacts through a mode, so Sioul says who on the list is not starred here, and opens their contact for you to star it. Reading only (READ_CONTACTS): Sioul never writes a star nor a contact; "Add to contacts" opens the Contacts app's own form, filled, which you save.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static boolean
    add(Context context, JSONObject person)
    The Contacts app's form for a new contact, filled: {name, phones, emails}.
    (package private) static boolean
    allowed(Context context)
     
    (package private) static boolean
    open(Context context, String uri)
    A contact opened in the Contacts app, where its star is.
    (package private) static JSONObject
    stars(Context context, JSONObject asked)
    {people: [{id, phones}]} → {permission, people: [{id, state, contact}]}: "starred" when a contact with one of their numbers is starred, "not-starred" when one has a number but none is starred (its address to open), "unknown" when no contact has their numbers.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • allowed

      static boolean allowed(Context context)
    • stars

      static JSONObject stars(Context context, JSONObject asked) throws JSONException
      {people: [{id, phones}]} → {permission, people: [{id, state, contact}]}: "starred" when a contact with one of their numbers is starred, "not-starred" when one has a number but none is starred (its address to open), "unknown" when no contact has their numbers.
      Throws:
      JSONException
    • open

      static boolean open(Context context, String uri)
      A contact opened in the Contacts app, where its star is.
    • add

      static boolean add(Context context, JSONObject person)
      The Contacts app's form for a new contact, filled: {name, phones, emails}. Saved by you, or not.