Add otasp mode check to avoid any unnecessary otasp call.

 - When servicestatetracker is initializing, it notify otasp change if
 current RAT is CDMA. Once OtaspSimStateReceiver receive intent of
 carrier config change at this moment, it will get initial value of
 otasp mode, and start service to make otasp call.
 To avoid this symptom, add otasp mode check.

Bug: b/176815190
Test: Manual test. see b/176815190#9
Change-Id: If7f78c0e472eb369b94557f7b1d5b83682d47e71
(cherry picked from commit 0aa4089f459d48ef73a198b1bb2ef87d40477c2d)
diff --git a/src/com/android/phone/otasp/OtaspActivationService.java b/src/com/android/phone/otasp/OtaspActivationService.java
index 6ed2ea8..72bf249 100644
--- a/src/com/android/phone/otasp/OtaspActivationService.java
+++ b/src/com/android/phone/otasp/OtaspActivationService.java
@@ -31,6 +31,7 @@
 import com.android.internal.telephony.GsmCdmaConnection;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.PhoneConstants;
+import com.android.internal.telephony.ServiceStateTracker;
 import com.android.phone.PhoneGlobals;
 import com.android.phone.PhoneUtils;
 
@@ -77,6 +78,11 @@
     public void onCreate() {
         logd("otasp service onCreate");
         mPhone = PhoneGlobals.getPhone();
+        ServiceStateTracker sst = mPhone.getServiceStateTracker();
+        if (sst != null && sst.getOtasp() != TelephonyManager.OTASP_NEEDED) {
+            logd("OTASP is not needed.");
+            return;
+        }
         if ((sIccId == null) || !sIccId.equals(mPhone.getIccSerialNumber())) {
             // reset to allow activation retry on new sim
             sIccId = mPhone.getIccSerialNumber();