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 import android.net.wifi.aware.AwareResources; 29 30 /** 31 * Interface that WifiAwareService implements 32 * 33 * {@hide} 34 */ 35 interface IWifiAwareManager 36 { 37 // Aware API isUsageEnabled()38 boolean isUsageEnabled(); getCharacteristics()39 Characteristics getCharacteristics(); getAvailableAwareResources()40 AwareResources getAvailableAwareResources(); isDeviceAttached()41 boolean isDeviceAttached(); enableInstantCommunicationMode(in String callingPackage, boolean enable)42 void enableInstantCommunicationMode(in String callingPackage, boolean enable); isInstantCommunicationModeEnabled()43 boolean isInstantCommunicationModeEnabled(); 44 45 // client API connect(in IBinder binder, in String callingPackage, in String callingFeatureId, in IWifiAwareEventCallback callback, in ConfigRequest configRequest, boolean notifyOnIdentityChanged)46 void connect(in IBinder binder, in String callingPackage, in String callingFeatureId, 47 in IWifiAwareEventCallback callback, in ConfigRequest configRequest, 48 boolean notifyOnIdentityChanged); disconnect(int clientId, in IBinder binder)49 void disconnect(int clientId, in IBinder binder); 50 publish(in String callingPackage, in String callingFeatureId, int clientId, in PublishConfig publishConfig, in IWifiAwareDiscoverySessionCallback callback)51 void publish(in String callingPackage, in String callingFeatureId, int clientId, 52 in PublishConfig publishConfig, in IWifiAwareDiscoverySessionCallback callback); subscribe(in String callingPackage, in String callingFeatureId, int clientId, in SubscribeConfig subscribeConfig, in IWifiAwareDiscoverySessionCallback callback)53 void subscribe(in String callingPackage, in String callingFeatureId, int clientId, 54 in SubscribeConfig subscribeConfig, in IWifiAwareDiscoverySessionCallback callback); 55 56 // session API updatePublish(int clientId, int discoverySessionId, in PublishConfig publishConfig)57 void updatePublish(int clientId, int discoverySessionId, in PublishConfig publishConfig); updateSubscribe(int clientId, int discoverySessionId, in SubscribeConfig subscribeConfig)58 void updateSubscribe(int clientId, int discoverySessionId, in SubscribeConfig subscribeConfig); sendMessage(int clientId, int discoverySessionId, int peerId, in byte[] message, int messageId, int retryCount)59 void sendMessage(int clientId, int discoverySessionId, int peerId, in byte[] message, 60 int messageId, int retryCount); terminateSession(int clientId, int discoverySessionId)61 void terminateSession(int clientId, int discoverySessionId); 62 63 // internal APIs: intended to be used between System Services (restricted permissions) requestMacAddresses(int uid, in List peerIds, in IWifiAwareMacAddressProvider callback)64 void requestMacAddresses(int uid, in List peerIds, in IWifiAwareMacAddressProvider callback); 65 } 66