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  */
15 package com.android.bluetooth;
16 
17 import android.bluetooth.BluetoothDevice;
18 import android.bluetooth.BluetoothSocket;
19 
20 public 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. FALSE otherwise
28      */
onConnect(BluetoothDevice device, BluetoothSocket socket)29     boolean onConnect(BluetoothDevice device, BluetoothSocket socket);
30 
31     /**
32      * Will be called in case the accept call fails. When called, at lease one of the accept threads
33      * are about to terminate. The behavior needed is to shutdown the ObexServerSockets object, and
34      * create a new one.
35      */
onAcceptFailed()36     void onAcceptFailed();
37 }
38