blob: 163ba25d3377eedce1cbedaf785bfb09d6444e1b [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,
28 UMTS_CTRL_PLANE = 3
29 };
30
Andreas Huber40d3a9b2017-03-28 16:19:16 -070031 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070032 * GnssNiNotifyFlags constants
33 */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080034 @export(name="", value_prefix="GPS_NI_")
Hridya Valsarajue596a712016-09-22 14:07:22 -070035 enum GnssNiNotifyFlags : uint32_t {
36 /** NI requires notification */
37 NEED_NOTIFY = 0x0001,
38 /** NI requires verification */
39 NEED_VERIFY = 0x0002,
40 /** NI requires privacy override, no notification/minimal trace */
41 PRIVACY_OVERRIDE = 0x0004,
42 };
43
Andreas Huber40d3a9b2017-03-28 16:19:16 -070044 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070045 * GNSS NI responses, used to define the response in
46 * NI structures
47 */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080048 @export(name="", value_prefix="GPS_NI_")
Hridya Valsaraju97ecaa02016-11-02 10:20:07 -070049 enum GnssUserResponseType : uint8_t {
Hridya Valsarajue596a712016-09-22 14:07:22 -070050 RESPONSE_ACCEPT = 1,
51 RESPONSE_DENY = 2,
52 RESPONSE_NORESP = 3,
53 };
54
Andreas Huber40d3a9b2017-03-28 16:19:16 -070055 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070056 * NI data encoding scheme
57 */
Hridya Valsaraju529331c2016-11-22 08:17:23 -080058 @export(name="", value_prefix="GPS_")
Hridya Valsarajue596a712016-09-22 14:07:22 -070059 enum GnssNiEncodingType : int32_t {
60 ENC_NONE = 0,
61 ENC_SUPL_GSM_DEFAULT = 1,
62 ENC_SUPL_UTF8 = 2,
63 ENC_SUPL_UCS2 = 3,
64 ENC_UNKNOWN = -1,
65 };
66
67 /** Represents an NI request */
68 struct GnssNiNotification{
Andreas Huber40d3a9b2017-03-28 16:19:16 -070069 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070070 * An ID generated by HAL to associate NI notifications and UI
71 * responses.
72 */
73 int32_t notificationId;
74
Andreas Huber40d3a9b2017-03-28 16:19:16 -070075 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070076 * A type used to distinguish different categories of NI
77 * events, such as VOICE, UMTS_SUPL etc.
78 */
79 GnssNiType niType;
80
Andreas Huber40d3a9b2017-03-28 16:19:16 -070081 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070082 * Notification/verification options, combinations of GnssNiNotifyFlags
83 * constants.
84 */
Yifan Hong7037fdb2016-12-05 17:16:09 -080085 bitfield<GnssNiNotifyFlags> notifyFlags;
Hridya Valsarajue596a712016-09-22 14:07:22 -070086
Andreas Huber40d3a9b2017-03-28 16:19:16 -070087 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070088 * Timeout period to wait for user response.
89 * Set to 0 for no timeout limit. Specified in seconds.
90 */
91 uint32_t timeoutSec;
92
Andreas Huber40d3a9b2017-03-28 16:19:16 -070093 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070094 * Default response when timeout.
95 */
96 GnssUserResponseType defaultResponse;
97
Andreas Huber40d3a9b2017-03-28 16:19:16 -070098 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -070099 * String representing the requester of the network inititated location
100 * request.
101 */
102 string requestorId;
103
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700104 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700105 * Notification message. String representing the service(for eg. SUPL-service)
106 * who sent the network initiated location request.
107 */
108 string notificationMessage;
109
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700110 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700111 * requestorId decoding scheme.
112 */
113 GnssNiEncodingType requestorIdEncoding;
114
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700115 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700116 * notificationId decoding scheme
117 */
118 GnssNiEncodingType notificationIdEncoding;
119 };
120
Andreas Huber40d3a9b2017-03-28 16:19:16 -0700121 /**
Hridya Valsarajue596a712016-09-22 14:07:22 -0700122 * Callback with a network initiated request.
123 *
124 * @param notification network initiated request.
125 */
126 niNotifyCb(GnssNiNotification notification);
127};