From aa00f2d909dcc48b61b9338cd2ab7c33850a69d9 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Tue, 8 Mar 2016 15:59:46 -0800 Subject: [PATCH] Vibrate after a screenshot is taken, not before. BUG: 27389320 Change-Id: I383b4252a80ae2f1d820a97b9deb930dccf50313 --- packages/Shell/src/com/android/shell/BugreportProgressService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index 0fad11357bd9..40ab507fbf04 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -1180,14 +1180,13 @@ public class BugreportProgressService extends Service { * Takes a screenshot and save it to the given location. */ private static boolean takeScreenshot(Context context, String screenshotFile) { - ((Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE)) - .vibrate(150); final ProcessBuilder screencap = new ProcessBuilder() .command("/system/bin/screencap", "-p", screenshotFile); Log.d(TAG, "Taking screenshot using " + screencap.command()); try { final int exitValue = screencap.start().waitFor(); if (exitValue == 0) { + ((Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE)).vibrate(150); return true; } Log.e(TAG, "screencap (" + screencap.command() + ") failed: " + exitValue); -- 2.11.0