diff options
| author | 2020-02-28 14:39:03 -0800 | |
|---|---|---|
| committer | 2020-02-28 14:39:55 -0800 | |
| commit | 3802e39d763ad55219232ab1199225d45fd06b2d (patch) | |
| tree | a9c336abb7ae72e567f5dead4beb4235fc3f40b5 | |
| parent | 5b55f124d8d24045ef103dd8eeb767fb376cbd63 (diff) | |
Convert IntentResolver data object to IntentFilter for comparison
An == check will no longer pass because the Pair object used
to wrap ParsedComponents and their associated IntentInfos is
re-created for each filter.
Have to use the actual filter reference by calling
getIntentFilter with the left/right sides.
Bug: 150112563
Test: manual update Calendar app and try to reproduce bug
Change-Id: I0bb1e1d82a1f097b4c0d99a7fabf76789461c888
| -rw-r--r-- | services/core/java/com/android/server/IntentResolver.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/IntentResolver.java b/services/core/java/com/android/server/IntentResolver.java index 7ec2a34604ca..dbf179abad4b 100644 --- a/services/core/java/com/android/server/IntentResolver.java +++ b/services/core/java/com/android/server/IntentResolver.java @@ -687,7 +687,7 @@ public abstract class IntentResolver<F, R extends Object> { } private final void remove_all_objects(ArrayMap<String, F[]> map, String name, - Object object) { + F object) { F[] array = map.get(name); if (array != null) { int LAST = array.length-1; @@ -695,7 +695,8 @@ public abstract class IntentResolver<F, R extends Object> { LAST--; } for (int idx=LAST; idx>=0; idx--) { - if (array[idx] == object) { + F arrayValue = array[idx]; + if (arrayValue != null && getIntentFilter(arrayValue) == getIntentFilter(object)) { final int remain = LAST - idx; if (remain > 0) { System.arraycopy(array, idx+1, array, idx, remain); |