Loading telecomm/java/android/telecom/Call.java +35 −25 Original line number Diff line number Diff line Loading @@ -2912,7 +2912,7 @@ public final class Call { if (bundle.size() != newBundle.size()) { return false; } try { for (String key : bundle.keySet()) { if (key != null) { if (!newBundle.containsKey(key)) { Loading @@ -2937,14 +2937,24 @@ public final class Call { } } catch (BadParcelableException e) { return false; } catch (ClassCastException e) { Log.e(LOG_TAG, e, "areBundlesEqual: failure comparing bundle key %s", key); // until we know what is causing this, we should rethrow -- this is still not // expected. throw e; } } } } catch (ClassCastException | ArrayIndexOutOfBoundsException e) { // Unfortunately this may get raised when accessing the bundle's keyset, so we cannot // determine WHY a class cast exception is happening. We had tried in the past to do // this down in the for loop so we could figure out which key is causing an issue. // Bundles are not thread safe, so the most likely issue here is that the InCallService // implementation is accessing the Bundle WHILE an incoming Telecom update comes in to // potentially replace the Bundle. We call "areBundlesEqual" to see if the newly // unparceled Call.Details is the same as what is already in the current Call instance. // If those two operations overleave, I can see the potential for concurrent // modification and edit of the Bundle. So we'll just catch here and assume the Bundles // are not the same. This means a Call.CallBack may fire the onCallDetails changed // callback when the Bundle didn't actually change. Log.e(LOG_TAG, e, "areBundlesEqual: failed!"); return false; } return true; } } Loading
telecomm/java/android/telecom/Call.java +35 −25 Original line number Diff line number Diff line Loading @@ -2912,7 +2912,7 @@ public final class Call { if (bundle.size() != newBundle.size()) { return false; } try { for (String key : bundle.keySet()) { if (key != null) { if (!newBundle.containsKey(key)) { Loading @@ -2937,14 +2937,24 @@ public final class Call { } } catch (BadParcelableException e) { return false; } catch (ClassCastException e) { Log.e(LOG_TAG, e, "areBundlesEqual: failure comparing bundle key %s", key); // until we know what is causing this, we should rethrow -- this is still not // expected. throw e; } } } } catch (ClassCastException | ArrayIndexOutOfBoundsException e) { // Unfortunately this may get raised when accessing the bundle's keyset, so we cannot // determine WHY a class cast exception is happening. We had tried in the past to do // this down in the for loop so we could figure out which key is causing an issue. // Bundles are not thread safe, so the most likely issue here is that the InCallService // implementation is accessing the Bundle WHILE an incoming Telecom update comes in to // potentially replace the Bundle. We call "areBundlesEqual" to see if the newly // unparceled Call.Details is the same as what is already in the current Call instance. // If those two operations overleave, I can see the potential for concurrent // modification and edit of the Bundle. So we'll just catch here and assume the Bundles // are not the same. This means a Call.CallBack may fire the onCallDetails changed // callback when the Bundle didn't actually change. Log.e(LOG_TAG, e, "areBundlesEqual: failed!"); return false; } return true; } }