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