Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6b3e9b1a authored by Kolja Dummann's avatar Kolja Dummann
Browse files

telephony: Samsung RIL strip off the tailing NITZ data

Samsung added some extra data to the NITZ response that causes the
upper layers to get confused about the data and setting the wrong
timezone. GSMServiceStateTracker would read the last value as timezone
name like it is supplied by the emulator. We strip off these unused data.

Change-Id: I74be270a5c9bfd956183cbe0c56cfd17a357d395
parent 411e9dba
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -431,7 +431,16 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) {

	                Object[] result = new Object[2];

	                result[0] = ret;
			String nitz = (String)ret;
			if (RILJ_LOGD) riljLog(" RIL_UNSOL_NITZ_TIME_RECEIVED length = "
	                            + nitz.split("[/:,+-]").length);
			//remove the tailing information that samsung added to the string
			//it will screw the NITZ parser
			if(nitz.split("[/:,+-]").length >= 9)
			    nitz = nitz.substring(0,(nitz.lastIndexOf(",")));
			if (RILJ_LOGD) riljLog(" RIL_UNSOL_NITZ_TIME_RECEIVED striped nitz = "
	                            + nitz);
	                result[0] = nitz;
	                result[1] = Long.valueOf(nitzReceiveTime);

	                if (mNITZTimeRegistrant != null) {
@@ -440,7 +449,7 @@ public SamsungRIL(Context context, int networkMode, int cdmaSubscription) {
	                        .notifyRegistrant(new AsyncResult (null, result, null));
	                } else {
	                    // in case NITZ time registrant isnt registered yet
	                    mLastNITZTimeInfo = result;
	                    mLastNITZTimeInfo = nitz;
	                }
	            break;