From 8c06d5e2575a05aa86c28be0187146d80fe95630 Mon Sep 17 00:00:00 2001
From: Raymond Tiong
Date: Mon, 14 Mar 2022 19:57:21 +0000
Subject: [PATCH] Add recommendation to use MediaActionSound class in a
background thread since it relies on binder.
Bug: 213174684
Test: N/A as it's a comment update
Change-Id: I01ddc0402bd27d19b2e9e7606ad327da703e8aaa
---
media/java/android/media/MediaActionSound.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/media/java/android/media/MediaActionSound.java b/media/java/android/media/MediaActionSound.java
index ec56d614f2b5e..ad1405aa2356f 100644
--- a/media/java/android/media/MediaActionSound.java
+++ b/media/java/android/media/MediaActionSound.java
@@ -25,7 +25,8 @@ import android.util.Log;
/**
* A class for producing sounds that match those produced by various actions
- * taken by the media and camera APIs.
+ * taken by the media and camera APIs. It is recommended to call methods in this class
+ * in a background thread since it relies on binder calls.
*
* This class is recommended for use with the {@link android.hardware.camera2} API, since the
* camera2 API does not play any sounds on its own for any capture or video recording actions.
@@ -109,7 +110,7 @@ public class MediaActionSound {
/**
* Returns true if the application must play the shutter sound in accordance
- * to certain regional restrictions.
+ * to certain regional restrictions.
*
* If this method returns true, applications are strongly recommended to use
* MediaActionSound.play(SHUTTER_CLICK) or START_VIDEO_RECORDING whenever it captures