diff options
author | Ethan Chen <intervigil@gmail.com> | 2013-05-16 15:55:11 -0700 |
---|---|---|
committer | Ethan Chen <intervigil@gmail.com> | 2013-05-16 17:05:21 -0700 |
commit | fad8882d4a496a4cadb07bf2bfefbb8cad5c7579 (patch) | |
tree | c81b91f36f547cb9b41c4db6fcf8e0e146eb3150 | |
parent | e17912c8bd5528c395325a165a0c46cf005d8577 (diff) | |
download | frameworks_opt_telephony-fad8882d4a496a4cadb07bf2bfefbb8cad5c7579.zip frameworks_opt_telephony-fad8882d4a496a4cadb07bf2bfefbb8cad5c7579.tar.gz frameworks_opt_telephony-fad8882d4a496a4cadb07bf2bfefbb8cad5c7579.tar.bz2 |
HTCQualcommRIL: allow skipping of initial radio power off message
HTC 8960 radio starts by powering itself off, which leads to a race
situation where the radio powers on, then reads the power off message,
powering itself off again. Allow the initial power off
to be skipped.
Change-Id: Iebd53b98e63c8f2ec9461c7f220fa1bb7ccd1e17
-rw-r--r-- | src/java/com/android/internal/telephony/HTCQualcommRIL.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/java/com/android/internal/telephony/HTCQualcommRIL.java b/src/java/com/android/internal/telephony/HTCQualcommRIL.java index 81f4d16..c96f1ec 100644 --- a/src/java/com/android/internal/telephony/HTCQualcommRIL.java +++ b/src/java/com/android/internal/telephony/HTCQualcommRIL.java @@ -41,7 +41,7 @@ import java.util.ArrayList; * * {@hide} */ -public class HTCQualcommRIL extends QualcommSharedRIL implements CommandsInterface { +public class HTCQualcommRIL extends RIL implements CommandsInterface { private static final int RIL_UNSOL_ENTER_LPM = 3023; private static final int RIL_UNSOL_TPMR_ID = 3024; @@ -191,6 +191,7 @@ public class HTCQualcommRIL extends QualcommSharedRIL implements CommandsInterfa case RIL_UNSOL_RESPONSE_VOICE_RADIO_TECH_CHANGED: ret = responseVoid(p); break; case RIL_UNSOL_RESPONSE_IMS_NETWORK_STATE_CHANGED: ret = responseVoid(p); break; case RIL_UNSOL_RESPONSE_DATA_NETWORK_STATE_CHANGED: ret = responseVoid(p); break; + case RIL_UNSOL_RIL_CONNECTED: ret = responseInts(p); break; default: // Rewind the Parcel @@ -217,7 +218,33 @@ public class HTCQualcommRIL extends QualcommSharedRIL implements CommandsInterfa new AsyncResult (null, null, null)); } break; + case RIL_UNSOL_RIL_CONNECTED: { + if (RILJ_LOGD) unsljLogRet(response, ret); + + boolean skipRadioPowerOff = needsOldRilFeature("skipradiooff"); + + // Initial conditions + if (!skipRadioPowerOff) { + setRadioPower(false, null); + } + setPreferredNetworkType(mPreferredNetworkType, null); + setCdmaSubscriptionSource(mCdmaSubscription, null); + notifyRegistrantsRilConnectionChanged(((int[])ret)[0]); + break; + } } } + /** + * Notify all registrants that the ril has connected or disconnected. + * + * @param rilVer is the version of the ril or -1 if disconnected. + */ + private void notifyRegistrantsRilConnectionChanged(int rilVer) { + mRilVersion = rilVer; + if (mRilConnectedRegistrants != null) { + mRilConnectedRegistrants.notifyRegistrants( + new AsyncResult (null, new Integer(rilVer), null)); + } + } } |