From 944362ee48df5081f3d0fe8cffe22c6e19a0cea7 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Tue, 15 Nov 2016 12:24:07 +0000 Subject: [PATCH] ril: Normalize ICC refresh responses We were ignoring some non-standard partial refresh results, resulting in no-ops. Fit them into the regular refresh hooks by using the pre-existing operation result codes. Change-Id: Icfeb045a9e6cf01fd350cc1f5a4734b31c883034 --- .../com/android/internal/telephony/MediaTekRIL.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ril/telephony/java/com/android/internal/telephony/MediaTekRIL.java b/ril/telephony/java/com/android/internal/telephony/MediaTekRIL.java index 1909338..a222418 100644 --- a/ril/telephony/java/com/android/internal/telephony/MediaTekRIL.java +++ b/ril/telephony/java/com/android/internal/telephony/MediaTekRIL.java @@ -43,6 +43,8 @@ import com.android.internal.telephony.MtkEccList; public class MediaTekRIL extends RIL implements CommandsInterface { static final String LOG_TAG = "MediaTekRIL"; + static final int REFRESH_SESSION_RESET = 6; /* Session reset */ + static final int RIL_REQUEST_VENDOR_BASE = 2000; static final int RIL_REQUEST_MODEM_POWEROFF = (RIL_REQUEST_VENDOR_BASE + 10); // static final int RIL_REQUEST_DUAL_SIM_MODE_SWITCH = (RIL_REQUEST_VENDOR_BASE + 11); @@ -269,6 +271,14 @@ public class MediaTekRIL extends RIL implements CommandsInterface { response.efId = rawefId == null ? 0 : Integer.parseInt(rawefId); response.aid = p.readString(); + if (response.refreshResult > IccRefreshResponse.REFRESH_RESULT_RESET) { + if (response.refreshResult == REFRESH_SESSION_RESET) { + response.refreshResult = IccRefreshResponse.REFRESH_RESULT_RESET; + } else { + response.refreshResult = IccRefreshResponse.REFRESH_RESULT_INIT; + } + } + return response; }