Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.hardware.gnss@1.0; |
| 18 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 19 | /** GNSS Network Initiated callback interface. */ |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 20 | interface IGnssNiCallback { |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 21 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 22 | * GnssNiType constants |
| 23 | */ |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 24 | @export(name="", value_prefix="GPS_NI_TYPE_") |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 25 | enum GnssNiType : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 26 | VOICE = 1, |
| 27 | UMTS_SUPL = 2, |
Wyatt Riley | 0442918 | 2017-04-21 06:52:42 -0700 | [diff] [blame] | 28 | UMTS_CTRL_PLANE = 3, |
| 29 | EMERGENCY_SUPL = 4 |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 30 | }; |
| 31 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 32 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 33 | * GnssNiNotifyFlags constants |
| 34 | */ |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 35 | @export(name="", value_prefix="GPS_NI_") |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 36 | 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 45 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 46 | * GNSS NI responses, used to define the response in |
| 47 | * NI structures |
| 48 | */ |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 49 | @export(name="", value_prefix="GPS_NI_") |
Hridya Valsaraju | 97ecaa0 | 2016-11-02 10:20:07 -0700 | [diff] [blame] | 50 | enum GnssUserResponseType : uint8_t { |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 51 | RESPONSE_ACCEPT = 1, |
| 52 | RESPONSE_DENY = 2, |
| 53 | RESPONSE_NORESP = 3, |
| 54 | }; |
| 55 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 56 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 57 | * NI data encoding scheme |
| 58 | */ |
Hridya Valsaraju | 529331c | 2016-11-22 08:17:23 -0800 | [diff] [blame] | 59 | @export(name="", value_prefix="GPS_") |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 60 | 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 70 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 71 | * An ID generated by HAL to associate NI notifications and UI |
| 72 | * responses. |
| 73 | */ |
| 74 | int32_t notificationId; |
| 75 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 76 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 77 | * A type used to distinguish different categories of NI |
| 78 | * events, such as VOICE, UMTS_SUPL etc. |
| 79 | */ |
| 80 | GnssNiType niType; |
| 81 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 82 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 83 | * Notification/verification options, combinations of GnssNiNotifyFlags |
| 84 | * constants. |
| 85 | */ |
Yifan Hong | 7037fdb | 2016-12-05 17:16:09 -0800 | [diff] [blame] | 86 | bitfield<GnssNiNotifyFlags> notifyFlags; |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 87 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 88 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 89 | * 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 Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 94 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 95 | * Default response when timeout. |
| 96 | */ |
| 97 | GnssUserResponseType defaultResponse; |
| 98 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 99 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 100 | * String representing the requester of the network inititated location |
| 101 | * request. |
| 102 | */ |
| 103 | string requestorId; |
| 104 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 105 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 106 | * Notification message. String representing the service(for eg. SUPL-service) |
| 107 | * who sent the network initiated location request. |
| 108 | */ |
| 109 | string notificationMessage; |
| 110 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 111 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 112 | * requestorId decoding scheme. |
| 113 | */ |
| 114 | GnssNiEncodingType requestorIdEncoding; |
| 115 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 116 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 117 | * notificationId decoding scheme |
| 118 | */ |
| 119 | GnssNiEncodingType notificationIdEncoding; |
| 120 | }; |
| 121 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 122 | /** |
Hridya Valsaraju | e596a71 | 2016-09-22 14:07:22 -0700 | [diff] [blame] | 123 | * Callback with a network initiated request. |
| 124 | * |
| 125 | * @param notification network initiated request. |
| 126 | */ |
| 127 | niNotifyCb(GnssNiNotification notification); |
| 128 | }; |