'Package installer dialog dismissible?

I am working so some demo app store. This app can detect deep link and install app from link. Before installing app user gets dialog (at least on Android 11 and 12) where he/she can click on Install or Cancel. Dialog is opened by PackageInstaller. I am using BroadcastReceiver to receive installation status (for example PackageInstaller.STATUS_PENDING_USER_ACTION). When user clicks on cancel or install or some error happens I receive a status.

But user can click outside of dialog. Dialog is smilingly dismissed and no status is reported back.

Is there way to get status? Or to make dialog non dismissible?

EDIT: dialog is create by PackageInstaller and I don’t have control it's properties.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source