Mute the camera if Signal loses focus.

Addresses #12754.
This commit is contained in:
Nicholas
2023-04-24 16:32:35 -04:00
parent 763e14f25f
commit d70213e031
4 changed files with 15 additions and 4 deletions

View File

@@ -1,6 +1,5 @@
package org.thoughtcrime.securesms.ringrtc;
import android.annotation.TargetApi;
import android.content.Context;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
@@ -318,6 +317,7 @@ public class Camera implements CameraControl, CameraVideoCapturer.CameraSwitchHa
@Override
public void onCapturerStopped() {
observer.onCapturerStopped();
cameraEventListener.onCameraStopped();
}
@Override

View File

@@ -2,7 +2,13 @@ package org.thoughtcrime.securesms.ringrtc;
import androidx.annotation.NonNull;
/**
* Event listener that are (indirectly) bound to WebRTC events.
* onFullyInitialized and onCameraStopped are hardware lifecycle methods triggered by our implementation of {@link org.webrtc.CapturerObserver}
* onCameraSwitchCompleted is triggered by {@link org.webrtc.CameraVideoCapturer.CameraSwitchHandler}
*/
public interface CameraEventListener {
void onFullyInitialized();
void onCameraSwitchCompleted(@NonNull CameraState newCameraState);
void onCameraStopped();
}