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

Commit e64c62fd authored by Etan Cohen's avatar Etan Cohen
Browse files

[NAN] Expose NAN characteristics as an API

Expose NAN characteristics as an API.

(cherry-pick of commit 3a9de109)

Bug: 31912101
Test: build and validate API updates
Change-Id: If02942d738aab8fa2f2f47489c6840af1bc38280
parent 141a2840
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.net.wifi.nan.IWifiNanDiscoverySessionCallback;
import android.net.wifi.nan.IWifiNanEventCallback;
import android.net.wifi.nan.PublishConfig;
import android.net.wifi.nan.SubscribeConfig;
import android.net.wifi.nan.WifiNanCharacteristics;
import android.net.wifi.RttManager;

/**
@@ -36,6 +37,7 @@ interface IWifiNanManager
    void enableUsage();
    void disableUsage();
    boolean isUsageEnabled();
    WifiNanCharacteristics getCharacteristics();

    // client API
    void connect(in IBinder binder, in String callingPackage, in IWifiNanEventCallback callback,
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.wifi.nan;

parcelable WifiNanCharacteristics;
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ import android.os.Parcelable;
/**
 * The characteristics of the Wi-Fi NAN implementation.
 *
 * @hide
 * @hide PROPOSED_NAN_API
 */
public class WifiNanCharacteristics implements Parcelable {
    /** @hide */
+14 −0
Original line number Diff line number Diff line
@@ -292,6 +292,20 @@ public class WifiNanManager {
        }
    }

    /**
     * Returns the characteristics of the Wi-Fi NAN interface: a set of parameters which specify
     * limitations on configurations, e.g. the maximum service name length.
     *
     * @return An object specifying configuration limitations of NAN.
     */
    public WifiNanCharacteristics getCharacteristics() {
        try {
            return mService.getCharacteristics();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Attach to the Wi-Fi NAN service - enabling the application to create discovery sessions or
     * create connections to peers. The device will attach to an existing cluster if it can find