diff --git a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseOboeTesterActivity.java b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseOboeTesterActivity.java index a82ff4ffa..20348da67 100644 --- a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseOboeTesterActivity.java +++ b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/BaseOboeTesterActivity.java @@ -87,7 +87,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis /** * If needed, request recording permission before running test. */ - protected void launchTestThatDoesRecording(Class clazz) { + protected void launchTestThatRequiresRecordingPermissions(Class clazz) { mTestClass = clazz; if (isRecordPermissionGranted()) { beginTestThatRequiresRecording(); diff --git a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/ExtraTestsActivity.java b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/ExtraTestsActivity.java index 12b9efb88..49c42bba1 100644 --- a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/ExtraTestsActivity.java +++ b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/ExtraTestsActivity.java @@ -16,7 +16,7 @@ public void onLaunchMainActivity(View view) { } public void onLaunchExternalTapTest(View view) { - launchTestThatDoesRecording(ExternalTapToToneActivity.class); + launchTestThatRequiresRecordingPermissions(ExternalTapToToneActivity.class); } public void onLaunchPlugLatencyTest(View view) { @@ -28,7 +28,7 @@ public void onLaunchErrorCallbackTest(View view) { } public void onLaunchRouteDuringCallbackTest(View view) { - launchTestThatDoesRecording(TestRouteDuringCallbackActivity.class); + launchTestThatRequiresRecordingPermissions(TestRouteDuringCallbackActivity.class); } public void onLaunchDynamicWorkloadTest(View view) { diff --git a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/MainActivity.java b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/MainActivity.java index f11a3bc69..4efda9478 100644 --- a/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/MainActivity.java +++ b/apps/OboeTester/app/src/main/java/com/mobileer/oboetester/MainActivity.java @@ -206,49 +206,61 @@ private void updateNativeAudioUI() { } public void onLaunchTestOutput(View view) { - launchTestActivity(TestOutputActivity.class); + if (mForegroundServiceCheckBox.isChecked()) { + launchTestThatRequiresRecordingPermissions(TestOutputActivity.class); + } else { + launchTestActivity(TestOutputActivity.class); + } } public void onLaunchTestInput(View view) { - launchTestThatDoesRecording(TestInputActivity.class); + launchTestThatRequiresRecordingPermissions(TestInputActivity.class); } public void onLaunchTapToTone(View view) { - launchTestThatDoesRecording(TapToToneActivity.class); + launchTestThatRequiresRecordingPermissions(TapToToneActivity.class); } public void onLaunchRecorder(View view) { - launchTestThatDoesRecording(RecorderActivity.class); + launchTestThatRequiresRecordingPermissions(RecorderActivity.class); } public void onLaunchEcho(View view) { - launchTestThatDoesRecording(EchoActivity.class); + launchTestThatRequiresRecordingPermissions(EchoActivity.class); } public void onLaunchRoundTripLatency(View view) { - launchTestThatDoesRecording(RoundTripLatencyActivity.class); + launchTestThatRequiresRecordingPermissions(RoundTripLatencyActivity.class); } public void onLaunchManualGlitchTest(View view) { - launchTestThatDoesRecording(ManualGlitchActivity.class); + launchTestThatRequiresRecordingPermissions(ManualGlitchActivity.class); } - public void onLaunchAutoGlitchTest(View view) { launchTestThatDoesRecording(AutomatedGlitchActivity.class); } + public void onLaunchAutoGlitchTest(View view) { launchTestThatRequiresRecordingPermissions(AutomatedGlitchActivity.class); } public void onLaunchTestDisconnect(View view) { - launchTestThatDoesRecording(TestDisconnectActivity.class); + launchTestThatRequiresRecordingPermissions(TestDisconnectActivity.class); } public void onLaunchTestDataPaths(View view) { - launchTestThatDoesRecording(TestDataPathsActivity.class); + launchTestThatRequiresRecordingPermissions(TestDataPathsActivity.class); } public void onLaunchTestDeviceReport(View view) { - launchTestActivity(DeviceReportActivity.class); + if (mForegroundServiceCheckBox.isChecked()) { + launchTestThatRequiresRecordingPermissions(DeviceReportActivity.class); + } else { + launchTestActivity(DeviceReportActivity.class); + } } public void onLaunchExtratests(View view) { - launchTestActivity(ExtraTestsActivity.class); + if (mForegroundServiceCheckBox.isChecked()) { + launchTestThatRequiresRecordingPermissions(ExtraTestsActivity.class); + } else { + launchTestActivity(ExtraTestsActivity.class); + } } private void applyUserOptions() {