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 { associate(in AssociationRequest request, in IAssociationRequestCallback callback, in String callingPackage, int userId)32 void associate(in AssociationRequest request, in IAssociationRequestCallback callback, 33 in String callingPackage, int userId); 34 getAssociations(String callingPackage, int userId)35 List<AssociationInfo> getAssociations(String callingPackage, int userId); getAllAssociationsForUser(int userId)36 List<AssociationInfo> getAllAssociationsForUser(int userId); 37 38 /** @deprecated */ legacyDisassociate(String deviceMacAddress, String callingPackage, int userId)39 void legacyDisassociate(String deviceMacAddress, String callingPackage, int userId); 40 disassociate(int associationId)41 void disassociate(int associationId); 42 43 /** @deprecated */ hasNotificationAccess(in ComponentName component)44 boolean hasNotificationAccess(in ComponentName component); 45 requestNotificationAccess(in ComponentName component, int userId)46 PendingIntent requestNotificationAccess(in ComponentName component, int userId); 47 48 /** @deprecated */ isDeviceAssociatedForWifiConnection(in String packageName, in String macAddress, int userId)49 boolean isDeviceAssociatedForWifiConnection(in String packageName, in String macAddress, 50 int userId); 51 registerDevicePresenceListenerService(in String deviceAddress, in String callingPackage, int userId)52 void registerDevicePresenceListenerService(in String deviceAddress, in String callingPackage, 53 int userId); 54 unregisterDevicePresenceListenerService(in String deviceAddress, in String callingPackage, int userId)55 void unregisterDevicePresenceListenerService(in String deviceAddress, in String callingPackage, 56 int userId); 57 58 /** @deprecated */ canPairWithoutPrompt(in String packageName, in String deviceMacAddress, int userId)59 boolean canPairWithoutPrompt(in String packageName, in String deviceMacAddress, int userId); 60 61 /** @deprecated */ createAssociation(in String packageName, in String macAddress, int userId, in byte[] certificate)62 void createAssociation(in String packageName, in String macAddress, int userId, 63 in byte[] certificate); 64 dispatchMessage(in int messageId, in int associationId, in byte[] message)65 void dispatchMessage(in int messageId, in int associationId, in byte[] message); 66 addOnAssociationsChangedListener(IOnAssociationsChangedListener listener, int userId)67 void addOnAssociationsChangedListener(IOnAssociationsChangedListener listener, int userId); 68 removeOnAssociationsChangedListener(IOnAssociationsChangedListener listener, int userId)69 void removeOnAssociationsChangedListener(IOnAssociationsChangedListener listener, int userId); 70 notifyDeviceAppeared(int associationId)71 void notifyDeviceAppeared(int associationId); 72 notifyDeviceDisappeared(int associationId)73 void notifyDeviceDisappeared(int associationId); 74 } 75