• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2017, The Linux Foundation. All rights reserved.
3  * Not a Contribution
4  */
5 /*
6  * Copyright (C) 2016 The Android Open Source Project
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
22 #define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
23 
24 #include <android/hardware/gnss/1.0/IGnssMeasurement.h>
25 #include <hidl/Status.h>
26 
27 namespace android {
28 namespace hardware {
29 namespace gnss {
30 namespace V1_0 {
31 namespace implementation {
32 
33 using ::android::hardware::gnss::V1_0::IGnssMeasurement;
34 using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback;
35 using ::android::hardware::Return;
36 using ::android::hardware::Void;
37 using ::android::hardware::hidl_vec;
38 using ::android::hardware::hidl_string;
39 using ::android::sp;
40 
41 class GnssMeasurementAPIClient;
42 struct GnssMeasurement : public IGnssMeasurement {
43     GnssMeasurement();
44     ~GnssMeasurement();
45 
46     /*
47      * Methods from ::android::hardware::gnss::V1_0::IGnssMeasurement follow.
48      * These declarations were generated from IGnssMeasurement.hal.
49      */
50     Return<GnssMeasurementStatus> setCallback(
51         const sp<IGnssMeasurementCallback>& callback) override;
52     Return<void> close() override;
53 
54  private:
55     struct GnssMeasurementDeathRecipient : hidl_death_recipient {
GnssMeasurementDeathRecipientGnssMeasurement::GnssMeasurementDeathRecipient56         GnssMeasurementDeathRecipient(sp<GnssMeasurement> gnssMeasurement) :
57             mGnssMeasurement(gnssMeasurement) {
58         }
59         ~GnssMeasurementDeathRecipient() = default;
60         virtual void serviceDied(uint64_t cookie, const wp<IBase>& who) override;
61         sp<GnssMeasurement> mGnssMeasurement;
62     };
63 
64  private:
65     sp<GnssMeasurementDeathRecipient> mGnssMeasurementDeathRecipient = nullptr;
66     sp<IGnssMeasurementCallback> mGnssMeasurementCbIface = nullptr;
67     GnssMeasurementAPIClient* mApi;
68 };
69 
70 }  // namespace implementation
71 }  // namespace V1_0
72 }  // namespace gnss
73 }  // namespace hardware
74 }  // namespace android
75 
76 #endif  // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H
77