creating a flag to explicitly load flipper
Summary: This change will allow loading flipper not only internal build but also in builds that explicitly turn on LOAD_FLIPPER_EXPLICIT in build config Reviewed By: timur-valiev Differential Revision: D25369245 fbshipit-source-id: 9f8e5c7033aa4ded6ce7bc8cc5b5c252ba65692b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
08b5644253
commit
eb475e7550
@@ -20,6 +20,7 @@ android {
|
|||||||
targetSdkVersion rootProject.targetSdkVersion
|
targetSdkVersion rootProject.targetSdkVersion
|
||||||
buildConfigField "boolean", "IS_INTERNAL_BUILD", 'true'
|
buildConfigField "boolean", "IS_INTERNAL_BUILD", 'true'
|
||||||
buildConfigField "boolean", "IS_ASAN_BUILD", 'false'
|
buildConfigField "boolean", "IS_ASAN_BUILD", 'false'
|
||||||
|
buildConfigField "boolean", "LOAD_FLIPPER_EXPLICIT", 'false'
|
||||||
|
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
|
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public final class AndroidFlipperClient {
|
|||||||
|
|
||||||
public static synchronized FlipperClient getInstance(Context context) {
|
public static synchronized FlipperClient getInstance(Context context) {
|
||||||
if (!sIsInitialized) {
|
if (!sIsInitialized) {
|
||||||
if (!BuildConfig.IS_INTERNAL_BUILD) {
|
if (!(BuildConfig.IS_INTERNAL_BUILD || BuildConfig.LOAD_FLIPPER_EXPLICIT)) {
|
||||||
Log.e("Flipper", "Attempted to initialize in non-internal build");
|
Log.e("Flipper", "Attempted to initialize in non-internal build");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import com.facebook.soloader.SoLoader;
|
|||||||
@DoNotStrip
|
@DoNotStrip
|
||||||
class EventBase extends HybridClassBase {
|
class EventBase extends HybridClassBase {
|
||||||
static {
|
static {
|
||||||
if (BuildConfig.IS_INTERNAL_BUILD) {
|
if (BuildConfig.IS_INTERNAL_BUILD || BuildConfig.LOAD_FLIPPER_EXPLICIT) {
|
||||||
SoLoader.loadLibrary("flipper");
|
SoLoader.loadLibrary("flipper");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import javax.annotation.Nullable;
|
|||||||
@DoNotStrip
|
@DoNotStrip
|
||||||
class FlipperClientImpl implements FlipperClient {
|
class FlipperClientImpl implements FlipperClient {
|
||||||
static {
|
static {
|
||||||
if (BuildConfig.IS_INTERNAL_BUILD) {
|
if (BuildConfig.IS_INTERNAL_BUILD || BuildConfig.LOAD_FLIPPER_EXPLICIT) {
|
||||||
SoLoader.loadLibrary("flipper");
|
SoLoader.loadLibrary("flipper");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import com.facebook.soloader.SoLoader;
|
|||||||
@DoNotStrip
|
@DoNotStrip
|
||||||
class FlipperConnectionImpl implements FlipperConnection {
|
class FlipperConnectionImpl implements FlipperConnection {
|
||||||
static {
|
static {
|
||||||
if (BuildConfig.IS_INTERNAL_BUILD) {
|
if (BuildConfig.IS_INTERNAL_BUILD || BuildConfig.LOAD_FLIPPER_EXPLICIT) {
|
||||||
SoLoader.loadLibrary("flipper");
|
SoLoader.loadLibrary("flipper");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import com.facebook.soloader.SoLoader;
|
|||||||
@DoNotStrip
|
@DoNotStrip
|
||||||
class FlipperResponderImpl implements FlipperResponder {
|
class FlipperResponderImpl implements FlipperResponder {
|
||||||
static {
|
static {
|
||||||
if (BuildConfig.IS_INTERNAL_BUILD) {
|
if (BuildConfig.IS_INTERNAL_BUILD || BuildConfig.LOAD_FLIPPER_EXPLICIT) {
|
||||||
SoLoader.loadLibrary("flipper");
|
SoLoader.loadLibrary("flipper");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public final class FlipperUtils {
|
|||||||
private FlipperUtils() {}
|
private FlipperUtils() {}
|
||||||
|
|
||||||
public static boolean shouldEnableFlipper(final Context context) {
|
public static boolean shouldEnableFlipper(final Context context) {
|
||||||
return BuildConfig.IS_INTERNAL_BUILD
|
return (BuildConfig.IS_INTERNAL_BUILD || BuildConfig.LOAD_FLIPPER_EXPLICIT)
|
||||||
&& !isEndToEndTest()
|
&& !isEndToEndTest()
|
||||||
&& isMainProcess(context)
|
&& isMainProcess(context)
|
||||||
// Flipper has issue with ASAN build. They cannot be concurrently enabled.
|
// Flipper has issue with ASAN build. They cannot be concurrently enabled.
|
||||||
|
|||||||
Reference in New Issue
Block a user