Clear up the obsoleted cascading signal strength polling logic
The cascading polling logic were used on devices before
unsolicited signal reporting are supported. It has been
obsoleted now since all devices should support signal
reporting with radio hal after v1.2.
Bug: 178429976
Test: atest SignalStrengthControllerTest
Change-Id: Id82800f2bf9f025978d3e4271fb010e31aad242a
diff --git a/src/java/com/android/internal/telephony/ServiceStateTracker.java b/src/java/com/android/internal/telephony/ServiceStateTracker.java
index 62ec70e..25e0ba1 100755
--- a/src/java/com/android/internal/telephony/ServiceStateTracker.java
+++ b/src/java/com/android/internal/telephony/ServiceStateTracker.java
@@ -1284,8 +1284,6 @@
mPrevSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
mIsSimReady = true;
pollStateInternal(false);
- // Signal strength polling stops when radio is off
- queueNextSignalStrengthPoll();
break;
case EVENT_RADIO_STATE_CHANGED:
@@ -1293,9 +1291,6 @@
if(!mPhone.isPhoneTypeGsm() &&
mCi.getRadioState() == TelephonyManager.RADIO_POWER_ON) {
handleCdmaSubscriptionSource(mCdmaSSM.getCdmaSubscriptionSource());
-
- // Signal strength polling stops when radio is off.
- queueNextSignalStrengthPoll();
}
// This will do nothing in the 'radio not available' case
setPowerStateToDesired();
@@ -4601,10 +4596,6 @@
}
}
- private void queueNextSignalStrengthPoll() {
- mPhone.getSignalStrengthController().queueNextSignalStrengthPoll();
- }
-
private void notifyCdmaSubscriptionInfoReady() {
if (mCdmaForSubscriptionInfoReadyRegistrants != null) {
if (DBG) log("CDMA_SUBSCRIPTION: call notifyRegistrants()");
diff --git a/src/java/com/android/internal/telephony/SignalStrengthController.java b/src/java/com/android/internal/telephony/SignalStrengthController.java
index d99f4fc..37b8d04 100644
--- a/src/java/com/android/internal/telephony/SignalStrengthController.java
+++ b/src/java/com/android/internal/telephony/SignalStrengthController.java
@@ -38,14 +38,10 @@
import android.telephony.SignalStrengthUpdateRequest;
import android.telephony.SignalThresholdInfo;
import android.telephony.SubscriptionInfo;
-import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Pair;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.telephony.uicc.IccCardStatus;
-import com.android.internal.telephony.uicc.UiccCard;
-import com.android.internal.telephony.uicc.UiccController;
import com.android.internal.telephony.util.ArrayUtils;
import com.android.internal.util.IndentingPrintWriter;
import com.android.telephony.Rlog;
@@ -86,12 +82,6 @@
private final Phone mPhone;
private final CommandsInterface mCi;
- /**
- * By default, strength polling is enabled. However, if we're
- * getting unsolicited signal strength updates from the radio, set
- * value to true and don't bother polling any more.
- */
- private boolean mDontPollSignalStrength = false;
@NonNull
private SignalStrength mSignalStrength;
private long mSignalStrengthUpdatedTime;
@@ -215,8 +205,6 @@
}
ar = (AsyncResult) msg.obj;
onSignalStrengthResult(ar);
- queueNextSignalStrengthPoll();
-
break;
}
@@ -231,11 +219,6 @@
// This is a notification from CommandsInterface.setOnSignalStrengthUpdate
ar = (AsyncResult) msg.obj;
-
- // The radio is telling us about signal strength changes
- // we don't have to ask it
- mDontPollSignalStrength = true;
-
onSignalStrengthResult(ar);
break;
}
@@ -335,26 +318,6 @@
return false;
}
- void queueNextSignalStrengthPoll() {
- if (mDontPollSignalStrength) {
- // The radio is telling us about signal strength changes
- // we don't have to ask it
- return;
- }
-
- // if there is no SIM present, do not poll signal strength
- UiccCard uiccCard = UiccController.getInstance().getUiccCard(
- mPhone != null ? mPhone.getPhoneId() : SubscriptionManager.DEFAULT_PHONE_INDEX);
- if (uiccCard == null
- || uiccCard.getCardState() == IccCardStatus.CardState.CARDSTATE_ABSENT) {
- log("Not polling signal strength due to absence of SIM");
- return;
- }
-
- // TODO Don't poll signal strength if screen is off
- sendMessageDelayed(obtainMessage(EVENT_POLL_SIGNAL_STRENGTH), POLL_PERIOD_MILLIS);
- }
-
/**
* Update signal strength reporting criteria from the carrier config
*/
@@ -477,7 +440,6 @@
pw.println("mSignalRequestRecords=" + mSignalRequestRecords);
pw.println(" mLastSignalStrength=" + mLastSignalStrength);
pw.println(" mSignalStrength=" + mSignalStrength);
- pw.println(" mDontPollSignalStrength=" + mDontPollSignalStrength);
pw.println(" mLteRsrpBoost=" + mLteRsrpBoost);
pw.println(" mNrRsrpBoost=" + Arrays.toString(mNrRsrpBoost));
dumpEarfcnPairList(pw, mEarfcnPairListForRsrpBoost, "mEarfcnPairListForRsrpBoost");