| Index: net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
|
| diff --git a/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java b/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
|
| index 9aab28d75761b9586a5285c31aaf8bcfe3641f11..2d0fe8d6ed246d6910ac1cd31317854db462d1ee 100644
|
| --- a/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
|
| +++ b/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java
|
| @@ -34,7 +34,6 @@ public class NetworkChangeNotifier {
|
| public void onConnectionTypeChanged(int connectionType);
|
| }
|
|
|
| - private final Context mContext;
|
| private final ArrayList<Long> mNativeChangeNotifiers;
|
| private final ObserverList<ConnectionTypeObserver> mConnectionTypeObservers;
|
| private NetworkChangeNotifierAutoDetect mAutoDetector;
|
| @@ -45,19 +44,23 @@ public class NetworkChangeNotifier {
|
| private static NetworkChangeNotifier sInstance;
|
|
|
| @VisibleForTesting
|
| - protected NetworkChangeNotifier(Context context) {
|
| - mContext = context.getApplicationContext();
|
| + protected NetworkChangeNotifier() {
|
| mNativeChangeNotifiers = new ArrayList<Long>();
|
| mConnectionTypeObservers = new ObserverList<ConnectionTypeObserver>();
|
| }
|
|
|
| + // TODO(wnwen): Remove after downstream no longer depends on this.
|
| + public static NetworkChangeNotifier init(Context context) {
|
| + return init();
|
| + }
|
| +
|
| /**
|
| * Initializes the singleton once.
|
| */
|
| @CalledByNative
|
| - public static NetworkChangeNotifier init(Context context) {
|
| + public static NetworkChangeNotifier init() {
|
| if (sInstance == null) {
|
| - sInstance = new NetworkChangeNotifier(context);
|
| + sInstance = new NetworkChangeNotifier();
|
| }
|
| return sInstance;
|
| }
|
| @@ -214,7 +217,7 @@ public class NetworkChangeNotifier {
|
| notifyObserversToPurgeActiveNetworkList(activeNetIds);
|
| }
|
| },
|
| - mContext, policy);
|
| + policy);
|
| final NetworkChangeNotifierAutoDetect.NetworkState networkState =
|
| mAutoDetector.getCurrentNetworkState();
|
| updateCurrentConnectionType(
|
|
|