1 /* 2 * Copyright 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.hardware.location; 18 19 import android.app.PendingIntent; 20 import android.hardware.location.NanoAppMessage; 21 import android.hardware.location.IContextHubTransactionCallback; 22 23 /** 24 * @hide 25 */ 26 interface IContextHubClient { 27 // Sends a message to a nanoapp. sendMessageToNanoApp(in NanoAppMessage message)28 int sendMessageToNanoApp(in NanoAppMessage message); 29 30 // Closes the connection with the Context Hub. close()31 void close(); 32 33 // Returns the unique ID for this client. getId()34 int getId(); 35 36 // Notify the framework that a client callback has finished executing. callbackFinished()37 void callbackFinished(); 38 39 // Notify the framework that a reliable message client callback has 40 // finished executing. reliableMessageCallbackFinished(int messageSequenceNumber, byte errorCode)41 void reliableMessageCallbackFinished(int messageSequenceNumber, byte errorCode); 42 43 /** 44 * Sends a reliable message to a nanoapp. 45 * 46 * @param message The message to send. 47 * @param transactionCallback The transaction callback for reliable message. 48 */ sendReliableMessageToNanoApp( in NanoAppMessage message, in IContextHubTransactionCallback transactionCallback)49 int sendReliableMessageToNanoApp( 50 in NanoAppMessage message, 51 in IContextHubTransactionCallback transactionCallback); 52 } 53