Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [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 | #define LOG_TAG "incidentd" |
| 18 | |
| 19 | #include "Reporter.h" |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 20 | |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 21 | #include "Privacy.h" |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 22 | #include "report_directory.h" |
| 23 | #include "section_list.h" |
| 24 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 25 | #include <android/os/DropBoxManager.h> |
Yi Jin | 0a3406f | 2017-06-22 19:23:11 -0700 | [diff] [blame] | 26 | #include <private/android_filesystem_config.h> |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 27 | #include <utils/SystemClock.h> |
| 28 | |
| 29 | #include <sys/types.h> |
| 30 | #include <sys/stat.h> |
| 31 | #include <dirent.h> |
| 32 | #include <fcntl.h> |
| 33 | #include <errno.h> |
| 34 | |
| 35 | /** |
| 36 | * The directory where the incident reports are stored. |
| 37 | */ |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 38 | static const char* INCIDENT_DIRECTORY = "/data/misc/incidents/"; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 39 | |
Yi Jin | 0a3406f | 2017-06-22 19:23:11 -0700 | [diff] [blame] | 40 | // ================================================================================ |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 41 | ReportRequest::ReportRequest(const IncidentReportArgs& a, |
| 42 | const sp<IIncidentReportStatusListener> &l, int f) |
| 43 | :args(a), |
| 44 | listener(l), |
| 45 | fd(f), |
| 46 | err(NO_ERROR) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | ReportRequest::~ReportRequest() |
| 51 | { |
Yi Jin | 22769e0 | 2017-10-16 14:42:50 -0700 | [diff] [blame] | 52 | if (fd >= 0) { |
| 53 | // clean up the opened file descriptor |
| 54 | close(fd); |
| 55 | } |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 56 | } |
| 57 | |
Yi Jin | edfd5bb | 2017-09-06 17:09:11 -0700 | [diff] [blame] | 58 | bool |
| 59 | ReportRequest::ok() |
| 60 | { |
| 61 | return fd >= 0 && err == NO_ERROR; |
| 62 | } |
| 63 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 64 | // ================================================================================ |
| 65 | ReportRequestSet::ReportRequestSet() |
| 66 | :mRequests(), |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 67 | mSections(), |
Yi Jin | 3ec5cc7 | 2018-01-26 13:42:43 -0800 | [diff] [blame] | 68 | mMainFd(-1), |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 69 | mMainDest(-1), |
| 70 | mMetadata(), |
| 71 | mSectionStats() |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 72 | { |
| 73 | } |
| 74 | |
| 75 | ReportRequestSet::~ReportRequestSet() |
| 76 | { |
| 77 | } |
| 78 | |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 79 | // TODO: dedup on exact same args and fd, report the status back to listener! |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 80 | void |
| 81 | ReportRequestSet::add(const sp<ReportRequest>& request) |
| 82 | { |
| 83 | mRequests.push_back(request); |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 84 | mSections.merge(request->args); |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 85 | mMetadata.set_request_size(mMetadata.request_size() + 1); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | void |
| 89 | ReportRequestSet::setMainFd(int fd) |
| 90 | { |
| 91 | mMainFd = fd; |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 92 | mMetadata.set_use_dropbox(fd > 0); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 93 | } |
| 94 | |
Yi Jin | 3ec5cc7 | 2018-01-26 13:42:43 -0800 | [diff] [blame] | 95 | void |
| 96 | ReportRequestSet::setMainDest(int dest) |
| 97 | { |
| 98 | mMainDest = dest; |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 99 | PrivacySpec spec = PrivacySpec::new_spec(dest); |
| 100 | switch (spec.dest) { |
| 101 | case android::os::DEST_AUTOMATIC: |
| 102 | mMetadata.set_dest(IncidentMetadata_Destination_AUTOMATIC); |
| 103 | break; |
| 104 | case android::os::DEST_EXPLICIT: |
| 105 | mMetadata.set_dest(IncidentMetadata_Destination_EXPLICIT); |
| 106 | break; |
| 107 | case android::os::DEST_LOCAL: |
| 108 | mMetadata.set_dest(IncidentMetadata_Destination_LOCAL); |
| 109 | break; |
| 110 | } |
Yi Jin | 3ec5cc7 | 2018-01-26 13:42:43 -0800 | [diff] [blame] | 111 | } |
| 112 | |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 113 | bool |
| 114 | ReportRequestSet::containsSection(int id) { |
| 115 | return mSections.containsSection(id); |
| 116 | } |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 117 | |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 118 | IncidentMetadata::SectionStats* |
| 119 | ReportRequestSet::sectionStats(int id) { |
| 120 | if (mSectionStats.find(id) == mSectionStats.end()) { |
| 121 | auto stats = mMetadata.add_sections(); |
| 122 | stats->set_id(id); |
| 123 | mSectionStats[id] = stats; |
| 124 | } |
| 125 | return mSectionStats[id]; |
| 126 | } |
| 127 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 128 | // ================================================================================ |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 129 | Reporter::Reporter() : Reporter(INCIDENT_DIRECTORY) { isTest = false; }; |
| 130 | |
| 131 | Reporter::Reporter(const char* directory) |
| 132 | :batch() |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 133 | { |
| 134 | char buf[100]; |
| 135 | |
| 136 | // TODO: Make the max size smaller for user builds. |
| 137 | mMaxSize = 100 * 1024 * 1024; |
| 138 | mMaxCount = 100; |
| 139 | |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 140 | // string ends up with '/' is a directory |
| 141 | String8 dir = String8(directory); |
| 142 | if (directory[dir.size() - 1] != '/') dir += "/"; |
| 143 | mIncidentDirectory = dir.string(); |
| 144 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 145 | // There can't be two at the same time because it's on one thread. |
| 146 | mStartTime = time(NULL); |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 147 | strftime(buf, sizeof(buf), "incident-%Y%m%d-%H%M%S", localtime(&mStartTime)); |
| 148 | mFilename = mIncidentDirectory + buf; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | Reporter::~Reporter() |
| 152 | { |
| 153 | } |
| 154 | |
| 155 | Reporter::run_report_status_t |
| 156 | Reporter::runReport() |
| 157 | { |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 158 | status_t err = NO_ERROR; |
| 159 | bool needMainFd = false; |
| 160 | int mainFd = -1; |
Yi Jin | 3ec5cc7 | 2018-01-26 13:42:43 -0800 | [diff] [blame] | 161 | int mainDest = -1; |
Yi Jin | edfd5bb | 2017-09-06 17:09:11 -0700 | [diff] [blame] | 162 | HeaderSection headers; |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 163 | MetadataSection metadataSection; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 164 | |
| 165 | // See if we need the main file |
| 166 | for (ReportRequestSet::iterator it=batch.begin(); it!=batch.end(); it++) { |
| 167 | if ((*it)->fd < 0 && mainFd < 0) { |
| 168 | needMainFd = true; |
Yi Jin | 3ec5cc7 | 2018-01-26 13:42:43 -0800 | [diff] [blame] | 169 | mainDest = (*it)->args.dest(); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 170 | break; |
| 171 | } |
| 172 | } |
| 173 | if (needMainFd) { |
| 174 | // Create the directory |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 175 | if (!isTest) err = create_directory(mIncidentDirectory); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 176 | if (err != NO_ERROR) { |
Yi Jin | edfd5bb | 2017-09-06 17:09:11 -0700 | [diff] [blame] | 177 | goto DONE; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 178 | } |
| 179 | |
| 180 | // If there are too many files in the directory (for whatever reason), |
| 181 | // delete the oldest ones until it's under the limit. Doing this first |
| 182 | // does mean that we can go over, so the max size is not a hard limit. |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 183 | if (!isTest) clean_directory(mIncidentDirectory, mMaxSize, mMaxCount); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 184 | |
| 185 | // Open the file. |
| 186 | err = create_file(&mainFd); |
| 187 | if (err != NO_ERROR) { |
Yi Jin | edfd5bb | 2017-09-06 17:09:11 -0700 | [diff] [blame] | 188 | goto DONE; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | // Add to the set |
| 192 | batch.setMainFd(mainFd); |
Yi Jin | 3ec5cc7 | 2018-01-26 13:42:43 -0800 | [diff] [blame] | 193 | batch.setMainDest(mainDest); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 194 | } |
| 195 | |
| 196 | // Tell everyone that we're starting. |
| 197 | for (ReportRequestSet::iterator it=batch.begin(); it!=batch.end(); it++) { |
| 198 | if ((*it)->listener != NULL) { |
| 199 | (*it)->listener->onReportStarted(); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | // Write the incident headers |
Yi Jin | edfd5bb | 2017-09-06 17:09:11 -0700 | [diff] [blame] | 204 | headers.Execute(&batch); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 205 | |
| 206 | // For each of the report fields, see if we need it, and if so, execute the command |
| 207 | // and report to those that care that we're doing it. |
| 208 | for (const Section** section=SECTION_LIST; *section; section++) { |
| 209 | const int id = (*section)->id; |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 210 | if (this->batch.containsSection(id)) { |
Yi Jin | f32af48 | 2017-08-11 15:00:49 -0700 | [diff] [blame] | 211 | ALOGD("Taking incident report section %d '%s'", id, (*section)->name.string()); |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 212 | // Notify listener of starting. |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 213 | for (ReportRequestSet::iterator it=batch.begin(); it!=batch.end(); it++) { |
| 214 | if ((*it)->listener != NULL && (*it)->args.containsSection(id)) { |
| 215 | (*it)->listener->onReportSectionStatus(id, |
| 216 | IIncidentReportStatusListener::STATUS_STARTING); |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | // Execute - go get the data and write it into the file descriptors. |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 221 | auto stats = batch.sectionStats(id); |
| 222 | int64_t startTime = uptimeMillis(); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 223 | err = (*section)->Execute(&batch); |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 224 | int64_t endTime = uptimeMillis(); |
| 225 | |
| 226 | stats->set_success(err == NO_ERROR); |
| 227 | stats->set_exec_duration_ms(endTime - startTime); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 228 | if (err != NO_ERROR) { |
Yi Jin | a5c5e8a | 2017-09-27 18:24:58 -0700 | [diff] [blame] | 229 | ALOGW("Incident section %s (%d) failed: %s. Stopping report.", |
| 230 | (*section)->name.string(), id, strerror(-err)); |
Yi Jin | edfd5bb | 2017-09-06 17:09:11 -0700 | [diff] [blame] | 231 | goto DONE; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 232 | } |
| 233 | |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 234 | // Notify listener of ending. |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 235 | for (ReportRequestSet::iterator it=batch.begin(); it!=batch.end(); it++) { |
| 236 | if ((*it)->listener != NULL && (*it)->args.containsSection(id)) { |
| 237 | (*it)->listener->onReportSectionStatus(id, |
| 238 | IIncidentReportStatusListener::STATUS_FINISHED); |
| 239 | } |
| 240 | } |
Yi Jin | f32af48 | 2017-08-11 15:00:49 -0700 | [diff] [blame] | 241 | ALOGD("Finish incident report section %d '%s'", id, (*section)->name.string()); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 242 | } |
| 243 | } |
| 244 | |
Yi Jin | edfd5bb | 2017-09-06 17:09:11 -0700 | [diff] [blame] | 245 | DONE: |
Yi Jin | 329130b | 2018-02-09 16:47:47 -0800 | [diff] [blame] | 246 | // Reports the metdadata when taking the incident report. |
| 247 | if (!isTest) metadataSection.Execute(&batch); |
| 248 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 249 | // Close the file. |
| 250 | if (mainFd >= 0) { |
| 251 | close(mainFd); |
| 252 | } |
| 253 | |
| 254 | // Tell everyone that we're done. |
| 255 | for (ReportRequestSet::iterator it=batch.begin(); it!=batch.end(); it++) { |
| 256 | if ((*it)->listener != NULL) { |
| 257 | if (err == NO_ERROR) { |
| 258 | (*it)->listener->onReportFinished(); |
| 259 | } else { |
| 260 | (*it)->listener->onReportFailed(); |
| 261 | } |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | // Put the report into dropbox. |
| 266 | if (needMainFd && err == NO_ERROR) { |
| 267 | sp<DropBoxManager> dropbox = new DropBoxManager(); |
| 268 | Status status = dropbox->addFile(String16("incident"), mFilename, 0); |
| 269 | ALOGD("Incident report done. dropbox status=%s\n", status.toString8().string()); |
| 270 | if (!status.isOk()) { |
| 271 | return REPORT_NEEDS_DROPBOX; |
| 272 | } |
| 273 | |
| 274 | // If the status was ok, delete the file. If not, leave it around until the next |
| 275 | // boot or the next checkin. If the directory gets too big older files will |
| 276 | // be rotated out. |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 277 | if(!isTest) unlink(mFilename.c_str()); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | return REPORT_FINISHED; |
| 281 | } |
| 282 | |
| 283 | /** |
| 284 | * Create our output file and set the access permissions to -rw-rw---- |
| 285 | */ |
| 286 | status_t |
| 287 | Reporter::create_file(int* fd) |
| 288 | { |
| 289 | const char* filename = mFilename.c_str(); |
| 290 | |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 291 | *fd = open(filename, O_CREAT | O_TRUNC | O_RDWR | O_CLOEXEC, 0660); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 292 | if (*fd < 0) { |
| 293 | ALOGE("Couldn't open incident file: %s (%s)", filename, strerror(errno)); |
| 294 | return -errno; |
| 295 | } |
| 296 | |
| 297 | // Override umask. Not super critical. If it fails go on with life. |
| 298 | chmod(filename, 0660); |
| 299 | |
Yi Jin | 4bab3a1 | 2018-01-10 16:50:59 -0800 | [diff] [blame] | 300 | if (chown(filename, AID_INCIDENTD, AID_INCIDENTD)) { |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 301 | ALOGE("Unable to change ownership of incident file %s: %s\n", filename, strerror(errno)); |
| 302 | status_t err = -errno; |
| 303 | unlink(mFilename.c_str()); |
| 304 | return err; |
| 305 | } |
| 306 | |
| 307 | return NO_ERROR; |
| 308 | } |
| 309 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 310 | Reporter::run_report_status_t |
| 311 | Reporter::upload_backlog() |
| 312 | { |
| 313 | DIR* dir; |
| 314 | struct dirent* entry; |
| 315 | struct stat st; |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 316 | status_t err; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 317 | |
Yi Jin | f32af48 | 2017-08-11 15:00:49 -0700 | [diff] [blame] | 318 | ALOGD("Start uploading backlogs in %s", INCIDENT_DIRECTORY); |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 319 | if ((err = create_directory(INCIDENT_DIRECTORY)) != NO_ERROR) { |
| 320 | ALOGE("directory doesn't exist: %s", strerror(-err)); |
| 321 | return REPORT_FINISHED; |
| 322 | } |
| 323 | |
| 324 | if ((dir = opendir(INCIDENT_DIRECTORY)) == NULL) { |
| 325 | ALOGE("Couldn't open incident directory: %s", INCIDENT_DIRECTORY); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 326 | return REPORT_NEEDS_DROPBOX; |
| 327 | } |
| 328 | |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 329 | sp<DropBoxManager> dropbox = new DropBoxManager(); |
| 330 | |
| 331 | // Enumerate, count and add up size |
Yi Jin | f32af48 | 2017-08-11 15:00:49 -0700 | [diff] [blame] | 332 | int count = 0; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 333 | while ((entry = readdir(dir)) != NULL) { |
| 334 | if (entry->d_name[0] == '.') { |
| 335 | continue; |
| 336 | } |
Yi Jin | add11e9 | 2017-07-30 16:10:07 -0700 | [diff] [blame] | 337 | String8 filename = String8(INCIDENT_DIRECTORY) + entry->d_name; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 338 | if (stat(filename.string(), &st) != 0) { |
| 339 | ALOGE("Unable to stat file %s", filename.string()); |
| 340 | continue; |
| 341 | } |
| 342 | if (!S_ISREG(st.st_mode)) { |
| 343 | continue; |
| 344 | } |
| 345 | |
| 346 | Status status = dropbox->addFile(String16("incident"), filename.string(), 0); |
| 347 | ALOGD("Incident report done. dropbox status=%s\n", status.toString8().string()); |
| 348 | if (!status.isOk()) { |
| 349 | return REPORT_NEEDS_DROPBOX; |
| 350 | } |
| 351 | |
| 352 | // If the status was ok, delete the file. If not, leave it around until the next |
| 353 | // boot or the next checkin. If the directory gets too big older files will |
| 354 | // be rotated out. |
| 355 | unlink(filename.string()); |
Yi Jin | f32af48 | 2017-08-11 15:00:49 -0700 | [diff] [blame] | 356 | count++; |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 357 | } |
Yi Jin | f32af48 | 2017-08-11 15:00:49 -0700 | [diff] [blame] | 358 | ALOGD("Successfully uploaded %d files to Dropbox.", count); |
Joe Onorato | 1754d74 | 2016-11-21 17:51:35 -0800 | [diff] [blame] | 359 | closedir(dir); |
| 360 | |
| 361 | return REPORT_FINISHED; |
| 362 | } |
| 363 | |