Skip to content

Commit

Permalink
Add "Wkload" checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
philburk committed Nov 20, 2024
1 parent a716835 commit 5f00f24
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public class DynamicWorkloadActivity extends TestOutputActivityBase {

public static final String KEY_USE_ADPF = "use_adpf";
public static final boolean VALUE_DEFAULT_USE_ADPF = false;
public static final String KEY_USE_WORKLOAD = "use_workload";
public static final boolean VALUE_DEFAULT_USE_WORKLOAD = false;
public static final String KEY_SCROLL_GRAPHICS = "scroll_graphics";
public static final boolean VALUE_DEFAULT_SCROLL_GRAPHICS = false;

Expand All @@ -73,6 +75,7 @@ public class DynamicWorkloadActivity extends TestOutputActivityBase {
private CheckBox mDrawAlwaysBox;
private int mCpuCount;
private boolean mShouldUseADPF;
private boolean mShouldUseWorkloadReporting;

private static final int WORKLOAD_LOW = 1;
private int mWorkloadHigh; // this will get set later
Expand Down Expand Up @@ -304,12 +307,15 @@ public void onClick(View view) {
mShouldUseADPF = checkBox.isChecked();
setPerformanceHintEnabled(mShouldUseADPF);
mUseAltAdpfBox.setEnabled(!mShouldUseADPF);
mWorkloadReportBox.setEnabled(mShouldUseADPF);
});

mWorkloadReportBox.setOnClickListener(buttonView -> {
CheckBox checkBox = (CheckBox) buttonView;
setWorkloadReportingEnabled(checkBox.isChecked());
mShouldUseWorkloadReporting = checkBox.isChecked();
setWorkloadReportingEnabled(mShouldUseWorkloadReporting);
});
mWorkloadReportBox.setEnabled(mShouldUseADPF);

CheckBox hearWorkloadBox = (CheckBox) findViewById(R.id.hear_workload);
hearWorkloadBox.setOnClickListener(buttonView -> {
Expand Down Expand Up @@ -354,6 +360,7 @@ private void updateButtons(boolean running) {
mStartButton.setEnabled(!running);
mStopButton.setEnabled(running);
mPerfHintBox.setEnabled(running);
mWorkloadReportBox.setEnabled(running);
}

private void postResult(final String text) {
Expand Down Expand Up @@ -418,6 +425,8 @@ public void startTestUsingBundle() {
// Specific options.
mShouldUseADPF = mBundleFromIntent.getBoolean(KEY_USE_ADPF,
VALUE_DEFAULT_USE_ADPF);
mShouldUseWorkloadReporting = mBundleFromIntent.getBoolean(KEY_USE_WORKLOAD,
VALUE_DEFAULT_USE_WORKLOAD);
mDrawChartAlways =
mBundleFromIntent.getBoolean(KEY_SCROLL_GRAPHICS,
VALUE_DEFAULT_SCROLL_GRAPHICS);
Expand All @@ -427,6 +436,8 @@ public void startTestUsingBundle() {
runOnUiThread(() -> {
mPerfHintBox.setChecked(mShouldUseADPF);
setPerformanceHintEnabled(mShouldUseADPF);
mWorkloadReportBox.setChecked(mShouldUseWorkloadReporting);
setWorkloadReportingEnabled(mShouldUseWorkloadReporting);
mDrawAlwaysBox.setChecked(mDrawChartAlways);
});

Expand All @@ -453,6 +464,7 @@ void stopAutomaticTest() {
AudioStreamBase outputStream =mAudioOutTester.getCurrentAudioStream();
report += "out.xruns = " + outputStream.getXRunCount() + "\n";
report += "use.adpf = " + (mShouldUseADPF ? "yes" : "no") + "\n";
report += "use.workload = " + (mShouldUseWorkloadReporting ? "yes" : "no") + "\n";
report += "scroll.graphics = " + (mDrawChartAlways ? "yes" : "no") + "\n";
onStopTest();
maybeWriteTestResult(report);
Expand Down

0 comments on commit 5f00f24

Please sign in to comment.