From ed2a4701d9d1ac9c614efdc1e8256fa90d812a4f Mon Sep 17 00:00:00 2001 From: Patrick Baumann Date: Mon, 4 Nov 2019 14:13:41 -0800 Subject: [PATCH] Does safe authority comparison in AppsFilter This change makes the authority comparison when adding packages to the AppsFilter handle null authorities on a ProviderInfo. This is necessary due to the current handling of duplicate authorities in system apps. Instead of failing the build or removing the provider, we just nullify the authority. This will be addressed more directly in b/143901347 Bug: 143901347 Fixes: 141867657 Test: atest AppEnumerationTests (on walleye) Change-Id: Iabbc128cebf389b06a6f6f84536ee87492673dd9 --- services/core/java/com/android/server/pm/AppsFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/pm/AppsFilter.java b/services/core/java/com/android/server/pm/AppsFilter.java index dc0cd184c1882..5195a521dd17e 100644 --- a/services/core/java/com/android/server/pm/AppsFilter.java +++ b/services/core/java/com/android/server/pm/AppsFilter.java @@ -211,7 +211,7 @@ public class AppsFilter { final Uri data = intent.getData(); if ("content".equalsIgnoreCase(intent.getScheme()) && data != null - && providerInfo.authority.equalsIgnoreCase(data.getAuthority())) { + && Objects.equals(providerInfo.authority, data.getAuthority())) { return true; } }