Skip to content

Commit

Permalink
OboeTester check for null info
Browse files Browse the repository at this point in the history
  • Loading branch information
philburk committed Jul 12, 2024
1 parent 37e7cc1 commit 9ed5de1
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -474,17 +474,20 @@ protected TestResult testCurrentConfigurations() throws InterruptedException {
int result = testResult.result;
if (result == TEST_RESULT_FAILED) {
int id = mAudioOutTester.actualConfiguration.getDeviceId();
int deviceType = getDeviceInfoById(id).getType();
int channelCount = mAudioOutTester.actualConfiguration.getChannelCount();
if (deviceType == AudioDeviceInfo.TYPE_BUILTIN_EARPIECE
&& channelCount == 2
&& getOutputChannel() == 1) {
testResult.addComment("Maybe EARPIECE does not mix stereo to mono!");
}
if (deviceType == TYPE_BUILTIN_SPEAKER_SAFE
&& channelCount == 2
&& getOutputChannel() == 0) {
testResult.addComment("Maybe SPEAKER_SAFE dropped channel zero!");
AudioDeviceInfo info = getDeviceInfoById(id);
if (info != null) {
int deviceType = getDeviceInfoById(id).getType();
if (deviceType == AudioDeviceInfo.TYPE_BUILTIN_EARPIECE
&& channelCount == 2
&& getOutputChannel() == 1) {
testResult.addComment("Maybe EARPIECE does not mix stereo to mono!");
}
if (deviceType == TYPE_BUILTIN_SPEAKER_SAFE
&& channelCount == 2
&& getOutputChannel() == 0) {
testResult.addComment("Maybe SPEAKER_SAFE dropped channel zero!");
}
}
}
}
Expand Down

0 comments on commit 9ed5de1

Please sign in to comment.