mirror of
https://github.com/status-im/react-native.git
synced 2025-02-05 22:23:37 +00:00
Build first-party C++ deps of OSS React Native with Buck
Reviewed By: sdwilsh Differential Revision: D2840290 fb-gh-sync-id: 3dd4f7ee83a520d5c01f7864f443a04aa73b35fa
This commit is contained in:
parent
d8b5539151
commit
f97138f36f
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright (c) 2015-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
#ifndef __ANDROID__
|
||||
#error "This file should only be compiled for Android."
|
||||
#endif
|
||||
|
||||
#include <jni/fbjni/References.h>
|
||||
#include <jni/fbjni/CoreClasses.h>
|
||||
|
||||
namespace facebook {
|
||||
namespace jni {
|
||||
namespace internal {
|
||||
|
||||
static int32_t getApiLevel() {
|
||||
auto cls = findClassLocal("android/os/Build$VERSION");
|
||||
auto fld = cls->getStaticField<int32_t>("SDK_INT");
|
||||
if (fld) {
|
||||
return cls->getStaticFieldValue(fld);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool doesGetObjectRefTypeWork() {
|
||||
static auto level = getApiLevel();
|
||||
return level >= 14;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user