Loading tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java +7 −1 Original line number Diff line number Diff line Loading @@ -62,12 +62,17 @@ public class ScreenRecordRule implements TestRule { ParcelFileDescriptor output = automation.executeShellCommand("screenrecord " + outputFile); String screenRecordPid = device.executeShellCommand("pidof screenrecord"); boolean success = false; try { base.evaluate(); success = true; } finally { device.executeShellCommand("kill -INT " + screenRecordPid); Log.e(TAG, "Screenrecord captured at: " + outputFile); output.close(); if (success) { automation.executeShellCommand("rm " + outputFile); } } } }; Loading @@ -78,5 +83,6 @@ public class ScreenRecordRule implements TestRule { */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface ScreenRecord { } public @interface ScreenRecord { } } Loading
tests/src/com/android/launcher3/util/rule/ScreenRecordRule.java +7 −1 Original line number Diff line number Diff line Loading @@ -62,12 +62,17 @@ public class ScreenRecordRule implements TestRule { ParcelFileDescriptor output = automation.executeShellCommand("screenrecord " + outputFile); String screenRecordPid = device.executeShellCommand("pidof screenrecord"); boolean success = false; try { base.evaluate(); success = true; } finally { device.executeShellCommand("kill -INT " + screenRecordPid); Log.e(TAG, "Screenrecord captured at: " + outputFile); output.close(); if (success) { automation.executeShellCommand("rm " + outputFile); } } } }; Loading @@ -78,5 +83,6 @@ public class ScreenRecordRule implements TestRule { */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface ScreenRecord { } public @interface ScreenRecord { } }