Skip to content

Commit 46d0480

Browse files
authored
fix: calls in terminated mode by disabling orientation manager (flutter-webrtc#1840)
1 parent 86dac0c commit 46d0480

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

android/src/main/java/com/cloudwebrtc/webrtc/video/camera/CameraUtils.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ public CameraUtils(GetUserMediaImpl getUserMediaImpl, Activity activity) {
4545
this.getUserMediaImpl = getUserMediaImpl;
4646
this.activity = activity;
4747
this.deviceOrientationManager = new DeviceOrientationManager(activity, 0);
48-
this.deviceOrientationManager.start();
48+
// commented out because you cannot register a reciever when the app is terminated
49+
// because the activity is null?
50+
// this causes the call to break if the app is terminated
51+
// the manager seems to end up at handleOrientationChange which does not do
52+
// anything at the moment so this should be ok
53+
54+
// TODO: get a proper fix at some point
55+
// this.deviceOrientationManager.start();
4956
}
5057

5158
public void setFocusMode(MethodCall call, AnyThreadResult result) {

0 commit comments

Comments
 (0)