Merge "Fix for: NPE when intent.component set to ResolverActivity." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
df9d2dc291
@@ -41,6 +41,7 @@ import android.compat.annotation.ChangeId;
|
|||||||
import android.compat.annotation.EnabledSince;
|
import android.compat.annotation.EnabledSince;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
import android.content.pm.ComponentInfo;
|
import android.content.pm.ComponentInfo;
|
||||||
@@ -1133,9 +1134,14 @@ public class PackageManagerServiceUtils {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final boolean match = comp.getIntents().stream().anyMatch(
|
boolean match = false;
|
||||||
f -> IntentResolver.intentMatchesFilter(f.getIntentFilter(), intent,
|
for (int j = 0, size = comp.getIntents().size(); j < size; ++j) {
|
||||||
resolvedType));
|
IntentFilter intentFilter = comp.getIntents().get(j).getIntentFilter();
|
||||||
|
if (IntentResolver.intentMatchesFilter(intentFilter, intent, resolvedType)) {
|
||||||
|
match = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!match) {
|
if (!match) {
|
||||||
Slog.w(TAG, "Intent does not match component's intent filter: " + intent);
|
Slog.w(TAG, "Intent does not match component's intent filter: " + intent);
|
||||||
Slog.w(TAG, "Access blocked: " + comp.getComponentName());
|
Slog.w(TAG, "Access blocked: " + comp.getComponentName());
|
||||||
|
|||||||
Reference in New Issue
Block a user