Colin Cross | a866695 | 2010-04-13 19:20:44 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 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 | |
Tom Cherry | 81f5d3e | 2017-06-22 12:53:17 -0700 | [diff] [blame] | 17 | #include "keychords.h" |
| 18 | |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 19 | #include <dirent.h> |
Colin Cross | a866695 | 2010-04-13 19:20:44 -0700 | [diff] [blame] | 20 | #include <fcntl.h> |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 21 | #include <linux/input.h> |
| 22 | #include <sys/cdefs.h> |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 23 | #include <sys/inotify.h> |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 24 | #include <sys/ioctl.h> |
Colin Cross | a866695 | 2010-04-13 19:20:44 -0700 | [diff] [blame] | 25 | #include <sys/types.h> |
Olivier Bailly | b93e581 | 2010-11-17 11:47:23 -0800 | [diff] [blame] | 26 | #include <unistd.h> |
Colin Cross | a866695 | 2010-04-13 19:20:44 -0700 | [diff] [blame] | 27 | |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 28 | #include <algorithm> |
| 29 | #include <functional> |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 30 | #include <map> |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 31 | #include <memory> |
| 32 | #include <string> |
| 33 | #include <vector> |
| 34 | |
Tom Cherry | 3f5eaae5 | 2017-04-06 16:30:22 -0700 | [diff] [blame] | 35 | #include <android-base/logging.h> |
Tom Cherry | 81f5d3e | 2017-06-22 12:53:17 -0700 | [diff] [blame] | 36 | |
| 37 | namespace android { |
| 38 | namespace init { |
Colin Cross | a866695 | 2010-04-13 19:20:44 -0700 | [diff] [blame] | 39 | |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 40 | Keychords::Keychords() : epoll_(nullptr), inotify_fd_(-1) {} |
Colin Cross | a866695 | 2010-04-13 19:20:44 -0700 | [diff] [blame] | 41 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 42 | Keychords::~Keychords() noexcept { |
| 43 | if (inotify_fd_ >= 0) { |
| 44 | epoll_->UnregisterHandler(inotify_fd_); |
| 45 | ::close(inotify_fd_); |
Colin Cross | f7ca604 | 2011-01-04 18:18:45 -0800 | [diff] [blame] | 46 | } |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 47 | while (!registration_.empty()) GeteventCloseDevice(registration_.begin()->first); |
| 48 | } |
Colin Cross | f7ca604 | 2011-01-04 18:18:45 -0800 | [diff] [blame] | 49 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 50 | Keychords::Mask::Mask(size_t bit) : bits_((bit + sizeof(mask_t) - 1) / sizeof(mask_t), 0) {} |
| 51 | |
| 52 | void Keychords::Mask::SetBit(size_t bit, bool value) { |
| 53 | auto idx = bit / (kBitsPerByte * sizeof(mask_t)); |
| 54 | if (idx >= bits_.size()) return; |
| 55 | if (value) { |
| 56 | bits_[idx] |= mask_t(1) << (bit % (kBitsPerByte * sizeof(mask_t))); |
| 57 | } else { |
| 58 | bits_[idx] &= ~(mask_t(1) << (bit % (kBitsPerByte * sizeof(mask_t)))); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 59 | } |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 60 | } |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 61 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 62 | bool Keychords::Mask::GetBit(size_t bit) const { |
| 63 | auto idx = bit / (kBitsPerByte * sizeof(mask_t)); |
| 64 | return bits_[idx] & (mask_t(1) << (bit % (kBitsPerByte * sizeof(mask_t)))); |
| 65 | } |
| 66 | |
| 67 | size_t Keychords::Mask::bytesize() const { |
| 68 | return bits_.size() * sizeof(mask_t); |
| 69 | } |
| 70 | |
| 71 | void* Keychords::Mask::data() { |
| 72 | return bits_.data(); |
| 73 | } |
| 74 | |
| 75 | size_t Keychords::Mask::size() const { |
| 76 | return bits_.size() * sizeof(mask_t) * kBitsPerByte; |
| 77 | } |
| 78 | |
| 79 | void Keychords::Mask::resize(size_t bit) { |
| 80 | auto idx = bit / (kBitsPerByte * sizeof(mask_t)); |
| 81 | if (idx >= bits_.size()) { |
| 82 | bits_.resize(idx + 1, 0); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 83 | } |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 84 | } |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 85 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 86 | Keychords::Mask::operator bool() const { |
| 87 | for (size_t i = 0; i < bits_.size(); ++i) { |
| 88 | if (bits_[i]) return true; |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 89 | } |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 90 | return false; |
| 91 | } |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 92 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 93 | Keychords::Mask Keychords::Mask::operator&(const Keychords::Mask& rval) const { |
| 94 | auto len = std::min(bits_.size(), rval.bits_.size()); |
| 95 | Keychords::Mask ret; |
| 96 | ret.bits_.resize(len); |
| 97 | for (size_t i = 0; i < len; ++i) { |
| 98 | ret.bits_[i] = bits_[i] & rval.bits_[i]; |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 99 | } |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 100 | return ret; |
| 101 | } |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 102 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 103 | void Keychords::Mask::operator|=(const Keychords::Mask& rval) { |
| 104 | auto len = rval.bits_.size(); |
| 105 | bits_.resize(len); |
| 106 | for (size_t i = 0; i < len; ++i) { |
| 107 | bits_[i] |= rval.bits_[i]; |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 108 | } |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 109 | } |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 110 | |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 111 | Keychords::Entry::Entry() : notified(false) {} |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 112 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 113 | void Keychords::LambdaCheck() { |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 114 | for (auto& [keycodes, entry] : entries_) { |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 115 | auto found = true; |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 116 | for (auto& code : keycodes) { |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 117 | if (!current_.GetBit(code)) { |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 118 | entry.notified = false; |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 119 | found = false; |
| 120 | break; |
| 121 | } |
| 122 | } |
| 123 | if (!found) continue; |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 124 | if (entry.notified) continue; |
| 125 | entry.notified = true; |
| 126 | handler_(keycodes); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 127 | } |
| 128 | } |
| 129 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 130 | void Keychords::LambdaHandler(int fd) { |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 131 | input_event event; |
| 132 | auto res = TEMP_FAILURE_RETRY(::read(fd, &event, sizeof(event))); |
| 133 | if ((res != sizeof(event)) || (event.type != EV_KEY)) return; |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 134 | current_.SetBit(event.code, event.value); |
| 135 | LambdaCheck(); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 136 | } |
| 137 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 138 | bool Keychords::GeteventEnable(int fd) { |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 139 | // Make sure it is an event channel, should pass this ioctl call |
| 140 | int version; |
| 141 | if (::ioctl(fd, EVIOCGVERSION, &version)) return false; |
| 142 | |
Mark Salyzyn | eca2507 | 2018-05-16 15:10:24 -0700 | [diff] [blame] | 143 | #ifdef EVIOCSMASK |
| 144 | static auto EviocsmaskSupported = true; |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 145 | if (EviocsmaskSupported) { |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 146 | Keychords::Mask mask(EV_KEY); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 147 | mask.SetBit(EV_KEY); |
| 148 | input_mask msg = {}; |
| 149 | msg.type = EV_SYN; |
| 150 | msg.codes_size = mask.bytesize(); |
| 151 | msg.codes_ptr = reinterpret_cast<uintptr_t>(mask.data()); |
| 152 | if (::ioctl(fd, EVIOCSMASK, &msg) == -1) { |
| 153 | PLOG(WARNING) << "EVIOCSMASK not supported"; |
| 154 | EviocsmaskSupported = false; |
| 155 | } |
| 156 | } |
Mark Salyzyn | eca2507 | 2018-05-16 15:10:24 -0700 | [diff] [blame] | 157 | #endif |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 158 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 159 | Keychords::Mask mask; |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 160 | for (auto& [keycodes, entry] : entries_) { |
| 161 | for (auto& code : keycodes) { |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 162 | mask.resize(code); |
| 163 | mask.SetBit(code); |
| 164 | } |
| 165 | } |
| 166 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 167 | current_.resize(mask.size()); |
| 168 | Keychords::Mask available(mask.size()); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 169 | auto res = ::ioctl(fd, EVIOCGBIT(EV_KEY, available.bytesize()), available.data()); |
| 170 | if (res == -1) return false; |
| 171 | if (!(available & mask)) return false; |
| 172 | |
Mark Salyzyn | eca2507 | 2018-05-16 15:10:24 -0700 | [diff] [blame] | 173 | #ifdef EVIOCSMASK |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 174 | if (EviocsmaskSupported) { |
| 175 | input_mask msg = {}; |
| 176 | msg.type = EV_KEY; |
| 177 | msg.codes_size = mask.bytesize(); |
| 178 | msg.codes_ptr = reinterpret_cast<uintptr_t>(mask.data()); |
| 179 | ::ioctl(fd, EVIOCSMASK, &msg); |
| 180 | } |
Mark Salyzyn | eca2507 | 2018-05-16 15:10:24 -0700 | [diff] [blame] | 181 | #endif |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 182 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 183 | Keychords::Mask set(mask.size()); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 184 | res = ::ioctl(fd, EVIOCGKEY(res), set.data()); |
| 185 | if (res > 0) { |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 186 | current_ |= mask & available & set; |
| 187 | LambdaCheck(); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 188 | } |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 189 | epoll_->RegisterHandler(fd, [this, fd]() { this->LambdaHandler(fd); }); |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 190 | return true; |
| 191 | } |
| 192 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 193 | void Keychords::GeteventOpenDevice(const std::string& device) { |
| 194 | if (registration_.count(device)) return; |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 195 | auto fd = TEMP_FAILURE_RETRY(::open(device.c_str(), O_RDWR | O_CLOEXEC)); |
| 196 | if (fd == -1) { |
| 197 | PLOG(ERROR) << "Can not open " << device; |
| 198 | return; |
| 199 | } |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 200 | if (!GeteventEnable(fd)) { |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 201 | ::close(fd); |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 202 | } else { |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 203 | registration_.emplace(device, fd); |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 204 | } |
| 205 | } |
| 206 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 207 | void Keychords::GeteventCloseDevice(const std::string& device) { |
| 208 | auto it = registration_.find(device); |
| 209 | if (it == registration_.end()) return; |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 210 | auto fd = (*it).second; |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 211 | epoll_->UnregisterHandler(fd); |
| 212 | registration_.erase(it); |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 213 | ::close(fd); |
| 214 | } |
| 215 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 216 | void Keychords::InotifyHandler() { |
| 217 | unsigned char buf[512]; // History shows 32-64 bytes typical |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 218 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 219 | auto res = TEMP_FAILURE_RETRY(::read(inotify_fd_, buf, sizeof(buf))); |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 220 | if (res < 0) { |
| 221 | PLOG(WARNING) << "could not get event"; |
| 222 | return; |
| 223 | } |
| 224 | |
| 225 | auto event_buf = buf; |
| 226 | while (static_cast<size_t>(res) >= sizeof(inotify_event)) { |
| 227 | auto event = reinterpret_cast<inotify_event*>(event_buf); |
| 228 | auto event_size = sizeof(inotify_event) + event->len; |
| 229 | if (static_cast<size_t>(res) < event_size) break; |
| 230 | if (event->len) { |
| 231 | std::string devname(kDevicePath); |
| 232 | devname += '/'; |
| 233 | devname += event->name; |
| 234 | if (event->mask & IN_CREATE) { |
| 235 | GeteventOpenDevice(devname); |
| 236 | } else { |
| 237 | GeteventCloseDevice(devname); |
| 238 | } |
| 239 | } |
| 240 | res -= event_size; |
| 241 | event_buf += event_size; |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 242 | } |
| 243 | } |
| 244 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 245 | void Keychords::GeteventOpenDevice() { |
| 246 | inotify_fd_ = ::inotify_init1(IN_NONBLOCK | IN_CLOEXEC); |
| 247 | if (inotify_fd_ < 0) { |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 248 | PLOG(WARNING) << "Could not instantiate inotify for " << kDevicePath; |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 249 | } else if (::inotify_add_watch(inotify_fd_, kDevicePath, IN_DELETE | IN_CREATE | IN_ONLYDIR) < |
| 250 | 0) { |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 251 | PLOG(WARNING) << "Could not add watch for " << kDevicePath; |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 252 | ::close(inotify_fd_); |
| 253 | inotify_fd_ = -1; |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 254 | } |
Mark Salyzyn | 44692de | 2018-05-02 11:22:15 -0700 | [diff] [blame] | 255 | |
| 256 | std::unique_ptr<DIR, decltype(&closedir)> device(opendir(kDevicePath), closedir); |
| 257 | if (device) { |
| 258 | dirent* entry; |
| 259 | while ((entry = readdir(device.get()))) { |
| 260 | if (entry->d_name[0] == '.') continue; |
| 261 | std::string devname(kDevicePath); |
| 262 | devname += '/'; |
| 263 | devname += entry->d_name; |
| 264 | GeteventOpenDevice(devname); |
| 265 | } |
| 266 | } |
| 267 | |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 268 | if (inotify_fd_ >= 0) { |
| 269 | epoll_->RegisterHandler(inotify_fd_, [this]() { this->InotifyHandler(); }); |
| 270 | } |
Mark Salyzyn | 353bf1f | 2018-04-30 07:33:31 -0700 | [diff] [blame] | 271 | } |
| 272 | |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 273 | void Keychords::Register(const std::vector<int>& keycodes) { |
| 274 | if (keycodes.empty()) return; |
| 275 | entries_.try_emplace(keycodes, Entry()); |
Mark Salyzyn | eca2507 | 2018-05-16 15:10:24 -0700 | [diff] [blame] | 276 | } |
| 277 | |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 278 | void Keychords::Start(Epoll* epoll, std::function<void(const std::vector<int>&)> handler) { |
Mark Salyzyn | 06aeb41 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 279 | epoll_ = epoll; |
| 280 | handler_ = handler; |
Mark Salyzyn | 1385725 | 2018-05-18 15:25:15 -0700 | [diff] [blame] | 281 | if (entries_.size()) GeteventOpenDevice(); |
Colin Cross | a866695 | 2010-04-13 19:20:44 -0700 | [diff] [blame] | 282 | } |
Tom Cherry | 81f5d3e | 2017-06-22 12:53:17 -0700 | [diff] [blame] | 283 | |
| 284 | } // namespace init |
| 285 | } // namespace android |