Skip to content

Commit a76c8ba

Browse files
committed
android: start proximity sensor anyway
Proximity sensor should be enabled anyway, but only turn screen off when audio is routing to earpiece while proximity is in `is near` state. This is for app which can implement `choose audio route` functionality. If a user start a video call but then wants to use earpiece to continue the rest conversation, app should be able to route audio to EarPiece and `turn screen off` while user put their ear close to screen.
1 parent b63414b commit a76c8ba

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

android/src/main/java/com/zxcpoiu/incallmanager/InCallManagerModule.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,7 @@ private void startEvents() {
643643
startWiredHeadsetEvent();
644644
startNoisyAudioEvent();
645645
startMediaButtonEvent();
646-
if (!defaultSpeakerOn) {
647-
// video, default disable proximity
648-
startProximitySensor();
649-
}
646+
startProximitySensor(); // --- proximity event always enable, but only turn screen off when audio is routing to earpiece.
650647
setKeepScreenOn(true);
651648
}
652649

0 commit comments

Comments
 (0)