예제 #1
0
  /** @param targetUID */
  public void sendContactRequestTo(
      String targetUID,
      String passphrase,
      String displayName,
      Bitmap profilePic,
      List<String> circles) {
    if (targetUID == null) {
      throw new NullPointerException();
    }

    String token;
    try {
      token = mTable.createEntryForSentRequest(targetUID, passphrase);
    } catch (GeneralSecurityException e) {
      Log.e(TAG, "Error encrypting token", e);
      return;
    }

    Log.d(TAG, "Encrypted token: " + token);

    if (circles != null) {
      for (String circle : circles) {
        addPersontoCircle(targetUID, circle);
      }
    }

    mContactDetail.saveContactDetail(targetUID, displayName, profilePic);
    ContactRequest message = ContactRequest.create(token);
    SPF.get().getPeopleManager().getPerson(targetUID).sendContactRequest(message);
  }
 /*
  * Returns an instance of SPFNotificationManager or creates it, if it is the
  * first time that the stub is accessed.
  */
 private SPFNotificationManager getSPFNotificationManager() {
   if (mNotificationManager == null) {
     mNotificationManager = SPF.get().getNotificationManager();
   }
   return mNotificationManager;
 }
 /**
  * Constructor for {@link SPFNotificationServiceImpl}.
  *
  * @param ctx - the context of the calling component
  */
 public SPFNotificationServiceImpl(Context ctx) {
   mSecurityMonitor = SPF.get().getSecurityMonitor();
   // do not ask for SPFnotification instance during the interprocess
   // binding
 }