code: public final void init(Key key, AlgorithmParameterSpec params,
                             SecureRandom random)
          throws InvalidKeyException, InvalidAlgorithmParameterException
      {
          if (spi != null) {
              spi.engineInit(key, params, random);
          } else {
              chooseProvider(I_PARAMS, key, params, random);
          }
  
          /* Android-removed: this debugging mechanism is not used in Android.
          if (!skipDebug && pdebug != null) {
              pdebug.println("KeyAgreement." + algorithm + " algorithm from: " +
                  this.provider.getName());
          }
          */
      }
docs: Initializes this key agreement with the given key, set of
  algorithm parameters, and source of randomness.
  
  @param key the party's private information. For example, in the case
  of the Diffie-Hellman key agreement, this would be the party's own
  Diffie-Hellman private key.
  @param params the key agreement parameters
  @param random the source of randomness
  
  @exception InvalidKeyException if the given key is
  inappropriate for this key agreement, e.g., is of the wrong type or
  has an incompatible algorithm type.
  @exception InvalidAlgorithmParameterException if the given parameters
  are inappropriate for this key agreement.