Just to add some related details to @ReddyLutonadio's answer, android.permission.REQUEST_INSTALL_PACKAGES
is the one which defines which apps would appear in the list you have mentioned, and it's required on Android 8+ to install apps from sources other than Google Play. But this permission alone doesn't define if the app is allowed to install unknown packages or not. It has protection level Signature
:
The system grants these app permissions at install time, but only when the app that attempts to use a permission is signed by the same certificate as the app that defines the permission.
It means that user apps will never be allowed this permission. The apps which are allowed in "Settings" > "Apps & Notifications" > "Advanced" > "Special App Access" > "Install unknown apps"
are those which have AppOps operation OP_REQUEST_INSTALL_PACKAGES
allowed. You can also check from adb shell
:
~$ appops query-op REQUEST_INSTALL_PACKAGES allow
Results must be same as in Settings. To deny any of the apps:
~$ appops set org.fdroid.fdroid REQUEST_INSTALL_PACKAGES deny
And it will appear as Not allowed
in Settings.
Other permissions which are controlled with AppOps can be seen with dumpsys package | grep -A100 'AppOp Permissions:' | sed '/^$/q'
.
RELATED: