| 1 |
/* |
| 2 |
* Copyright (C) 2017 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.companion; |
| 18 |
|
| 19 |
import android.app.PendingIntent; |
| 20 |
import android.companion.IAssociationRequestCallback; |
| 21 |
import android.companion.IOnAssociationsChangedListener; |
| 22 |
import android.companion.AssociationInfo; |
| 23 |
import android.companion.AssociationRequest; |
| 24 |
import android.content.ComponentName; |
| 25 |
|
| 26 |
/** |
| 27 |
* Interface for communication with the core companion device manager service. |
| 28 |
* |
| 29 |
* @hide |
| 30 |
*/ |
| 31 |
interface ICompanionDeviceManager { |
| 32 |
void associate(in AssociationRequest request, in IAssociationRequestCallback callback, |
| 33 |
in String callingPackage, int userId); |
| 34 |
|
| 35 |
List<AssociationInfo> getAssociations(String callingPackage, int userId); |
| 36 |
List<AssociationInfo> getAllAssociationsForUser(int userId); |
| 37 |
|
| 38 |
/** @deprecated */ |
| 39 |
void legacyDisassociate(String deviceMacAddress, String callingPackage, int userId); |
| 40 |
|
| 41 |
void disassociate(int associationId); |
| 42 |
|
| 43 |
/** @deprecated */ |
| 44 |
boolean hasNotificationAccess(in ComponentName component); |
| 45 |
|
| 46 |
PendingIntent requestNotificationAccess(in ComponentName component, int userId); |
| 47 |
|
| 48 |
/** @deprecated */ |
| 49 |
boolean isDeviceAssociatedForWifiConnection(in String packageName, in String macAddress, |
| 50 |
int userId); |
| 51 |
|
| 52 |
void registerDevicePresenceListenerService(in String deviceAddress, in String callingPackage, |
| 53 |
int userId); |
| 54 |
|
| 55 |
void unregisterDevicePresenceListenerService(in String deviceAddress, in String callingPackage, |
| 56 |
int userId); |
| 57 |
|
| 58 |
/** @deprecated */ |
| 59 |
boolean canPairWithoutPrompt(in String packageName, in String deviceMacAddress, int userId); |
| 60 |
|
| 61 |
/** @deprecated */ |
| 62 |
void createAssociation(in String packageName, in String macAddress, int userId, |
| 63 |
in byte[] certificate); |
| 64 |
|
| 65 |
void dispatchMessage(in int messageId, in int associationId, in byte[] message); |
| 66 |
|
| 67 |
void addOnAssociationsChangedListener(IOnAssociationsChangedListener listener, int userId); |
| 68 |
|
| 69 |
void removeOnAssociationsChangedListener(IOnAssociationsChangedListener listener, int userId); |
| 70 |
|
| 71 |
void notifyDeviceAppeared(int associationId); |
| 72 |
|
| 73 |
void notifyDeviceDisappeared(int associationId); |
| 74 |
} |