private void setRinger(long providerId, Notification notification) {
    Imps.ProviderSettings.QueryMap settings = getProviderSettings(providerId);
    String ringtoneUri = settings.getRingtoneURI();
    boolean vibrate = settings.getVibrate();

    notification.sound = TextUtils.isEmpty(ringtoneUri) ? null : Uri.parse(ringtoneUri);
    if (notification.sound != null) {
      mLastSoundPlayedMs = SystemClock.elapsedRealtime();
    }

    if (DBG) log("setRinger: notification.sound = " + notification.sound);

    if (vibrate) {
      notification.defaults |= Notification.DEFAULT_VIBRATE;
      if (DBG) log("setRinger: defaults |= vibrate");
    }
  }
 public void onServiceStop() {
   for (Imps.ProviderSettings.QueryMap queryMap : mSettings.values()) {
     queryMap.close();
   }
 }
 private boolean isNotificationEnabled(long providerId) {
   Imps.ProviderSettings.QueryMap settings = getProviderSettings(providerId);
   return settings.getEnableNotification();
 }