11af4b0280af406cfc7eb46810f6b76e57b983e11destradaa/* 21af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Copyright (C) 2013, The Android Open Source Project 31af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 41af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Licensed under the Apache License, Version 2.0 (the "License"); 51af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * you may not use this file except in compliance with the License. 61af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * You may obtain a copy of the License at 71af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 81af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * http://www.apache.org/license/LICENSE-2.0 91af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 101af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Unless required by applicable law or agreed to in writing, software 111af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * distributed under the License is distributed on an "AS IS" BASIS, 121af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 131af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * See the License for the specific language governing permissions and 141af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * limitations under the License. 151af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 161af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 171af4b0280af406cfc7eb46810f6b76e57b983e11destradaapackage android.hardware.location; 181af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 191af4b0280af406cfc7eb46810f6b76e57b983e11destradaaimport android.hardware.location.IFusedLocationHardwareSink; 201af4b0280af406cfc7eb46810f6b76e57b983e11destradaaimport android.location.FusedBatchOptions; 211af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 221af4b0280af406cfc7eb46810f6b76e57b983e11destradaa/** 231af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Fused Location hardware interface. 241af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * This interface is the basic set of supported functionality by Fused Hardware 251af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * modules that offer Location batching capabilities. 261af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 271af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @hide 281af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 291af4b0280af406cfc7eb46810f6b76e57b983e11destradaainterface IFusedLocationHardware { 301af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 311af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Registers a sink with the Location Hardware object. 321af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 331af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param eventSink The sink to register. 341af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 35fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void registerSink(in IFusedLocationHardwareSink eventSink) = 0; 361af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 371af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 381af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Unregisters a sink with the Location Hardware object. 391af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 401af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param eventSink The sink to unregister. 411af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 42fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void unregisterSink(in IFusedLocationHardwareSink eventSink) = 1; 431af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 441af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 451af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Provides access to the batch size available in Hardware. 461af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 471af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @return The batch size the hardware supports. 481af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 49fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie int getSupportedBatchSize() = 2; 501af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 511af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 521af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Requests the Hardware to start batching locations. 531af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 541af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param id An Id associated with the request. 551af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param batchOptions The options required for batching. 561af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 571af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @throws RuntimeException if the request Id exists. 581af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 59fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void startBatching(in int id, in FusedBatchOptions batchOptions) = 3; 601af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 611af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 621af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Requests the Hardware to stop batching for the given Id. 631af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 641af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param id The request that needs to be stopped. 651af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @throws RuntimeException if the request Id is unknown. 661af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 67fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void stopBatching(in int id) = 4; 681af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 691af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 701af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Updates a batching operation in progress. 711af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 721af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param id The Id of the operation to update. 731af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param batchOptions The options to apply to the given operation. 741af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 751af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @throws RuntimeException if the Id of the request is unknown. 761af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 77fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void updateBatchingOptions(in int id, in FusedBatchOptions batchOptions) = 5; 781af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 791af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 801af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Requests the most recent locations available in Hardware. 811af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * This operation does not dequeue the locations, so still other batching 821af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * events will continue working. 831af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 841af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param batchSizeRequested The number of locations requested. 851af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 86fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void requestBatchOfLocations(in int batchSizeRequested) = 6; 871af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 881af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 891af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Flags if the Hardware supports injection of diagnostic data. 901af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 911af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @return True if data injection is supported, false otherwise. 921af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 93fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie boolean supportsDiagnosticDataInjection() = 7; 941af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 951af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 961af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Injects diagnostic data into the Hardware subsystem. 971af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 981af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param data The data to inject. 991af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @throws RuntimeException if injection is not supported. 1001af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 101fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void injectDiagnosticData(in String data) = 8; 1021af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 1031af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 1041af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Flags if the Hardware supports injection of device context information. 1051af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 1061af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @return True if device context injection is supported, false otherwise. 1071af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 108fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie boolean supportsDeviceContextInjection() = 9; 1091af4b0280af406cfc7eb46810f6b76e57b983e11destradaa 1101af4b0280af406cfc7eb46810f6b76e57b983e11destradaa /** 1111af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * Injects device context information into the Hardware subsystem. 1121af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * 1131af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @param deviceEnabledContext The context to inject. 1141af4b0280af406cfc7eb46810f6b76e57b983e11destradaa * @throws RuntimeException if injection is not supported. 1151af4b0280af406cfc7eb46810f6b76e57b983e11destradaa */ 116fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void injectDeviceContext(in int deviceEnabledContext) = 10; 117fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie 118fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie /** 119fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie * Requests all batched locations currently available in Hardware 120fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie * and clears the buffer. Any subsequent calls will not return any 121fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie * of the locations returned in this call. 122fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie */ 123fff30439cafb737eb54de807caab4fb61432f2ccDavid Christie void flushBatchedLocations() = 11; 124cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1David Christie 125cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1David Christie /** 126cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1David Christie * Returns the version of this FLP HAL implementation. 127cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1David Christie */ 128cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1David Christie int getVersion() = 12; 1291af4b0280af406cfc7eb46810f6b76e57b983e11destradaa} 130