2 Commits
Author SHA1 Message Date
Om Alve bdf4fc2f1d Correct how the app ends up with no Activity
The previous commit's comment and test said Android starts the app in the
background (a home-widget update, a notification-listener rebind) with
the glasses session running. A background start alone doesn't connect
the glasses; only the main page does. The state that breaks voice is
the Activity being destroyed afterwards: swiping the app away in Recents
destroys it while the foreground service keeps the process and session
running, and NativeScript then clears both foregroundActivity and
startActivity. On Android 12+ Back on the main page only moves the task
to the back, so the Activity survives it. Comment and test wording only.
2026-11-02 13:28:21 +05:30
Om Alve 9fac7a29ba Voice: don't need an Activity to check already-granted permissions
ensurePermissions looked up the Activity before checking whether any
permission was missing, and getActivity() throws when there is none.
Android starts the app in the background with no Activity (a home-widget
update, a notification-listener rebind), and the glasses session runs
from there until the app is opened. So in that state every "Hey Even"
failed in ensureVoicePermissions even though the mic permission was
granted, and the voice dialog kept showing the idle "Voice control
stopped.". The same throw hit ensureBlePermissions.

The Activity is now only looked up when a permission actually has to be
requested. A capture that fails to start for any reason other than a
denied permission now says so in the dialog instead of leaving the idle
status up.
2026-11-02 13:17:16 +05:30