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.IFindDeviceCallback; 21 import android.companion.Association; 22 import android.companion.AssociationRequest; 23 import android.content.ComponentName; 24 25 /** 26 * Interface for communication with the core companion device manager service. 27 * 28 * @hide 29 */ 30 interface ICompanionDeviceManager { associate(in AssociationRequest request, in IFindDeviceCallback callback, in String callingPackage)31 void associate(in AssociationRequest request, 32 in IFindDeviceCallback callback, 33 in String callingPackage); stopScan(in AssociationRequest request, in IFindDeviceCallback callback, in String callingPackage)34 void stopScan(in AssociationRequest request, 35 in IFindDeviceCallback callback, 36 in String callingPackage); 37 getAssociations(String callingPackage, int userId)38 List<String> getAssociations(String callingPackage, int userId); getAssociationsForUser(int userId)39 List<Association> getAssociationsForUser(int userId); 40 disassociate(String deviceMacAddress, String callingPackage)41 void disassociate(String deviceMacAddress, String callingPackage); 42 hasNotificationAccess(in ComponentName component)43 boolean hasNotificationAccess(in ComponentName component); requestNotificationAccess(in ComponentName component)44 PendingIntent requestNotificationAccess(in ComponentName component); 45 isDeviceAssociatedForWifiConnection(in String packageName, in String macAddress, int userId)46 boolean isDeviceAssociatedForWifiConnection(in String packageName, in String macAddress, 47 int userId); 48 registerDevicePresenceListenerService(in String packageName, in String deviceAddress)49 void registerDevicePresenceListenerService(in String packageName, in String deviceAddress); 50 unregisterDevicePresenceListenerService(in String packageName, in String deviceAddress)51 void unregisterDevicePresenceListenerService(in String packageName, in String deviceAddress); 52 canPairWithoutPrompt(in String packageName, in String deviceMacAddress, int userId)53 boolean canPairWithoutPrompt(in String packageName, in String deviceMacAddress, int userId); 54 createAssociation(in String packageName, in String macAddress, int userId, in byte[] certificate)55 void createAssociation(in String packageName, in String macAddress, int userId, 56 in byte[] certificate); 57 } 58