Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd714823 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Vibrate after a screenshot is taken, not before." into nyc-dev

am: 509d407e

* commit '509d407e':
  Vibrate after a screenshot is taken, not before.
parents 6aefc85d 509d407e
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1181,14 +1181,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);