Home | History | Annotate | Download | only in 2.0
      1 /*
      2  * Copyright (C) 2018 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.sensors@2.0;
     18 
     19 import @1.0::SensorInfo;
     20 
     21 interface ISensorsCallback {
     22     /**
     23      * Notify the framework that new dynamic sensors have been connected.
     24      *
     25      * If a dynamic sensor was previously connected and has not been
     26      * disconnected, then that sensor must not be included in sensorInfos.
     27      *
     28      * @param sensorInfos vector of SensorInfo for each dynamic sensor that
     29      *     was connected.
     30      */
     31     oneway onDynamicSensorsConnected(vec<SensorInfo> sensorInfos);
     32 
     33     /**
     34      * Notify the framework that previously connected dynamic sensors have been
     35      * disconnected.
     36      *
     37      * If a dynamic sensor was previously disconnected and has not been
     38      * reconnected, then that sensor must not be included in sensorHandles.
     39      *
     40      * The HAL must ensure that all sensor events from departing dynamic
     41      * sensors have been written to the Event FMQ before calling
     42      * onDynamicSensorsDisconnected.
     43      *
     44      * @param sensorHandles vector of sensor handles for each dynamic sensors
     45      *     that was disconnected.
     46      */
     47     oneway onDynamicSensorsDisconnected(vec<int32_t> sensorHandles);
     48 };
     49