1 /*
2  * Copyright (C) 2010 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 #ifndef ANDROID_SENSOR_REGISTRATION_INFO_H
18 #define ANDROID_SENSOR_REGISTRATION_INFO_H
19 
20 namespace android {
21 
22 class SensorService;
23 
24 struct SensorService::SensorRegistrationInfo {
25     int32_t mSensorHandle;
26     String8 mPackageName;
27     bool mActivated;
28     int32_t mSamplingRateUs;
29     int32_t mMaxReportLatencyUs;
30     int32_t mHour, mMin, mSec;
31 
SensorRegistrationInfoSensorRegistrationInfo32     SensorRegistrationInfo() : mPackageName() {
33         mSensorHandle = mSamplingRateUs = mMaxReportLatencyUs = INT32_MIN;
34         mHour = mMin = mSec = INT32_MIN;
35         mActivated = false;
36     }
37 
isSentinelSensorRegistrationInfo38     static bool isSentinel(const SensorRegistrationInfo& info) {
39        return (info.mHour == INT32_MIN &&
40                info.mMin == INT32_MIN &&
41                info.mSec == INT32_MIN);
42     }
43 };
44 
45 } // namespace android;
46 
47 #endif // ANDROID_SENSOR_REGISTRATION_INFO_H
48 
49 
50