Skip clearing verification for apps marked with SystemConfig <app-link>

If a system app misconfigures their AndroidManifest.xml and does not
declare autoVerify="true" in any of their intent filters, they will
lose app link verification when their app is updated from the version
on the system image.

This means the app will stop automatically opening when a web link is
is opened by the user.

To prevent this, ignore verification info clear requests when the
package being cleared is in the linked apps set.

Bug: 175139501

Test: manual, verify by updating <app-link> configured app

Change-Id: I489acb370c8e6a57bf40b4bf485fbe8addf7fdab
This commit is contained in:
Winson
2020-12-11 16:38:09 -08:00
parent 786d279f6c
commit 77fb7f69e4

View File

@@ -20730,6 +20730,11 @@ public class PackageManagerService extends IPackageManager.Stub
@GuardedBy("mLock")
void clearIntentFilterVerificationsLPw(String packageName, int userId,
boolean alsoResetStatus) {
if (SystemConfig.getInstance().getLinkedApps().contains(packageName)) {
// Nope, need to preserve the system configuration approval for this app
return;
}
if (userId == UserHandle.USER_ALL) {
if (mSettings.removeIntentFilterVerificationLPw(packageName,
mUserManager.getUserIds())) {