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

Commit 3a9de109 authored by Etan Cohen's avatar Etan Cohen
Browse files

[NAN] Expose NAN characteristics as an API [DO NOT MERGE]

Expose NAN characteristics as an API.

Bug: 31912101
Test: build and validate API updates
Change-Id: Ie48af247383c9f0af8fd7a01c5f75544dc6c07bb
parent 65eaa6d8
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line 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.IWifiNanEventCallback;
import android.net.wifi.nan.PublishConfig;
import android.net.wifi.nan.PublishConfig;
import android.net.wifi.nan.SubscribeConfig;
import android.net.wifi.nan.SubscribeConfig;
import android.net.wifi.nan.WifiNanCharacteristics;
import android.net.wifi.RttManager;
import android.net.wifi.RttManager;


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


    // client API
    // client API
    void connect(in IBinder binder, in String callingPackage, in IWifiNanEventCallback callback,
    void connect(in IBinder binder, in String callingPackage, in IWifiNanEventCallback callback,
+19 −0
Original line number Original line 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 Original line Diff line number Diff line
@@ -23,7 +23,7 @@ import android.os.Parcelable;
/**
/**
 * The characteristics of the Wi-Fi NAN implementation.
 * The characteristics of the Wi-Fi NAN implementation.
 *
 *
 * @hide
 * @hide PROPOSED_NAN_API
 */
 */
public class WifiNanCharacteristics implements Parcelable {
public class WifiNanCharacteristics implements Parcelable {
    /** @hide */
    /** @hide */
+16 −0
Original line number Original line Diff line number Diff line
@@ -294,6 +294,22 @@ public class WifiNanManager {
        return false;
        return false;
    }
    }


    /**
     * 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) {
            e.rethrowAsRuntimeException();
        }

        return null;
    }

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