1 /*
2  * Copyright (C) 2020 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_OS_TEMPERATURE_H
18 #define ANDROID_OS_TEMPERATURE_H
19 
20 #include <binder/Parcelable.h>
21 #include <utils/RefBase.h>
22 
23 namespace android {
24 namespace os {
25 
26 /**
27  * Temperature is a structure to encapsulate temperature status.
28  */
29 struct Temperature : public android::Parcelable {
30     /** Temperature value */
31     float mValue;
32     /** A Temperature type from ThermalHAL */
33     int32_t mType;
34     /** Name of this Temperature */
35     String16 mName;
36     /** The level of the sensor is currently in throttling */
37     int32_t mStatus;
38 
TemperatureTemperature39     Temperature()
40         : mValue(0.0f),
41           mType(0),
42           mName(""),
43           mStatus(0) {
44     }
45 
46     virtual status_t readFromParcel(const android::Parcel* parcel) override;
47     virtual status_t writeToParcel(android::Parcel* parcel) const override;
48 };
49 
50 } // namespace os
51 } // namespace android
52 
53 #endif /* ANDROID_OS_TEMPERATURE_H */
54