diff --git a/multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js b/multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js index 9620b29fae0584ebe6902dec8a66fdabbdadd79c..880ec9d599a82c55101c18c024e099705f3517fb 100644 --- a/multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js +++ b/multimedia/audio/audio_js_standard/audioInterrupt/src/main/js/test/AudioInterrupt.test.js @@ -92,8 +92,8 @@ describe('audioInterrupt', function () { } var AudioRendererInfo = { - content: audio.ContentType.CONTENT_TYPE_RINGTONE, - usage: audio.StreamUsage.STREAM_USAGE_NOTIFICATION_RINGTONE, + content: audio.ContentType.CONTENT_TYPE_MUSIC, + usage: audio.StreamUsage.STREAM_USAGE_MEDIA, rendererFlags: 0 } diff --git a/multimedia/audio/audio_js_standard/audioInterruptRender/entry/src/main/ets/MainAbility/app.ets b/multimedia/audio/audio_js_standard/audioInterruptRender/entry/src/main/ets/MainAbility/app.ets index 509cdd3cc11a2af6940b6781e9f03cd3ee2ed524..366bfaa552f2a98724a817fdc1df88dad9924bbb 100644 --- a/multimedia/audio/audio_js_standard/audioInterruptRender/entry/src/main/ets/MainAbility/app.ets +++ b/multimedia/audio/audio_js_standard/audioInterruptRender/entry/src/main/ets/MainAbility/app.ets @@ -10,7 +10,7 @@ * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and - * limitations under the License.info(TAG + + * limitations under the License. */ import audio from '@ohos.multimedia.audio'; import fileio from '@ohos.fileio'; @@ -137,26 +137,26 @@ export default { }); console.info(TAG + 'AudioFrameworkRenderLog: Renderer after read'); await sleep(3000); - // await audioRen.drain().then(async function () { - console.info(TAG + 'AudioFrameworkRenderLog: Renderer drained : SUCCESS'); - let wantInfo = { - want: - { - bundleName: "com.example.audiorenderinterrupt", - abilityName: "com.example.entry.MainAbility" - }, - resultCode: 1111 - } - featureAbility.terminateSelfWithResult(wantInfo).then(() => { - console.info(TAG + 'terminateSelf ================================== success') - }) - .catch(() => { - console.info(TAG + 'terminateSelf ==================================== fail') + await audioRen.drain().then(async function () { + console.info(TAG + 'AudioFrameworkRenderLog: Renderer drained : SUCCESS'); + let wantInfo = { + want: + { + bundleName: "com.example.audiorenderinterrupt", + abilityName: "com.example.entry.MainAbility" + }, + resultCode: 1111 + } + featureAbility.terminateSelfWithResult(wantInfo).then(() => { + console.info(TAG + 'terminateSelf ================================== success') }) + .catch(() => { + console.info(TAG + 'terminateSelf ==================================== fail') + }) - // }).catch((err) => { - // console.error('AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); - // }); + }).catch((err) => { + console.error(TAG + 'AudioFrameworkRenderLog: Renderer drain: ERROR : ' + err.message); + }); }, onDestroy() { console.log(TAG1 + 'onDestroy');