From 9071ced8b09db7485ff341b32ec366f58637ac68 Mon Sep 17 00:00:00 2001 From: "xu.peng" Date: Tue, 22 Mar 2016 18:21:28 +0800 Subject: [PATCH] Fix "TelephonyRegistry notifies wrong data status" TelephonyRegistry should notify data status by correct subId, otherwise in some case, SIM1 data status will be overried by SIM2 data status. Such as screen on/off action.If in fact SIM1 is data connected to download something, but SIM2 is not,then sreen off, both SIM1 and SIM2 will be notified to update data status. Then SIM1 data status will be overried by SIM2 to be "no data connected", before SIM1 data downloading is finished,SIM1 will not be able to show "data conneced" status. Change-Id: Ia7d0767b3b4520294ee0d024903f7522cb0a0110 --- services/core/java/com/android/server/TelephonyRegistry.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 19a4851525a65..76c4aac30c6b0 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -1019,7 +1019,9 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { if (validatePhoneId(phoneId)) { mDataActivity[phoneId] = state; for (Record r : mRecords) { - if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_DATA_ACTIVITY)) { + // Notify by correct subId. + if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_DATA_ACTIVITY) && + idMatch(r.subId, subId, phoneId)) { try { r.callback.onDataActivity(state); } catch (RemoteException ex) {