OSDN Git Service

Moved final vibration to the end of the process.
authorFelipe Leme <felipeal@google.com>
Thu, 25 Feb 2016 22:02:44 +0000 (14:02 -0800)
committerFelipe Leme <felipeal@google.com>
Thu, 25 Feb 2016 22:15:34 +0000 (14:15 -0800)
BUG: 26347468
Change-Id: I872d9175fd09b47da512cb2da11a533a921d9a5c

cmds/dumpstate/dumpstate.cpp

index 3abd8f0..315a3ca 100644 (file)
@@ -1279,14 +1279,6 @@ int main(int argc, char *argv[]) {
 
     dumpstate(do_early_screenshot ? "": screenshot_path, version);
 
-    /* done */
-    if (vibrator) {
-        for (int i = 0; i < 3; i++) {
-            vibrate(vibrator.get(), 75);
-            usleep((75 + 50) * 1000);
-        }
-    }
-
     /* close output if needed */
     if (is_redirecting) {
         fclose(stdout);
@@ -1347,6 +1339,14 @@ int main(int argc, char *argv[]) {
         }
     }
 
+    /* vibrate a few but shortly times to let user know it's finished */
+    if (vibrator) {
+        for (int i = 0; i < 3; i++) {
+            vibrate(vibrator.get(), 75);
+            usleep((75 + 50) * 1000);
+        }
+    }
+
     /* tell activity manager we're done */
     if (do_broadcast) {
         if (!path.empty()) {