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