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.IBooleanListener; 22 import android.net.wifi.IIntegerListener; 23 import android.net.wifi.IListListener; 24 import android.net.wifi.aware.ConfigRequest; 25 import android.net.wifi.aware.IWifiAwareDiscoverySessionCallback; 26 import android.net.wifi.aware.IWifiAwareEventCallback; 27 import android.net.wifi.aware.IWifiAwareMacAddressProvider; 28 import android.net.wifi.aware.PublishConfig; 29 import android.net.wifi.aware.SubscribeConfig; 30 import android.net.wifi.aware.Characteristics; 31 import android.net.wifi.aware.AwareResources; 32 import android.net.wifi.aware.AwareParams; 33 34 import android.os.Bundle; 35 36 /** 37 * Interface that WifiAwareService implements 38 * 39 * {@hide} 40 */ 41 interface IWifiAwareManager 42 { 43 // Aware API isUsageEnabled()44 boolean isUsageEnabled(); getCharacteristics()45 Characteristics getCharacteristics(); getAvailableAwareResources()46 AwareResources getAvailableAwareResources(); isDeviceAttached()47 boolean isDeviceAttached(); enableInstantCommunicationMode(in String callingPackage, boolean enable)48 void enableInstantCommunicationMode(in String callingPackage, boolean enable); isInstantCommunicationModeEnabled()49 boolean isInstantCommunicationModeEnabled(); isSetChannelOnDataPathSupported()50 boolean isSetChannelOnDataPathSupported(); setAwareParams(in AwareParams parameters)51 void setAwareParams(in AwareParams parameters); resetPairedDevices(in String callingPackage)52 void resetPairedDevices(in String callingPackage); removePairedDevice(in String callingPackage, in String alias)53 void removePairedDevice(in String callingPackage, in String alias); getPairedDevices(in String callingPackage, in IListListener value)54 void getPairedDevices(in String callingPackage, in IListListener value); setOpportunisticModeEnabled(in String callingPackage, boolean enable)55 void setOpportunisticModeEnabled(in String callingPackage, boolean enable); isOpportunisticModeEnabled(in String callingPackage, in IBooleanListener value)56 void isOpportunisticModeEnabled(in String callingPackage, in IBooleanListener value); 57 58 // client API connect(in IBinder binder, in String callingPackage, in String callingFeatureId, in IWifiAwareEventCallback callback, in ConfigRequest configRequest, boolean notifyOnIdentityChanged, in Bundle extras, boolean forAwareOffload)59 void connect(in IBinder binder, in String callingPackage, in String callingFeatureId, 60 in IWifiAwareEventCallback callback, in ConfigRequest configRequest, 61 boolean notifyOnIdentityChanged, in Bundle extras, boolean forAwareOffload); disconnect(int clientId, in IBinder binder)62 void disconnect(int clientId, in IBinder binder); setMasterPreference(int clientId, in IBinder binder, int mp)63 void setMasterPreference(int clientId, in IBinder binder, int mp); getMasterPreference(int clientId, in IBinder binder, in IIntegerListener listener)64 void getMasterPreference(int clientId, in IBinder binder, in IIntegerListener listener); 65 publish(in String callingPackage, in String callingFeatureId, int clientId, in PublishConfig publishConfig, in IWifiAwareDiscoverySessionCallback callback, in Bundle extras)66 void publish(in String callingPackage, in String callingFeatureId, int clientId, 67 in PublishConfig publishConfig, in IWifiAwareDiscoverySessionCallback callback, 68 in Bundle extras); subscribe(in String callingPackage, in String callingFeatureId, int clientId, in SubscribeConfig subscribeConfig, in IWifiAwareDiscoverySessionCallback callback, in Bundle extras)69 void subscribe(in String callingPackage, in String callingFeatureId, int clientId, 70 in SubscribeConfig subscribeConfig, in IWifiAwareDiscoverySessionCallback callback, 71 in Bundle extras); 72 73 // session API updatePublish(int clientId, int discoverySessionId, in PublishConfig publishConfig)74 void updatePublish(int clientId, int discoverySessionId, in PublishConfig publishConfig); updateSubscribe(int clientId, int discoverySessionId, in SubscribeConfig subscribeConfig)75 void updateSubscribe(int clientId, int discoverySessionId, in SubscribeConfig subscribeConfig); sendMessage(int clientId, int discoverySessionId, int peerId, in byte[] message, int messageId, int retryCount)76 void sendMessage(int clientId, int discoverySessionId, int peerId, in byte[] message, 77 int messageId, int retryCount); terminateSession(int clientId, int discoverySessionId)78 void terminateSession(int clientId, int discoverySessionId); initiateNanPairingSetupRequest(int clientId, int sessionId, int peerId, String password, String pairingDeviceAlias, int cipherSuite)79 void initiateNanPairingSetupRequest(int clientId, int sessionId, int peerId, 80 String password, String pairingDeviceAlias, int cipherSuite); responseNanPairingSetupRequest(int clientId, int sessionId, int peerId, int requestId, String password, String pairingDeviceAlias, boolean accept, int cipherSuite)81 void responseNanPairingSetupRequest(int clientId, int sessionId, int peerId, int requestId, 82 String password, String pairingDeviceAlias, boolean accept, int cipherSuite); initiateBootStrappingSetupRequest(int clientId, int sessionId, int peerId,int method)83 void initiateBootStrappingSetupRequest(int clientId, int sessionId, int peerId,int method); suspend(int clientId, int sessionId)84 void suspend(int clientId, int sessionId); resume(int clientId, int sessionId)85 void resume(int clientId, int sessionId); 86 87 // internal APIs: intended to be used between System Services (restricted permissions) requestMacAddresses(int uid, in int[] peerIds, in IWifiAwareMacAddressProvider callback)88 void requestMacAddresses(int uid, in int[] peerIds, in IWifiAwareMacAddressProvider callback); 89 } 90