Skip to content

Commit 2a801b6

Browse files
author
Mykola Mokhnach
authored
Add bugreport option to Android screen recorder (#852)
1 parent 92671b2 commit 2a801b6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/main/java/io/appium/java_client/android/AndroidStartScreenRecordingOptions.java

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@ public class AndroidStartScreenRecordingOptions
2929
extends BaseStartScreenRecordingOptions<AndroidStartScreenRecordingOptions> {
3030
private Integer bitRate;
3131
private String videoSize;
32+
private Boolean isBugReportEnabled;
3233

3334
public static AndroidStartScreenRecordingOptions startScreenRecordingOptions() {
3435
return new AndroidStartScreenRecordingOptions();
3536
}
3637

3738
/**
3839
* The video bit rate for the video, in megabits per second.
39-
* The default value is 4. You can increase the bit rate to improve video quality,
40+
* The default value is 4000000 (4 Mb/s) for Android API level below 27
41+
* and 20000000 (20 Mb/s) for API level 27 and above.
42+
* You can increase the bit rate to improve video quality,
4043
* but doing so results in larger movie files.
41-
* The value of 5000000 equals to 5Mb/sec.
4244
*
4345
* @param bitRate The actual bit rate (Mb/s).
4446
* @return self instance for chaining.
@@ -62,6 +64,18 @@ public AndroidStartScreenRecordingOptions withVideoSize(String videoSize) {
6264
return this;
6365
}
6466

67+
/**
68+
* Makes the recorder to display an additional information on the video overlay,
69+
* such as a timestamp, that is helpful in videos captured to illustrate bugs.
70+
* This option is only supported since API level 27 (Android P).
71+
*
72+
* @return self instance for chaining.
73+
*/
74+
public AndroidStartScreenRecordingOptions enableBugReport() {
75+
this.isBugReportEnabled = true;
76+
return this;
77+
}
78+
6579
/**
6680
* The maximum recording time. The default and maximum value is 180 seconds (3 minutes).
6781
* Setting values greater than this or less than zero will cause an exception. The minimum
@@ -81,6 +95,7 @@ public Map<String, Object> build() {
8195
builder.putAll(super.build());
8296
ofNullable(bitRate).map(x -> builder.put("bitRate", x));
8397
ofNullable(videoSize).map(x -> builder.put("videoSize", x));
98+
ofNullable(isBugReportEnabled).map(x -> builder.put("bugReport", x));
8499
return builder.build();
85100
}
86101
}

0 commit comments

Comments
 (0)