blob: 3e3071a68a451fc39c7727d4cfbdac294745c59a [file] [log] [blame]
Hridya Valsarajue596a712016-09-22 14:07:22 -07001/*
2 * Copyright (C) 2016 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
17package android.hardware.gnss@1.0;
18
Andreas Huber40d3a9b2017-03-28 16:19:16 -070019/** GNSS Network Initiated callback interface. */
Hridya Valsarajue596a712016-09-22 14:07:22 -070020interface IGnssNiCallback {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070021 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070022 * GnssNiType constants
23 */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080024 @export(name="", value_prefix="GPS_NI_TYPE_")
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070025 enum GnssNiType : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070026 VOICE = 1,
27 UMTS_SUPL = 2,
Wyatt Riley04429182017-04-21 06:52:42 -070028 UMTS_CTRL_PLANE = 3,
29 EMERGENCY_SUPL = 4
Hridya Valsarajue596a712016-09-22 14:07:22 -070030 };
31
Andreas Huber40d3a9b2017-03-28 16:19:16 -070032 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070033 * GnssNiNotifyFlags constants
34 */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080035 @export(name="", value_prefix="GPS_NI_")
Hridya Valsarajue596a712016-09-22 14:07:22 -070036 enum GnssNiNotifyFlags : uint32_t {
37 /** NI requires notification */
38 NEED_NOTIFY = 0x0001,
39 /** NI requires verification */
40 NEED_VERIFY = 0x0002,
41 /** NI requires privacy override, no notification/minimal trace */
42 PRIVACY_OVERRIDE = 0x0004,
43 };
44
Andreas Huber40d3a9b2017-03-28 16:19:16 -070045 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070046 * GNSS NI responses, used to define the response in
47 * NI structures
48 */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080049 @export(name="", value_prefix="GPS_NI_")
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070050 enum GnssUserResponseType : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070051 RESPONSE_ACCEPT = 1,
52 RESPONSE_DENY = 2,
53 RESPONSE_NORESP = 3,
54 };
55
Andreas Huber40d3a9b2017-03-28 16:19:16 -070056 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070057 * NI data encoding scheme
58 */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080059 @export(name="", value_prefix="GPS_")
Hridya Valsarajue596a712016-09-22 14:07:22 -070060 enum GnssNiEncodingType : int32_t {
61 ENC_NONE = 0,
62 ENC_SUPL_GSM_DEFAULT = 1,
63 ENC_SUPL_UTF8 = 2,
64 ENC_SUPL_UCS2 = 3,
65 ENC_UNKNOWN = -1,
66 };
67
68 /** Represents an NI request */
69 struct GnssNiNotification{
Andreas Huber40d3a9b2017-03-28 16:19:16 -070070 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070071 * An ID generated by HAL to associate NI notifications and UI
72 * responses.
73 */
74 int32_t notificationId;
75
Andreas Huber40d3a9b2017-03-28 16:19:16 -070076 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070077 * A type used to distinguish different categories of NI
78 * events, such as VOICE, UMTS_SUPL etc.
79 */
80 GnssNiType niType;
81
Andreas Huber40d3a9b2017-03-28 16:19:16 -070082 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070083 * Notification/verification options, combinations of GnssNiNotifyFlags
84 * constants.
85 */
Yifan Hong7037fdb2016-12-05 17:16:09 -080086 bitfield<GnssNiNotifyFlags> notifyFlags;
Hridya Valsarajue596a712016-09-22 14:07:22 -070087
Andreas Huber40d3a9b2017-03-28 16:19:16 -070088 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070089 * Timeout period to wait for user response.
90 * Set to 0 for no timeout limit. Specified in seconds.
91 */
92 uint32_t timeoutSec;
93
Andreas Huber40d3a9b2017-03-28 16:19:16 -070094 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070095 * Default response when timeout.
96 */
97 GnssUserResponseType defaultResponse;
98
Andreas Huber40d3a9b2017-03-28 16:19:16 -070099 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700100 * String representing the requester of the network inititated location
101 * request.
102 */
103 string requestorId;
104
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700105 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700106 * Notification message. String representing the service(for eg. SUPL-service)
107 * who sent the network initiated location request.
108 */
109 string notificationMessage;
110
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700111 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700112 * requestorId decoding scheme.
113 */
114 GnssNiEncodingType requestorIdEncoding;
115
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700116 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700117 * notificationId decoding scheme
118 */
119 GnssNiEncodingType notificationIdEncoding;
120 };
121
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700122 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700123 * Callback with a network initiated request.
124 *
125 * @param notification network initiated request.
126 */
127 niNotifyCb(GnssNiNotification notification);
128};