Move BoringSSL indication to NativeConstants

Toucing NativeCrypto causes System.loadLibrary(...) to be called which
causes classloader initialization to fail during compile time. To allow
more to be initialized, move this to NativeConstants.

Bug: 21036900
Change-Id: I07f0f5be9559a9fa9a652d1bcd82a9f88640653e
diff --git a/src/gen/native/generate_constants.cc b/src/gen/native/generate_constants.cc
index 8a6194b..480260d 100644
--- a/src/gen/native/generate_constants.cc
+++ b/src/gen/native/generate_constants.cc
@@ -44,6 +44,14 @@
   printf("package org.conscrypt;\n\n");
   printf("public final class NativeConstants {\n");
 
+  printf("    public static final boolean IS_BORINGSSL = %s;\n",
+#if defined(OPENSSL_IS_BORINGSSL)
+         "true"
+#else
+         "false"
+#endif
+  );
+
 #define CONST(x) \
   printf("    public static final int %s = %ld;\n", #x, (long int)x)
 #define CONST_MINUS_1(x) printf("    public static final int %s = -1;\n", #x)
diff --git a/src/main/java/org/conscrypt/OpenSSLProvider.java b/src/main/java/org/conscrypt/OpenSSLProvider.java
index 5a223c6..c9dd54f 100644
--- a/src/main/java/org/conscrypt/OpenSSLProvider.java
+++ b/src/main/java/org/conscrypt/OpenSSLProvider.java
@@ -228,7 +228,7 @@
 
         putSymmetricCipherImplClass("ARC4", "OpenSSLCipher$EVP_CIPHER$ARC4");
 
-        if (NativeCrypto.isBoringSSL) {
+        if (NativeConstants.IS_BORINGSSL) {
             /* EVP_AEAD is only supported in BoringSSL right now. */
             putSymmetricCipherImplClass("AES/GCM/NoPadding", "OpenSSLCipher$EVP_AEAD$AES$GCM");
             put("Alg.Alias.Cipher.GCM", "AES/GCM/NoPadding");