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

Commit 2161b39d authored by Roshan Pius's avatar Roshan Pius
Browse files

WifiManager: Retrieve IWifiManager service lazily

Wifi services will be initialized a little later in the bootup sequence
because it is now a separate APK. So, retrieve wifi services lazily
(on the first method call on the object).
This will alleviate the need to modify all the clients which instantiate
WifiManager very early in the bootup sequence (Sysui, some vendor apps,
etc).

Bug: 137374831
Test: Device boots up & connects to wifi networks.
Change-Id: I8e1f0eb3a5a8fdb79b088447fbb9f97413f64483
Merged-In: I8e1f0eb3a5a8fdb79b088447fbb9f97413f64483
parent 56f70781
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ import android.net.lowpan.ILowpanManager;
import android.net.lowpan.LowpanManager;
import android.net.nsd.INsdManager;
import android.net.nsd.NsdManager;
import android.net.wifi.IWifiManager;
import android.net.wifi.IWifiScanner;
import android.net.wifi.RttManager;
import android.net.wifi.WifiManager;
@@ -730,10 +729,8 @@ public final class SystemServiceRegistry {
        registerService(Context.WIFI_SERVICE, WifiManager.class,
                new CachedServiceFetcher<WifiManager>() {
            @Override
            public WifiManager createService(ContextImpl ctx) throws ServiceNotFoundException {
                IBinder b = ServiceManager.getServiceOrThrow(Context.WIFI_SERVICE);
                IWifiManager service = IWifiManager.Stub.asInterface(b);
                return new WifiManager(ctx.getOuterContext(), service,
            public WifiManager createService(ContextImpl ctx) {
                return new WifiManager(ctx.getOuterContext(),
                        ConnectivityThread.getInstanceLooper());
            }});

+121 −93

File changed.

Preview size limit exceeded, changes collapsed.