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

Commit c6a6a0e7 authored by Etan Cohen's avatar Etan Cohen Committed by Android (Google) Code Review
Browse files

Merge "resolve merge conflicts of 6ffbcb3f to master"

parents 1ca2ca1e ccb0b65b
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -511,12 +511,15 @@ final class SystemServiceRegistry {
            }});

        registerService(Context.WIFI_NAN_SERVICE, WifiNanManager.class,
                new StaticServiceFetcher<WifiNanManager>() {
                new CachedServiceFetcher<WifiNanManager>() {
            @Override
            public WifiNanManager createService() throws ServiceNotFoundException {
                IBinder b = ServiceManager.getServiceOrThrow(Context.WIFI_NAN_SERVICE);
            public WifiNanManager createService(ContextImpl ctx) throws ServiceNotFoundException {
                IBinder b = ServiceManager.getService(Context.WIFI_NAN_SERVICE);
                IWifiNanManager service = IWifiNanManager.Stub.asInterface(b);
                return new WifiNanManager(service);
                if (service == null) {
                    return null;
                }
                return new WifiNanManager(ctx.getOuterContext(), service);
            }});

        registerService(Context.WIFI_SCANNING_SERVICE, WifiScanner.class,
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ interface IWifiNanManager
    boolean isUsageEnabled();

    // client API
    int connect(in IBinder binder, in IWifiNanEventCallback callback,
    int connect(in IBinder binder, in String callingPackage, in IWifiNanEventCallback callback,
            in ConfigRequest configRequest);
    void disconnect(int clientId, in IBinder binder);

+5 −2
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.annotation.Nullable;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkRequest;
import android.net.wifi.RttManager;
@@ -222,6 +223,7 @@ public class WifiNanManager {

    public static final int WIFI_NAN_DATA_PATH_ROLE_RESPONDER = 1;

    private final Context mContext;
    private final IWifiNanManager mService;
    private final CloseGuard mCloseGuard = CloseGuard.get();

@@ -242,7 +244,8 @@ public class WifiNanManager {
    /**
     * {@hide}
     */
    public WifiNanManager(IWifiNanManager service) {
    public WifiNanManager(Context context, IWifiNanManager service) {
        mContext = context;
        mService = service;
    }

@@ -325,7 +328,7 @@ public class WifiNanManager {
            mLooper = looper;

            try {
                mClientId = mService.connect(mBinder,
                mClientId = mService.connect(mBinder, mContext.getOpPackageName(),
                        new WifiNanEventCallbackProxy(this, looper, callback), configRequest);
            } catch (RemoteException e) {
                mClientId = INVALID_CLIENT_ID;