[Install-unknown-apps] not include all the apps that have OP_REQUEST_INSTALL_PACKAGES granted

Due to a recent change in AppOpsService, apps that share system_uid have all the appops granted. However, we don't want them to be listed under "Install unknown apps" if they don't explicitly declare the permission usage of REQUEST_INSTALL_PACKAGES in their manifest. This CL fixes that.

Change-Id: I025bc17c335093ae5d3b15a3bef67d659c8f790f
BUG: 338066634
BUG: 336677341
FIXES: 338066634
Test: manual by checking the Settings page
This commit is contained in:
Song Chun Fan
2024-05-02 00:46:22 +00:00
parent d6941aff34
commit ba39bd6edd

View File

@@ -94,9 +94,7 @@ class InstallUnknownAppsListModel(private val context: Context) :
private fun isChangeable(
record: InstallUnknownAppsRecord,
potentialPackageNames: Set<String>,
) =
record.appOpsController.getMode() != MODE_DEFAULT ||
record.app.packageName in potentialPackageNames
) = record.app.packageName in potentialPackageNames
private fun getPotentialPackageNames(userId: Int): Set<String> =
AppGlobals.getPackageManager()