From 8b96d8cd8dfcc8c1ba1a8fc1a0977c31abe05301 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Wed, 15 Dec 2021 17:32:39 +0000 Subject: [PATCH 1/2] only acquire a wake lock if a lock is not already held --- .../java/im/vector/app/features/call/CallProximityManager.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/call/CallProximityManager.kt b/vector/src/main/java/im/vector/app/features/call/CallProximityManager.kt index 74e6c40783..3aeeac15af 100644 --- a/vector/src/main/java/im/vector/app/features/call/CallProximityManager.kt +++ b/vector/src/main/java/im/vector/app/features/call/CallProximityManager.kt @@ -93,7 +93,9 @@ class CallProximityManager @Inject constructor( if (wakeLock == null) { wakeLock = powerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, generateWakeLockTag()) } - wakeLock?.acquire(WAKE_LOCK_TIMEOUT_MILLIS) + wakeLock + ?.takeIf { !it.isHeld } + ?.acquire(WAKE_LOCK_TIMEOUT_MILLIS) } private fun onProximityFar() { From 8c913d29cb94eb5f12cb0ff564a4d7e55e131773 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Wed, 15 Dec 2021 17:35:27 +0000 Subject: [PATCH 2/2] adding changelog entry --- changelog.d/2467.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/2467.bugfix diff --git a/changelog.d/2467.bugfix b/changelog.d/2467.bugfix new file mode 100644 index 0000000000..e707199e8a --- /dev/null +++ b/changelog.d/2467.bugfix @@ -0,0 +1 @@ +Fixing proximity sensor still being active after a call \ No newline at end of file