Vibrate after a screenshot is taken, not before.

BUG: 27389320
Change-Id: I383b4252a80ae2f1d820a97b9deb930dccf50313
This commit is contained in:
Felipe Leme
2016-03-08 15:59:46 -08:00
parent 7ba6dc0fcc
commit aa00f2d909

View File

@@ -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);