1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.net.wifi.aware; 18 19 import android.app.PendingIntent; 20 21 import android.net.wifi.aware.ConfigRequest; 22 import android.net.wifi.aware.IWifiAwareDiscoverySessionCallback; 23 import android.net.wifi.aware.IWifiAwareEventCallback; 24 import android.net.wifi.aware.IWifiAwareMacAddressProvider; 25 import android.net.wifi.aware.PublishConfig; 26 import android.net.wifi.aware.SubscribeConfig; 27 import android.net.wifi.aware.Characteristics; 28 29 /** 30 * Interface that WifiAwareService implements 31 * 32 * {@hide} 33 */ 34 interface IWifiAwareManager 35 { 36 // Aware API isUsageEnabled()37 boolean isUsageEnabled(); getCharacteristics()38 Characteristics getCharacteristics(); 39 40 // client API connect(in IBinder binder, in String callingPackage, in IWifiAwareEventCallback callback, in ConfigRequest configRequest, boolean notifyOnIdentityChanged)41 void connect(in IBinder binder, in String callingPackage, in IWifiAwareEventCallback callback, 42 in ConfigRequest configRequest, boolean notifyOnIdentityChanged); disconnect(int clientId, in IBinder binder)43 void disconnect(int clientId, in IBinder binder); 44 publish(in String callingPackage, int clientId, in PublishConfig publishConfig, in IWifiAwareDiscoverySessionCallback callback)45 void publish(in String callingPackage, int clientId, in PublishConfig publishConfig, 46 in IWifiAwareDiscoverySessionCallback callback); subscribe(in String callingPackage, int clientId, in SubscribeConfig subscribeConfig, in IWifiAwareDiscoverySessionCallback callback)47 void subscribe(in String callingPackage, int clientId, in SubscribeConfig subscribeConfig, 48 in IWifiAwareDiscoverySessionCallback callback); 49 50 // session API updatePublish(int clientId, int discoverySessionId, in PublishConfig publishConfig)51 void updatePublish(int clientId, int discoverySessionId, in PublishConfig publishConfig); updateSubscribe(int clientId, int discoverySessionId, in SubscribeConfig subscribeConfig)52 void updateSubscribe(int clientId, int discoverySessionId, in SubscribeConfig subscribeConfig); sendMessage(int clientId, int discoverySessionId, int peerId, in byte[] message, int messageId, int retryCount)53 void sendMessage(int clientId, int discoverySessionId, int peerId, in byte[] message, 54 int messageId, int retryCount); terminateSession(int clientId, int discoverySessionId)55 void terminateSession(int clientId, int discoverySessionId); 56 57 // internal APIs: intended to be used between System Services (restricted permissions) requestMacAddresses(int uid, in List peerIds, in IWifiAwareMacAddressProvider callback)58 void requestMacAddresses(int uid, in List peerIds, in IWifiAwareMacAddressProvider callback); 59 } 60