mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-10 17:22:45 +08:00
revert D2779079
Reviewed By: zjj010104 Differential Revision: D2802728 fb-gh-sync-id: 9e09f00d1d7facd2091fe60eee8565c4bf599b1d
This commit is contained in:
committed by
facebook-github-bot-7
parent
18cdead76b
commit
ee82bad3f7
@@ -17,7 +17,6 @@ import java.util.List;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.AsyncTask;
|
||||
@@ -47,7 +46,6 @@ import com.facebook.react.bridge.UiThreadUtil;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.bridge.WritableNativeMap;
|
||||
import com.facebook.react.bridge.queue.CatalystQueueConfigurationSpec;
|
||||
import com.facebook.react.common.ApplicationHolder;
|
||||
import com.facebook.react.common.ReactConstants;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.devsupport.DevServerHelper;
|
||||
@@ -204,9 +202,6 @@ import com.facebook.systrace.Systrace;
|
||||
NativeModuleCallExceptionHandler nativeModuleCallExceptionHandler) {
|
||||
initializeSoLoaderIfNecessary(applicationContext);
|
||||
|
||||
// TODO(9577825): remove this
|
||||
ApplicationHolder.setApplication((Application) applicationContext.getApplicationContext());
|
||||
|
||||
mApplicationContext = applicationContext;
|
||||
mJSBundleFile = jsBundleFile;
|
||||
mJSMainModuleName = jsMainModuleName;
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package com.facebook.react.common;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
|
||||
/**
|
||||
* Holds the current Application Object.
|
||||
*
|
||||
* TODO(9577825): This is a bad pattern, we should thread through an Environment object instead.
|
||||
* Remove once bridge is unforked.
|
||||
*/
|
||||
@DoNotStrip
|
||||
@Deprecated
|
||||
public class ApplicationHolder {
|
||||
|
||||
private static Application sApplication;
|
||||
|
||||
public static void setApplication(Application application) {
|
||||
sApplication = application;
|
||||
}
|
||||
|
||||
public static Application getApplication() {
|
||||
return Assertions.assertNotNull(sApplication);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user