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.
This commit is contained in:
Om Alve committed 2026-11-02 13:28:21 +05:30
1 parent 9fac7a29ba
commit bdf4fc2f1d
2 files changed
+9 -8

No files matched your search

+4 -4
View File
@@ -69,10 +69,10 @@ async function ensurePermissions(
if (missing.length === 0) return;
// Only a request needs an Activity. Checking must not: Android can start
// the app in the background (a home-widget update, a notification-listener
// rebind) with none, and the glasses session and voice input run from
// there until the app is opened.
// Only a request needs an Activity. Checking must not: the glasses session
// outlives it (swiping the app away in Recents destroys the Activity while
// the foreground service keeps the process running), and voice input
// checks the microphone permission on every start.
const activity = getActivity();
await new Promise<void>((resolve, reject) => {