nudge icon indicating copy to clipboard operation
nudge copied to clipboard

Nudge logs report 'Camera is currently' when its not - but Nudge still launches

Open dstranathan opened this issue 2 years ago • 1 comments

At least once a day I see a seemingly bogus entry stating that a camera is active when it's not.

localhost Nudge[40801]: [com.github.macadmins.Nudge:user-interface] Ignoring Nudge activation - Camera is currently on and not pastRequiredInstallationDate

In this example, I have ~26 hours remaining on my due date (Im in the Approaching phase but not Immenant). I have Approaching set to 72 hrs and Immenant set to 23 hours.

It’s strange because even though I see this entry, Nudge will launch a few seconds later anyway. So its a false positive of sorts.

I have seen this seemingly bogus entry on 2 test Mac thus far. Both were M1 Macs running macOS Monterey. 1 has only the built-in Apple laptop camera (not active and no A/V apps running). And the other Mac had a Logitec USB camera attached, but not active (and no A/V apps running).

I have tested active cameras quite a bit and Nudge seems to detect them when they are active most of the time, but this false positive is odd - especially since Nudges launches anyway.

Example plist snippet:

	<key>optionalFeatures</key>
	<dict>
		<key>acceptableAssertionUsage</key>
		<true/>
		<key>acceptableCameraUsage</key>
		<true/>
		<key>acceptableScreenSharingUsage</key>
		<true/>

On the flip side of this coin (but related), Im testing Nudge on macOS 13 Ventura beta 6 and I am using Apple Screen Sharing to connect to it when testing Nudge UI (its at a remote location).

I often see this entry in the logs:

localhost Nudge[50615]: [com.github.macadmins.Nudge:user-interface] Ignoring Nudge activation - Screen sharing is currently active and not pastRequiredInstallationDate

But Nudge still activates for me over Screen Sharing.

(I can open a seperate Issue/case if needed)

dstranathan avatar Sep 08 '22 20:09 dstranathan

https://github.com/macadmins/nudge/blob/b61159929c63b55acab3906f9c1bd4daf25e692e/Nudge/Utilities/UILogic.swift#L178 this is the function for camera detection

this is the actual code for it https://github.com/macadmins/nudge/blob/b77495ce405d2166a72a37f5484e8b84e46e9b55/Nudge/Utilities/Utils.swift#L53

quite difficult for me to understand but the problem may lie within here, if it is a code problem and something that can be reproduced

pro4tlzz avatar Sep 08 '22 21:09 pro4tlzz