1/* 2* Copyright (C) 2014 Samsung System LSI 3* Licensed under the Apache License, Version 2.0 (the "License"); 4* you may not use this file except in compliance with the License. 5* You may obtain a copy of the License at 6* 7* http://www.apache.org/licenses/LICENSE-2.0 8* 9* Unless required by applicable law or agreed to in writing, software 10* distributed under the License is distributed on an "AS IS" BASIS, 11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12* See the License for the specific language governing permissions and 13* limitations under the License. 14*/ 15package com.android.bluetooth; 16 17import android.bluetooth.BluetoothDevice; 18import android.bluetooth.BluetoothSocket; 19 20public interface IObexConnectionHandler { 21 22 /** 23 * Called to validate if a connection to the Bluetooth device should be accepted. 24 * 25 * @param device the connecting BluetoothDevice. Use .getType() to determine the type of 26 * connection. 27 * @return Shall return TRUE if the connection should be accepted. 28 * FALSE otherwise 29 */ 30 public boolean onConnect(BluetoothDevice device, BluetoothSocket socket); 31 32 /** 33 * Will be called in case the accept call fails. 34 * When called, at lease one of the accept threads are about to terminate. 35 * The behavior needed is to shutdown the ObexServerSockets object, and create a 36 * new one. 37 */ 38 public void onAcceptFailed(); 39} 40