Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2de8a826 authored by Joe Onorato's avatar Joe Onorato Committed by Android (Google) Code Review
Browse files

Merge "Revert "Changed ConnectivityService#getServiceInstance so its a singleton.""

parents 949498de 00092874
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ public class ConnectivityService extends IConnectivityManager.Stub {
    private int mNumDnsEntries;

    private boolean mTestMode;
    private static volatile ConnectivityService sServiceInstance;
    private static ConnectivityService sServiceInstance;

    private Handler mHandler;

@@ -176,10 +176,11 @@ public class ConnectivityService extends IConnectivityManager.Stub {
            Looper.loop();
        }

        public static synchronized ConnectivityService getServiceInstance(Context context) {
            if (sServiceInstance == null) {
        public static ConnectivityService getServiceInstance(Context context) {
            ConnectivityThread thread = new ConnectivityThread(context);
            thread.start();

            synchronized (thread) {
                while (sServiceInstance == null) {
                    try {
                        // Wait until sServiceInstance has been initialized.