am 9b5a5a0f: am eb69ddd4: am c2e35f33: (-s ours) am 932e8e5d: (-s ours) Reconcile...
Jean-Baptiste Queru [Mon, 11 Mar 2013 19:34:30 +0000 (12:34 -0700)]
* commit '9b5a5a0f9dac0b5d7d540e1669bbccc74c1a37d2':

150 files changed:
Android.mk
CleanSpec.mk
mockril/src/com/android/internal/telephony/mockril/MockRilController.java
src/java/android/provider/Telephony.java
src/java/android/telephony/SmsCbEtwsInfo.java
src/java/android/telephony/SmsManager.java
src/java/android/telephony/SmsMessage.java
src/java/com/android/internal/telephony/ApnContext.java
src/java/com/android/internal/telephony/BaseCommands.java
src/java/com/android/internal/telephony/Call.java
src/java/com/android/internal/telephony/CallManager.java
src/java/com/android/internal/telephony/CallTracker.java
src/java/com/android/internal/telephony/CommandException.java
src/java/com/android/internal/telephony/CommandsInterface.java
src/java/com/android/internal/telephony/Connection.java
src/java/com/android/internal/telephony/DataCallState.java
src/java/com/android/internal/telephony/DataConnection.java
src/java/com/android/internal/telephony/DataConnectionAc.java
src/java/com/android/internal/telephony/DataConnectionTracker.java
src/java/com/android/internal/telephony/DebugService.java
src/java/com/android/internal/telephony/DefaultPhoneNotifier.java
src/java/com/android/internal/telephony/DriverCall.java
src/java/com/android/internal/telephony/IIccPhoneBook.aidl
src/java/com/android/internal/telephony/ISms.aidl
src/java/com/android/internal/telephony/IccCard.java
src/java/com/android/internal/telephony/IccPhoneBookInterfaceManager.java
src/java/com/android/internal/telephony/IccPhoneBookInterfaceManagerProxy.java
src/java/com/android/internal/telephony/IccProvider.java
src/java/com/android/internal/telephony/IccSmsInterfaceManager.java
src/java/com/android/internal/telephony/IccUtils.java
src/java/com/android/internal/telephony/MccTable.java
src/java/com/android/internal/telephony/Phone.java
src/java/com/android/internal/telephony/PhoneBase.java
src/java/com/android/internal/telephony/PhoneFactory.java
src/java/com/android/internal/telephony/PhoneProxy.java
src/java/com/android/internal/telephony/PhoneStateIntentReceiver.java
src/java/com/android/internal/telephony/PhoneSubInfo.java
src/java/com/android/internal/telephony/RIL.java
src/java/com/android/internal/telephony/RetryManager.java
src/java/com/android/internal/telephony/SMSDispatcher.java
src/java/com/android/internal/telephony/ServiceStateTracker.java
src/java/com/android/internal/telephony/SmsStorageMonitor.java
src/java/com/android/internal/telephony/SmsUsageMonitor.java
src/java/com/android/internal/telephony/TelephonyCapabilities.java
src/java/com/android/internal/telephony/WapPushOverSms.java
src/java/com/android/internal/telephony/cat/AppInterface.java
src/java/com/android/internal/telephony/cat/BerTlv.java
src/java/com/android/internal/telephony/cat/CatCmdMessage.java
src/java/com/android/internal/telephony/cat/CatLog.java
src/java/com/android/internal/telephony/cat/CatResponseMessage.java
src/java/com/android/internal/telephony/cat/CatService.java
src/java/com/android/internal/telephony/cat/CommandParamsFactory.java
src/java/com/android/internal/telephony/cat/ComprehensionTlv.java
src/java/com/android/internal/telephony/cat/IconLoader.java
src/java/com/android/internal/telephony/cat/RilMessageDecoder.java
src/java/com/android/internal/telephony/cat/ValueParser.java
src/java/com/android/internal/telephony/cdma/CDMALTEPhone.java
src/java/com/android/internal/telephony/cdma/CDMAPhone.java
src/java/com/android/internal/telephony/cdma/CdmaCallTracker.java
src/java/com/android/internal/telephony/cdma/CdmaCallWaitingNotification.java
src/java/com/android/internal/telephony/cdma/CdmaConnection.java
src/java/com/android/internal/telephony/cdma/CdmaDataConnection.java
src/java/com/android/internal/telephony/cdma/CdmaDataConnectionTracker.java
src/java/com/android/internal/telephony/cdma/CdmaLteServiceStateTracker.java
src/java/com/android/internal/telephony/cdma/CdmaMmiCode.java
src/java/com/android/internal/telephony/cdma/CdmaSMSDispatcher.java
src/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java [changed mode: 0755->0644]
src/java/com/android/internal/telephony/cdma/CdmaSmsBroadcastConfigInfo.java [new file with mode: 0755]
src/java/com/android/internal/telephony/cdma/CdmaSubscriptionSourceManager.java
src/java/com/android/internal/telephony/cdma/EriManager.java
src/java/com/android/internal/telephony/cdma/RuimPhoneBookInterfaceManager.java
src/java/com/android/internal/telephony/cdma/RuimSmsInterfaceManager.java
src/java/com/android/internal/telephony/cdma/SignalToneUtil.java
src/java/com/android/internal/telephony/cdma/SmsMessage.java
src/java/com/android/internal/telephony/cdma/sms/BearerData.java
src/java/com/android/internal/telephony/gsm/GSMPhone.java
src/java/com/android/internal/telephony/gsm/GsmCallTracker.java
src/java/com/android/internal/telephony/gsm/GsmConnection.java
src/java/com/android/internal/telephony/gsm/GsmDataConnection.java
src/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
src/java/com/android/internal/telephony/gsm/GsmMmiCode.java
src/java/com/android/internal/telephony/gsm/GsmSMSDispatcher.java
src/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
src/java/com/android/internal/telephony/gsm/SimPhoneBookInterfaceManager.java
src/java/com/android/internal/telephony/gsm/SimSmsInterfaceManager.java
src/java/com/android/internal/telephony/gsm/SmsMessage.java
src/java/com/android/internal/telephony/gsm/UsimDataDownloadHandler.java
src/java/com/android/internal/telephony/gsm/UsimPhoneBookManager.java
src/java/com/android/internal/telephony/sip/SipCommandInterface.java
src/java/com/android/internal/telephony/sip/SipConnectionBase.java
src/java/com/android/internal/telephony/sip/SipPhone.java
src/java/com/android/internal/telephony/sip/SipPhoneBase.java
src/java/com/android/internal/telephony/sip/SipPhoneFactory.java
src/java/com/android/internal/telephony/test/ModelInterpreter.java
src/java/com/android/internal/telephony/test/SimulatedCommands.java
src/java/com/android/internal/telephony/test/SimulatedGsmCallState.java
src/java/com/android/internal/telephony/uicc/AdnRecord.aidl [moved from src/java/com/android/internal/telephony/AdnRecord.aidl with 93% similarity]
src/java/com/android/internal/telephony/uicc/AdnRecord.java [moved from src/java/com/android/internal/telephony/AdnRecord.java with 96% similarity]
src/java/com/android/internal/telephony/uicc/AdnRecordCache.java [moved from src/java/com/android/internal/telephony/AdnRecordCache.java with 98% similarity]
src/java/com/android/internal/telephony/uicc/AdnRecordLoader.java [moved from src/java/com/android/internal/telephony/AdnRecordLoader.java with 97% similarity]
src/java/com/android/internal/telephony/uicc/CsimFileHandler.java [moved from src/java/com/android/internal/telephony/CsimFileHandler.java with 86% similarity]
src/java/com/android/internal/telephony/uicc/IccCardApplicationStatus.java [moved from src/java/com/android/internal/telephony/IccCardApplicationStatus.java with 96% similarity]
src/java/com/android/internal/telephony/uicc/IccCardProxy.java [moved from src/java/com/android/internal/telephony/IccCardProxy.java with 91% similarity]
src/java/com/android/internal/telephony/uicc/IccCardStatus.java [moved from src/java/com/android/internal/telephony/IccCardStatus.java with 98% similarity]
src/java/com/android/internal/telephony/uicc/IccConstants.java [moved from src/java/com/android/internal/telephony/IccConstants.java with 98% similarity]
src/java/com/android/internal/telephony/uicc/IccException.java [moved from src/java/com/android/internal/telephony/IccException.java with 94% similarity]
src/java/com/android/internal/telephony/uicc/IccFileHandler.java [moved from src/java/com/android/internal/telephony/IccFileHandler.java with 99% similarity]
src/java/com/android/internal/telephony/uicc/IccFileNotFound.java [moved from src/java/com/android/internal/telephony/IccFileNotFound.java with 95% similarity]
src/java/com/android/internal/telephony/uicc/IccFileTypeMismatch.java [moved from src/java/com/android/internal/telephony/IccFileTypeMismatch.java with 94% similarity]
src/java/com/android/internal/telephony/uicc/IccIoResult.java [moved from src/java/com/android/internal/telephony/IccIoResult.java with 97% similarity]
src/java/com/android/internal/telephony/uicc/IccRecords.java [moved from src/java/com/android/internal/telephony/IccRecords.java with 83% similarity]
src/java/com/android/internal/telephony/uicc/IccRefreshResponse.java [moved from src/java/com/android/internal/telephony/IccRefreshResponse.java with 97% similarity]
src/java/com/android/internal/telephony/uicc/IccServiceTable.java [moved from src/java/com/android/internal/telephony/IccServiceTable.java with 93% similarity]
src/java/com/android/internal/telephony/uicc/IccUtils.java [new file with mode: 0644]
src/java/com/android/internal/telephony/uicc/IccVmFixedException.java [moved from src/java/com/android/internal/telephony/IccVmFixedException.java with 94% similarity]
src/java/com/android/internal/telephony/uicc/IccVmNotSupportedException.java [moved from src/java/com/android/internal/telephony/IccVmNotSupportedException.java with 94% similarity]
src/java/com/android/internal/telephony/uicc/IsimFileHandler.java [moved from src/java/com/android/internal/telephony/ims/IsimFileHandler.java with 82% similarity]
src/java/com/android/internal/telephony/uicc/IsimRecords.java [moved from src/java/com/android/internal/telephony/ims/IsimRecords.java with 97% similarity]
src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java [moved from src/java/com/android/internal/telephony/ims/IsimUiccRecords.java with 88% similarity]
src/java/com/android/internal/telephony/uicc/RuimFileHandler.java [moved from src/java/com/android/internal/telephony/cdma/RuimFileHandler.java with 87% similarity]
src/java/com/android/internal/telephony/uicc/RuimRecords.java [moved from src/java/com/android/internal/telephony/cdma/RuimRecords.java with 95% similarity]
src/java/com/android/internal/telephony/uicc/SIMFileHandler.java [moved from src/java/com/android/internal/telephony/gsm/SIMFileHandler.java with 83% similarity]
src/java/com/android/internal/telephony/uicc/SIMRecords.java [moved from src/java/com/android/internal/telephony/gsm/SIMRecords.java with 97% similarity]
src/java/com/android/internal/telephony/uicc/SpnOverride.java [moved from src/java/com/android/internal/telephony/gsm/SpnOverride.java with 91% similarity]
src/java/com/android/internal/telephony/uicc/UiccCard.java [moved from src/java/com/android/internal/telephony/UiccCard.java with 83% similarity]
src/java/com/android/internal/telephony/uicc/UiccCardApplication.java [moved from src/java/com/android/internal/telephony/UiccCardApplication.java with 90% similarity]
src/java/com/android/internal/telephony/uicc/UiccController.java
src/java/com/android/internal/telephony/uicc/UsimFileHandler.java [moved from src/java/com/android/internal/telephony/UsimFileHandler.java with 88% similarity]
src/java/com/android/internal/telephony/uicc/UsimServiceTable.java [moved from src/java/com/android/internal/telephony/gsm/UsimServiceTable.java with 97% similarity]
src/java/com/android/internal/telephony/uicc/VoiceMailConstants.java [moved from src/java/com/android/internal/telephony/gsm/VoiceMailConstants.java with 92% similarity]
tests/telephonymockriltests/src/com/android/telephonymockriltests/TelephonyMockTestRunner.java
tests/telephonymockriltests/src/com/android/telephonymockriltests/functional/SimpleTestUsingMockRil.java
tests/telephonytests/src/com/android/frameworks/telephonytests/TelephonyMockRilTestRunner.java
tests/telephonytests/src/com/android/internal/telephony/AdnRecordTest.java
tests/telephonytests/src/com/android/internal/telephony/CallerInfoTest.java
tests/telephonytests/src/com/android/internal/telephony/GsmAlphabetTest.java
tests/telephonytests/src/com/android/internal/telephony/IccServiceTableTest.java
tests/telephonytests/src/com/android/internal/telephony/MccTableTest.java
tests/telephonytests/src/com/android/internal/telephony/SMSDispatcherTest.java
tests/telephonytests/src/com/android/internal/telephony/SimPhoneBookTest.java
tests/telephonytests/src/com/android/internal/telephony/SimUtilsTest.java
tests/telephonytests/src/com/android/internal/telephony/SmsMessageBodyTest.java
tests/telephonytests/src/com/android/internal/telephony/TelephonyUtilsTest.java
tests/telephonytests/src/com/android/internal/telephony/cdma/CdmaSmsCbTest.java
tests/telephonytests/src/com/android/internal/telephony/gsm/GSMTestHandler.java
tests/telephonytests/src/com/android/internal/telephony/gsm/GsmSmsCbTest.java
tests/telephonytests/src/com/android/internal/telephony/gsm/UsimDataDownloadCommands.java
tests/telephonytests/src/com/android/internal/telephony/gsm/UsimDataDownloadTest.java
tests/telephonytests/src/com/android/internal/telephony/gsm/UsimServiceTableTest.java
tests/telephonytests/src/com/android/internal/telephony/mockril/MockRilTest.java

index 6a50514..9c43ee3 100644 (file)
@@ -17,12 +17,9 @@ LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
 LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java
-LOCAL_SRC_FILES := \
-       src/java/com/android/internal/telephony/ISms.aidl \
-    src/java/com/android/internal/telephony/IIccPhoneBook.aidl \
-    src/java/com/android/internal/telephony/EventLogTags.logtags \
-
-LOCAL_SRC_FILES += $(call all-java-files-under, src/java)
+LOCAL_SRC_FILES := $(call all-java-files-under, src/java) \
+       $(call all-Iaidl-files-under, src/java) \
+       $(call all-logtags-files-under, src/java)
 
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := telephony-common
index 8b3a29d..f4475ef 100644 (file)
@@ -40,6 +40,7 @@
 
 $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates)
 $(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates)
+$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/telephony-common_intermediates)
 
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
index 0e75c72..aef9fb5 100644 (file)
@@ -17,7 +17,7 @@
 package com.android.internal.telephony.mockril;
 
 import android.os.Bundle;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.communication.MsgHeader;
 import com.android.internal.communication.Msg;
@@ -62,7 +62,7 @@ public class MockRilController {
         try {
             Msg.send(mRilChannel, cmd, token, status, pbData);
         } catch (IOException e) {
-            Log.v(TAG, "send command : %d failed: " + e.getStackTrace());
+            Rlog.v(TAG, "send command : %d failed: " + e.getStackTrace());
             return false;
         }
         return true;
@@ -77,7 +77,7 @@ public class MockRilController {
         try {
             response = Msg.recv(mRilChannel);
         } catch (IOException e) {
-            Log.v(TAG, "receive response for getRadioState() error: " + e.getStackTrace());
+            Rlog.v(TAG, "receive response for getRadioState() error: " + e.getStackTrace());
             return null;
         }
         return response;
@@ -92,7 +92,7 @@ public class MockRilController {
         }
         Msg response = getCtrlResponse();
         if (response == null) {
-            Log.v(TAG, "failed to get response");
+            Rlog.v(TAG, "failed to get response");
             return -1;
         }
         response.printHeader(TAG);
@@ -113,17 +113,17 @@ public class MockRilController {
     public boolean setRadioState(int state) {
         RilCtrlCmds.CtrlReqRadioState req = new RilCtrlCmds.CtrlReqRadioState();
         if (state < 0 || state > RilCmds.RADIOSTATE_NV_READY) {
-            Log.v(TAG, "the give radio state is not valid.");
+            Rlog.v(TAG, "the give radio state is not valid.");
             return false;
         }
         req.setState(state);
         if (!sendCtrlCommand(RilCtrlCmds.CTRL_CMD_SET_RADIO_STATE, 0, 0, req)) {
-            Log.v(TAG, "send set radio state request failed.");
+            Rlog.v(TAG, "send set radio state request failed.");
             return false;
         }
         Msg response = getCtrlResponse();
         if (response == null) {
-            Log.v(TAG, "failed to get response for setRadioState");
+            Rlog.v(TAG, "failed to get response for setRadioState");
             return false;
         }
         response.printHeader(TAG);
@@ -144,7 +144,7 @@ public class MockRilController {
 
         req.setPhoneNumber(phoneNumber);
         if (!sendCtrlCommand(RilCtrlCmds.CTRL_CMD_SET_MT_CALL, 0, 0, req)) {
-            Log.v(TAG, "send CMD_SET_MT_CALL request failed");
+            Rlog.v(TAG, "send CMD_SET_MT_CALL request failed");
             return false;
         }
         return true;
@@ -163,7 +163,7 @@ public class MockRilController {
         req.setCallFailCause(failCause);
 
         if (!sendCtrlCommand(RilCtrlCmds.CTRL_CMD_HANGUP_CONN_REMOTE, 0, 0, req)) {
-            Log.v(TAG, "send CTRL_CMD_HANGUP_CONN_REMOTE request failed");
+            Rlog.v(TAG, "send CTRL_CMD_HANGUP_CONN_REMOTE request failed");
             return false;
         }
         return true;
@@ -183,7 +183,7 @@ public class MockRilController {
         req.setFlag(flag);
 
         if (!sendCtrlCommand(RilCtrlCmds.CTRL_CMD_SET_CALL_TRANSITION_FLAG, 0, 0, req)) {
-            Log.v(TAG, "send CTRL_CMD_SET_CALL_TRANSITION_FLAG request failed");
+            Rlog.v(TAG, "send CTRL_CMD_SET_CALL_TRANSITION_FLAG request failed");
             return false;
         }
         return true;
@@ -196,7 +196,7 @@ public class MockRilController {
      */
     public boolean setDialCallToAlert() {
         if (!sendCtrlCommand(RilCtrlCmds.CTRL_CMD_SET_CALL_ALERT, 0, 0, null)) {
-            Log.v(TAG, "send CTRL_CMD_SET_CALL_ALERT request failed");
+            Rlog.v(TAG, "send CTRL_CMD_SET_CALL_ALERT request failed");
             return false;
         }
         return true;
@@ -209,7 +209,7 @@ public class MockRilController {
     */
    public boolean setAlertCallToActive() {
         if (!sendCtrlCommand(RilCtrlCmds.CTRL_CMD_SET_CALL_ACTIVE, 0, 0, null)) {
-            Log.v(TAG, "send CTRL_CMD_SET_CALL_ACTIVE request failed");
+            Rlog.v(TAG, "send CTRL_CMD_SET_CALL_ACTIVE request failed");
             return false;
         }
         return true;
index e932e2b..50f3203 100644 (file)
@@ -28,7 +28,7 @@ import android.net.Uri;
 import android.os.Environment;
 import android.telephony.SmsMessage;
 import android.text.TextUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 import android.util.Patterns;
 
 
@@ -1293,7 +1293,7 @@ public final class Telephony {
             }
 
             Uri uri = uriBuilder.build();
-            //if (DEBUG) Log.v(TAG, "getOrCreateThreadId uri: " + uri);
+            //if (DEBUG) Rlog.v(TAG, "getOrCreateThreadId uri: " + uri);
 
             Cursor cursor = SqliteWrapper.query(context, context.getContentResolver(),
                     uri, ID_PROJECTION, null, null, null);
@@ -1302,14 +1302,14 @@ public final class Telephony {
                     if (cursor.moveToFirst()) {
                         return cursor.getLong(0);
                     } else {
-                        Log.e(TAG, "getOrCreateThreadId returned no rows!");
+                        Rlog.e(TAG, "getOrCreateThreadId returned no rows!");
                     }
                 } finally {
                     cursor.close();
                 }
             }
 
-            Log.e(TAG, "getOrCreateThreadId failed with uri " + uri.toString());
+            Rlog.e(TAG, "getOrCreateThreadId failed with uri " + uri.toString());
             throw new IllegalArgumentException("Unable to find or allocate a thread ID.");
         }
     }
index 0890d52..f208fbf 100644 (file)
@@ -20,7 +20,7 @@ import android.os.Parcel;
 import android.os.Parcelable;
 import android.text.format.Time;
 
-import com.android.internal.telephony.IccUtils;
+import com.android.internal.telephony.uicc.IccUtils;
 
 import java.util.Arrays;
 
index deffebc..e782379 100644 (file)
@@ -22,8 +22,8 @@ import android.os.ServiceManager;
 import android.text.TextUtils;
 
 import com.android.internal.telephony.ISms;
-import com.android.internal.telephony.IccConstants;
 import com.android.internal.telephony.SmsRawData;
+import com.android.internal.telephony.uicc.IccConstants;
 
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -358,7 +358,8 @@ public final class SmsManager {
      * Note: This call is blocking, callers may want to avoid calling it from
      * the main thread of an application.
      *
-     * @param messageIdentifier Message identifier as specified in TS 23.041
+     * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP)
+     * or C.R1001-G (3GPP2)
      * @return true if successful, false otherwise
      * @see #disableCellBroadcast(int)
      *
@@ -387,7 +388,8 @@ public final class SmsManager {
      * Note: This call is blocking, callers may want to avoid calling it from
      * the main thread of an application.
      *
-     * @param messageIdentifier Message identifier as specified in TS 23.041
+     * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP)
+     * or C.R1001-G (3GPP2)
      * @return true if successful, false otherwise
      *
      * @see #enableCellBroadcast(int)
@@ -418,8 +420,10 @@ public final class SmsManager {
      * Note: This call is blocking, callers may want to avoid calling it from
      * the main thread of an application.
      *
-     * @param startMessageId first message identifier as specified in TS 23.041
-     * @param endMessageId last message identifier as specified in TS 23.041
+     * @param startMessageId first message identifier as specified in TS 23.041 (3GPP)
+     * or C.R1001-G (3GPP2)
+     * @param endMessageId last message identifier as specified in TS 23.041 (3GPP)
+     * or C.R1001-G (3GPP2)
      * @return true if successful, false otherwise
      * @see #disableCellBroadcastRange(int, int)
      *
@@ -452,8 +456,10 @@ public final class SmsManager {
      * Note: This call is blocking, callers may want to avoid calling it from
      * the main thread of an application.
      *
-     * @param startMessageId first message identifier as specified in TS 23.041
-     * @param endMessageId last message identifier as specified in TS 23.041
+     * @param startMessageId first message identifier as specified in TS 23.041 (3GPP)
+     * or C.R1001-G (3GPP2)
+     * @param endMessageId last message identifier as specified in TS 23.041 (3GPP)
+     * or C.R1001-G (3GPP2)
      * @return true if successful, false otherwise
      *
      * @see #enableCellBroadcastRange(int, int)
index b94609e..c35f09e 100644 (file)
@@ -17,7 +17,7 @@
 package android.telephony;
 
 import android.os.Parcel;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.GsmAlphabet;
 import com.android.internal.telephony.GsmAlphabet.TextEncodingDetails;
@@ -158,7 +158,7 @@ public class SmsMessage {
         } else if (SmsConstants.FORMAT_3GPP.equals(format)) {
             wrappedMessage = com.android.internal.telephony.gsm.SmsMessage.createFromPdu(pdu);
         } else {
-            Log.e(LOG_TAG, "createFromPdu(): unsupported message format " + format);
+            Rlog.e(LOG_TAG, "createFromPdu(): unsupported message format " + format);
             return null;
         }
 
@@ -337,7 +337,7 @@ public class SmsMessage {
                 nextPos = pos + Math.min(limit / 2, textLen - pos);
             }
             if ((nextPos <= pos) || (nextPos > textLen)) {
-                Log.e(LOG_TAG, "fragmentText failed (" + pos + " >= " + nextPos + " or " +
+                Rlog.e(LOG_TAG, "fragmentText failed (" + pos + " >= " + nextPos + " or " +
                           nextPos + " >= " + textLen + ")");
                 break;
             }
index 4817a7b..b6083ad 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony;
 
-import android.util.Log;
+import android.telephony.Rlog;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
@@ -237,7 +237,7 @@ public class ApnContext {
     }
 
     protected void log(String s) {
-        Log.d(LOG_TAG, "[ApnContext:" + mApnType + "] " + s);
+        Rlog.d(LOG_TAG, "[ApnContext:" + mApnType + "] " + s);
     }
 
     public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
index 1b54656..49d3c76 100644 (file)
@@ -24,7 +24,7 @@ import android.os.Handler;
 import android.os.AsyncResult;
 import android.os.SystemProperties;
 import android.telephony.TelephonyManager;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import java.io.FileInputStream;
 import java.io.IOException;
@@ -555,11 +555,11 @@ public abstract class BaseCommands implements CommandsInterface {
      */
     @Override
     public void registerForRilConnected(Handler h, int what, Object obj) {
-        Log.d(LOG_TAG, "registerForRilConnected h=" + h + " w=" + what);
+        Rlog.d(LOG_TAG, "registerForRilConnected h=" + h + " w=" + what);
         Registrant r = new Registrant (h, what, obj);
         mRilConnectedRegistrants.add(r);
         if (mRilVersion != -1) {
-            Log.d(LOG_TAG, "Notifying: ril connected mRilVersion=" + mRilVersion);
+            Rlog.d(LOG_TAG, "Notifying: ril connected mRilVersion=" + mRilVersion);
             r.notifyRegistrant(new AsyncResult(null, new Integer(mRilVersion), null));
         }
     }
@@ -592,7 +592,7 @@ public abstract class BaseCommands implements CommandsInterface {
 
         synchronized (mStateMonitor) {
             if (false) {
-                Log.v(LOG_TAG, "setRadioState old: " + mState
+                Rlog.v(LOG_TAG, "setRadioState old: " + mState
                     + " new " + newState);
             }
 
@@ -607,25 +607,25 @@ public abstract class BaseCommands implements CommandsInterface {
             mRadioStateChangedRegistrants.notifyRegistrants();
 
             if (mState.isAvailable() && !oldState.isAvailable()) {
-                Log.d(LOG_TAG,"Notifying: radio available");
+                Rlog.d(LOG_TAG,"Notifying: radio available");
                 mAvailRegistrants.notifyRegistrants();
                 onRadioAvailable();
             }
 
             if (!mState.isAvailable() && oldState.isAvailable()) {
-                Log.d(LOG_TAG,"Notifying: radio not available");
+                Rlog.d(LOG_TAG,"Notifying: radio not available");
                 mNotAvailRegistrants.notifyRegistrants();
             }
 
             if (mState.isOn() && !oldState.isOn()) {
-                Log.d(LOG_TAG,"Notifying: Radio On");
+                Rlog.d(LOG_TAG,"Notifying: Radio On");
                 mOnRegistrants.notifyRegistrants();
             }
 
             if ((!mState.isOn() || !mState.isAvailable())
                 && !((!oldState.isOn() || !oldState.isAvailable()))
             ) {
-                Log.d(LOG_TAG,"Notifying: radio off or not available");
+                Rlog.d(LOG_TAG,"Notifying: radio off or not available");
                 mOffOrNotAvailRegistrants.notifyRegistrants();
             }
         }
index 4967ab8..2127258 100644 (file)
@@ -18,7 +18,7 @@ package com.android.internal.telephony;
 
 import java.util.List;
 
-import android.util.Log;
+import android.telephony.Rlog;
 
 /**
  * {@hide}
@@ -248,7 +248,7 @@ public abstract class Call {
             try {
                 hangup();
             } catch (CallStateException ex) {
-                Log.w(LOG_TAG, " hangupIfActive: caught " + ex);
+                Rlog.w(LOG_TAG, " hangupIfActive: caught " + ex);
             }
         }
     }
index 34ad810..1c1799f 100644 (file)
@@ -27,7 +27,7 @@ import android.os.RegistrantList;
 import android.os.Registrant;
 import android.telephony.PhoneStateListener;
 import android.telephony.ServiceState;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -295,7 +295,7 @@ public final class CallManager {
         if (basePhone != null && !mPhones.contains(basePhone)) {
 
             if (DBG) {
-                Log.d(LOG_TAG, "registerPhone(" +
+                Rlog.d(LOG_TAG, "registerPhone(" +
                         phone.getPhoneName() + " " + phone + ")");
             }
 
@@ -322,7 +322,7 @@ public final class CallManager {
         if (basePhone != null && mPhones.contains(basePhone)) {
 
             if (DBG) {
-                Log.d(LOG_TAG, "unregisterPhone(" +
+                Rlog.d(LOG_TAG, "unregisterPhone(" +
                         phone.getPhoneName() + " " + phone + ")");
             }
 
@@ -383,7 +383,7 @@ public final class CallManager {
                 if (curAudioMode != AudioManager.MODE_RINGTONE) {
                     // only request audio focus if the ringtone is going to be heard
                     if (audioManager.getStreamVolume(AudioManager.STREAM_RING) > 0) {
-                        if (VDBG) Log.d(LOG_TAG, "requestAudioFocus on STREAM_RING");
+                        if (VDBG) Rlog.d(LOG_TAG, "requestAudioFocus on STREAM_RING");
                         audioManager.requestAudioFocusForCall(AudioManager.STREAM_RING,
                                 AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
                     }
@@ -411,7 +411,7 @@ public final class CallManager {
                 }
                 if (audioManager.getMode() != newAudioMode || mSpeedUpAudioForMtCall) {
                     // request audio focus before setting the new mode
-                    if (VDBG) Log.d(LOG_TAG, "requestAudioFocus on STREAM_VOICE_CALL");
+                    if (VDBG) Rlog.d(LOG_TAG, "requestAudioFocus on STREAM_VOICE_CALL");
                     audioManager.requestAudioFocusForCall(AudioManager.STREAM_VOICE_CALL,
                             AudioManager.AUDIOFOCUS_GAIN_TRANSIENT);
                     audioManager.setMode(newAudioMode);
@@ -421,7 +421,7 @@ public final class CallManager {
             case IDLE:
                 if (audioManager.getMode() != AudioManager.MODE_NORMAL) {
                     audioManager.setMode(AudioManager.MODE_NORMAL);
-                    if (VDBG) Log.d(LOG_TAG, "abandonAudioFocus");
+                    if (VDBG) Rlog.d(LOG_TAG, "abandonAudioFocus");
                     // abandon audio focus after the mode has been set back to normal
                     audioManager.abandonAudioFocusForCall();
                 }
@@ -518,8 +518,8 @@ public final class CallManager {
         Phone ringingPhone = ringingCall.getPhone();
 
         if (VDBG) {
-            Log.d(LOG_TAG, "acceptCall(" +ringingCall + " from " + ringingCall.getPhone() + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "acceptCall(" +ringingCall + " from " + ringingCall.getPhone() + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if ( hasActiveFgCall() ) {
@@ -528,7 +528,7 @@ public final class CallManager {
             boolean sameChannel = (activePhone == ringingPhone);
 
             if (VDBG) {
-                Log.d(LOG_TAG, "hasBgCall: "+ hasBgCall + "sameChannel:" + sameChannel);
+                Rlog.d(LOG_TAG, "hasBgCall: "+ hasBgCall + "sameChannel:" + sameChannel);
             }
 
             if (sameChannel && hasBgCall) {
@@ -542,15 +542,15 @@ public final class CallManager {
 
         Context context = getContext();
         if (context == null) {
-            Log.d(LOG_TAG, "Speedup Audio Path enhancement: Context is null");
+            Rlog.d(LOG_TAG, "Speedup Audio Path enhancement: Context is null");
         } else if (context.getResources().getBoolean(
                 com.android.internal.R.bool.config_speed_up_audio_on_mt_calls)) {
-            Log.d(LOG_TAG, "Speedup Audio Path enhancement");
+            Rlog.d(LOG_TAG, "Speedup Audio Path enhancement");
             AudioManager audioManager = (AudioManager)
                     context.getSystemService(Context.AUDIO_SERVICE);
             int currMode = audioManager.getMode();
             if ((currMode != AudioManager.MODE_IN_CALL) && !(ringingPhone instanceof SipPhone)) {
-                Log.d(LOG_TAG, "setAudioMode Setting audio mode from " +
+                Rlog.d(LOG_TAG, "setAudioMode Setting audio mode from " +
                                 currMode + " to " + AudioManager.MODE_IN_CALL);
                 audioManager.setMode(AudioManager.MODE_IN_CALL);
                 mSpeedUpAudioForMtCall = true;
@@ -560,8 +560,8 @@ public final class CallManager {
         ringingPhone.acceptCall();
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End acceptCall(" +ringingCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End acceptCall(" +ringingCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
     }
 
@@ -576,8 +576,8 @@ public final class CallManager {
      */
     public void rejectCall(Call ringingCall) throws CallStateException {
         if (VDBG) {
-            Log.d(LOG_TAG, "rejectCall(" +ringingCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "rejectCall(" +ringingCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         Phone ringingPhone = ringingCall.getPhone();
@@ -585,8 +585,8 @@ public final class CallManager {
         ringingPhone.rejectCall();
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End rejectCall(" +ringingCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End rejectCall(" +ringingCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
     }
 
@@ -613,8 +613,8 @@ public final class CallManager {
         Phone heldPhone = null;
 
         if (VDBG) {
-            Log.d(LOG_TAG, "switchHoldingAndActive(" +heldCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "switchHoldingAndActive(" +heldCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (hasActiveFgCall()) {
@@ -634,8 +634,8 @@ public final class CallManager {
         }
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End switchHoldingAndActive(" +heldCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End switchHoldingAndActive(" +heldCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
     }
 
@@ -652,8 +652,8 @@ public final class CallManager {
         Phone backgroundPhone = null;
 
         if (VDBG) {
-            Log.d(LOG_TAG, "hangupForegroundResumeBackground(" +heldCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "hangupForegroundResumeBackground(" +heldCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (hasActiveFgCall()) {
@@ -671,8 +671,8 @@ public final class CallManager {
         }
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End hangupForegroundResumeBackground(" +heldCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End hangupForegroundResumeBackground(" +heldCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
     }
 
@@ -708,8 +708,8 @@ public final class CallManager {
     public void conference(Call heldCall) throws CallStateException {
 
         if (VDBG) {
-            Log.d(LOG_TAG, "conference(" +heldCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "conference(" +heldCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
 
@@ -723,8 +723,8 @@ public final class CallManager {
         }
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End conference(" +heldCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End conference(" +heldCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
     }
@@ -744,8 +744,8 @@ public final class CallManager {
         Connection result;
 
         if (VDBG) {
-            Log.d(LOG_TAG, " dial(" + basePhone + ", "+ dialString + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, " dial(" + basePhone + ", "+ dialString + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (!canDial(phone)) {
@@ -757,15 +757,15 @@ public final class CallManager {
             boolean hasBgCall = !(activePhone.getBackgroundCall().isIdle());
 
             if (DBG) {
-                Log.d(LOG_TAG, "hasBgCall: "+ hasBgCall + " sameChannel:" + (activePhone == basePhone));
+                Rlog.d(LOG_TAG, "hasBgCall: "+ hasBgCall + " sameChannel:" + (activePhone == basePhone));
             }
 
             if (activePhone != basePhone) {
                 if (hasBgCall) {
-                    Log.d(LOG_TAG, "Hangup");
+                    Rlog.d(LOG_TAG, "Hangup");
                     getActiveFgCall().hangup();
                 } else {
-                    Log.d(LOG_TAG, "Switch");
+                    Rlog.d(LOG_TAG, "Switch");
                     activePhone.switchHoldingAndActive();
                 }
             }
@@ -774,8 +774,8 @@ public final class CallManager {
         result = basePhone.dial(dialString);
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End dial(" + basePhone + ", "+ dialString + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End dial(" + basePhone + ", "+ dialString + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         return result;
@@ -830,7 +830,7 @@ public final class CallManager {
                     || (fgCallState == Call.State.DISCONNECTED)));
 
         if (result == false) {
-            Log.d(LOG_TAG, "canDial serviceState=" + serviceState
+            Rlog.d(LOG_TAG, "canDial serviceState=" + serviceState
                             + " hasRingingCall=" + hasRingingCall
                             + " hasActiveCall=" + hasActiveCall
                             + " hasHoldingCall=" + hasHoldingCall
@@ -874,8 +874,8 @@ public final class CallManager {
      */
     public void explicitCallTransfer(Call heldCall) throws CallStateException {
         if (VDBG) {
-            Log.d(LOG_TAG, " explicitCallTransfer(" + heldCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, " explicitCallTransfer(" + heldCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (canTransfer(heldCall)) {
@@ -883,8 +883,8 @@ public final class CallManager {
         }
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End explicitCallTransfer(" + heldCall + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End explicitCallTransfer(" + heldCall + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
     }
@@ -899,7 +899,7 @@ public final class CallManager {
      * @return null if phone doesn't have or support mmi code
      */
     public List<? extends MmiCode> getPendingMmiCodes(Phone phone) {
-        Log.e(LOG_TAG, "getPendingMmiCodes not implemented");
+        Rlog.e(LOG_TAG, "getPendingMmiCodes not implemented");
         return null;
     }
 
@@ -912,7 +912,7 @@ public final class CallManager {
      * @return false if phone doesn't support ussd service
      */
     public boolean sendUssdResponse(Phone phone, String ussdMessge) {
-        Log.e(LOG_TAG, "sendUssdResponse not implemented");
+        Rlog.e(LOG_TAG, "sendUssdResponse not implemented");
         return false;
     }
 
@@ -927,8 +927,8 @@ public final class CallManager {
 
     public void setMute(boolean muted) {
         if (VDBG) {
-            Log.d(LOG_TAG, " setMute(" + muted + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, " setMute(" + muted + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (hasActiveFgCall()) {
@@ -936,8 +936,8 @@ public final class CallManager {
         }
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End setMute(" + muted + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End setMute(" + muted + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
     }
 
@@ -964,8 +964,8 @@ public final class CallManager {
      */
     public void setEchoSuppressionEnabled(boolean enabled) {
         if (VDBG) {
-            Log.d(LOG_TAG, " setEchoSuppression(" + enabled + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, " setEchoSuppression(" + enabled + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (hasActiveFgCall()) {
@@ -973,8 +973,8 @@ public final class CallManager {
         }
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End setEchoSuppression(" + enabled + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End setEchoSuppression(" + enabled + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
     }
 
@@ -990,8 +990,8 @@ public final class CallManager {
         boolean result = false;
 
         if (VDBG) {
-            Log.d(LOG_TAG, " sendDtmf(" + c + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, " sendDtmf(" + c + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (hasActiveFgCall()) {
@@ -1000,8 +1000,8 @@ public final class CallManager {
         }
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End sendDtmf(" + c + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End sendDtmf(" + c + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
         return result;
     }
@@ -1019,8 +1019,8 @@ public final class CallManager {
         boolean result = false;
 
         if (VDBG) {
-            Log.d(LOG_TAG, " startDtmf(" + c + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, " startDtmf(" + c + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (hasActiveFgCall()) {
@@ -1029,8 +1029,8 @@ public final class CallManager {
         }
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End startDtmf(" + c + ")");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End startDtmf(" + c + ")");
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         return result;
@@ -1042,15 +1042,15 @@ public final class CallManager {
      */
     public void stopDtmf() {
         if (VDBG) {
-            Log.d(LOG_TAG, " stopDtmf()" );
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, " stopDtmf()" );
+            Rlog.d(LOG_TAG, this.toString());
         }
 
         if (hasActiveFgCall()) getFgPhone().stopDtmf();
 
         if (VDBG) {
-            Log.d(LOG_TAG, "End stopDtmf()");
-            Log.d(LOG_TAG, this.toString());
+            Rlog.d(LOG_TAG, "End stopDtmf()");
+            Rlog.d(LOG_TAG, this.toString());
         }
     }
 
@@ -1742,98 +1742,98 @@ public final class CallManager {
 
             switch (msg.what) {
                 case EVENT_DISCONNECT:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_DISCONNECT)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_DISCONNECT)");
                     mDisconnectRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_PRECISE_CALL_STATE_CHANGED:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_PRECISE_CALL_STATE_CHANGED)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_PRECISE_CALL_STATE_CHANGED)");
                     mPreciseCallStateRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_NEW_RINGING_CONNECTION:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_NEW_RINGING_CONNECTION)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_NEW_RINGING_CONNECTION)");
                     if (getActiveFgCallState().isDialing() || hasMoreThanOneRingingCall()) {
                         Connection c = (Connection) ((AsyncResult) msg.obj).result;
                         try {
-                            Log.d(LOG_TAG, "silently drop incoming call: " + c.getCall());
+                            Rlog.d(LOG_TAG, "silently drop incoming call: " + c.getCall());
                             c.getCall().hangup();
                         } catch (CallStateException e) {
-                            Log.w(LOG_TAG, "new ringing connection", e);
+                            Rlog.w(LOG_TAG, "new ringing connection", e);
                         }
                     } else {
                         mNewRingingConnectionRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     }
                     break;
                 case EVENT_UNKNOWN_CONNECTION:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_UNKNOWN_CONNECTION)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_UNKNOWN_CONNECTION)");
                     mUnknownConnectionRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_INCOMING_RING:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_INCOMING_RING)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_INCOMING_RING)");
                     // The event may come from RIL who's not aware of an ongoing fg call
                     if (!hasActiveFgCall()) {
                         mIncomingRingRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     }
                     break;
                 case EVENT_RINGBACK_TONE:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_RINGBACK_TONE)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_RINGBACK_TONE)");
                     mRingbackToneRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_IN_CALL_VOICE_PRIVACY_ON:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_IN_CALL_VOICE_PRIVACY_ON)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_IN_CALL_VOICE_PRIVACY_ON)");
                     mInCallVoicePrivacyOnRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_IN_CALL_VOICE_PRIVACY_OFF:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_IN_CALL_VOICE_PRIVACY_OFF)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_IN_CALL_VOICE_PRIVACY_OFF)");
                     mInCallVoicePrivacyOffRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_CALL_WAITING:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_CALL_WAITING)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_CALL_WAITING)");
                     mCallWaitingRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_DISPLAY_INFO:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_DISPLAY_INFO)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_DISPLAY_INFO)");
                     mDisplayInfoRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_SIGNAL_INFO:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_SIGNAL_INFO)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_SIGNAL_INFO)");
                     mSignalInfoRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_CDMA_OTA_STATUS_CHANGE:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_CDMA_OTA_STATUS_CHANGE)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_CDMA_OTA_STATUS_CHANGE)");
                     mCdmaOtaStatusChangeRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_RESEND_INCALL_MUTE:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_RESEND_INCALL_MUTE)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_RESEND_INCALL_MUTE)");
                     mResendIncallMuteRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_MMI_INITIATE:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_MMI_INITIATE)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_MMI_INITIATE)");
                     mMmiInitiateRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_MMI_COMPLETE:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_MMI_COMPLETE)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_MMI_COMPLETE)");
                     mMmiCompleteRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_ECM_TIMER_RESET:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_ECM_TIMER_RESET)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_ECM_TIMER_RESET)");
                     mEcmTimerResetRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_SUBSCRIPTION_INFO_READY:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_SUBSCRIPTION_INFO_READY)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_SUBSCRIPTION_INFO_READY)");
                     mSubscriptionInfoReadyRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_SUPP_SERVICE_FAILED:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_SUPP_SERVICE_FAILED)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_SUPP_SERVICE_FAILED)");
                     mSuppServiceFailedRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_SERVICE_STATE_CHANGED:
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_SERVICE_STATE_CHANGED)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_SERVICE_STATE_CHANGED)");
                     mServiceStateChangedRegistrants.notifyRegistrants((AsyncResult) msg.obj);
                     break;
                 case EVENT_POST_DIAL_CHARACTER:
                     // we need send the character that is being processed in msg.arg1
                     // so can't use notifyRegistrants()
-                    if (VDBG) Log.d(LOG_TAG, " handleMessage (EVENT_POST_DIAL_CHARACTER)");
+                    if (VDBG) Rlog.d(LOG_TAG, " handleMessage (EVENT_POST_DIAL_CHARACTER)");
                     for(int i=0; i < mPostDialCharacterRegistrants.size(); i++) {
                         Message notifyMsg;
                         notifyMsg = ((Registrant)mPostDialCharacterRegistrants.get(i)).messageForRegistrant();
index 62caf01..efe53c9 100644 (file)
@@ -21,7 +21,7 @@ import android.os.Handler;
 import android.os.Message;
 import android.os.SystemProperties;
 import android.text.TextUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.CommandException;
 
index 94c544e..d1085f6 100644 (file)
@@ -18,7 +18,7 @@ package com.android.internal.telephony;
 
 import com.android.internal.telephony.RILConstants;
 
-import android.util.Log;
+import android.telephony.Rlog;
 
 /**
  * {@hide}
@@ -84,7 +84,7 @@ public class CommandException extends RuntimeException {
             case RILConstants.ILLEGAL_SIM_OR_ME:
                 return new CommandException(Error.ILLEGAL_SIM_OR_ME);
             default:
-                Log.e("GSM", "Unrecognized RIL errno " + ril_errno);
+                Rlog.e("GSM", "Unrecognized RIL errno " + ril_errno);
                 return new CommandException(Error.INVALID_RESPONSE);
         }
     }
index f7757b3..fc116ef 100644 (file)
 
 package com.android.internal.telephony;
 
+import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
 import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
+import com.android.internal.telephony.uicc.IccCardStatus;
 
 import android.os.Message;
 import android.os.Handler;
-import android.util.Log;
+import android.telephony.Rlog;
 
 /**
  * {@hide}
@@ -1522,11 +1524,10 @@ public interface CommandsInterface {
     /**
      * Configure cdma cell broadcast SMS.
      *
-     * @param result
+     * @param response
      *            Callback message is empty on completion
      */
-    // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig
-    public void setCdmaBroadcastConfig(int[] configValuesArray, Message result);
+    public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response);
 
     /**
      * Query the current configuration of cdma cell broadcast SMS.
index 554d974..8e10af5 100644 (file)
@@ -16,6 +16,7 @@
 
 package com.android.internal.telephony;
 
+import android.telephony.Rlog;
 import android.util.Log;
 
 /**
@@ -293,7 +294,7 @@ public abstract class Connection {
     public String toString() {
         StringBuilder str = new StringBuilder(128);
 
-        if (Log.isLoggable(LOG_TAG, Log.DEBUG)) {
+        if (Rlog.isLoggable(LOG_TAG, Log.DEBUG)) {
             str.append("addr: " + getAddress())
                     .append(" pres.: " + getNumberPresentation())
                     .append(" dial: " + getOrigDialString())
index efbf608..c3a3b1d 100644 (file)
@@ -22,7 +22,7 @@ import android.net.LinkProperties;
 import android.net.NetworkUtils;
 import android.net.RouteInfo;
 import android.os.SystemProperties;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.DataConnection.FailCause;
 
@@ -149,7 +149,7 @@ public class DataCallState {
                                 // Assume point to point
                                 addrPrefixLen = (ia instanceof Inet4Address) ? 32 : 128;
                             }
-                            if (DBG) Log.d(LOG_TAG, "addr/pl=" + addr + "/" + addrPrefixLen);
+                            if (DBG) Rlog.d(LOG_TAG, "addr/pl=" + addr + "/" + addrPrefixLen);
                             la = new LinkAddress(ia, addrPrefixLen);
                             linkProperties.addLinkAddress(la);
                         }
@@ -219,7 +219,7 @@ public class DataCallState {
 
                 result = SetupResult.SUCCESS;
             } catch (UnknownHostException e) {
-                Log.d(LOG_TAG, "setLinkProperties: UnknownHostException " + e);
+                Rlog.d(LOG_TAG, "setLinkProperties: UnknownHostException " + e);
                 e.printStackTrace();
                 result = SetupResult.ERR_UnacceptableParameter;
             }
@@ -234,7 +234,7 @@ public class DataCallState {
         // An error occurred so clear properties
         if (result != SetupResult.SUCCESS) {
             if(DBG) {
-                Log.d(LOG_TAG, "setLinkProperties: error clearing LinkProperties " +
+                Rlog.d(LOG_TAG, "setLinkProperties: error clearing LinkProperties " +
                         "status=" + status + " result=" + result);
             }
             linkProperties.clear();
index 9751040..43b89d0 100644 (file)
@@ -163,9 +163,11 @@ public abstract class DataConnection extends StateMachine {
         public boolean isPermanentFail() {
             return (this == OPERATOR_BARRED) || (this == MISSING_UNKNOWN_APN) ||
                    (this == UNKNOWN_PDP_ADDRESS_TYPE) || (this == USER_AUTHENTICATION) ||
-                   (this == SERVICE_OPTION_NOT_SUPPORTED) ||
+                   (this == ACTIVATION_REJECT_GGSN) || (this == SERVICE_OPTION_NOT_SUPPORTED) ||
                    (this == SERVICE_OPTION_NOT_SUBSCRIBED) || (this == NSAPI_IN_USE) ||
-                   (this == PROTOCOL_ERRORS);
+                   (this == ONLY_IPV4_ALLOWED) || (this == ONLY_IPV6_ALLOWED) ||
+                   (this == PROTOCOL_ERRORS) || (this == SIGNAL_LOST) ||
+                   (this == RADIO_POWER_OFF) || (this == TETHERED_CALL_ACTIVE);
         }
 
         public boolean isEventLoggable() {
@@ -175,7 +177,9 @@ public abstract class DataConnection extends StateMachine {
                     (this == SERVICE_OPTION_NOT_SUBSCRIBED) ||
                     (this == SERVICE_OPTION_NOT_SUPPORTED) ||
                     (this == SERVICE_OPTION_OUT_OF_ORDER) || (this == NSAPI_IN_USE) ||
-                    (this == PROTOCOL_ERRORS) ||
+                    (this == ONLY_IPV4_ALLOWED) || (this == ONLY_IPV6_ALLOWED) ||
+                    (this == PROTOCOL_ERRORS) || (this == SIGNAL_LOST) ||
+                    (this == RADIO_POWER_OFF) || (this == TETHERED_CALL_ACTIVE) ||
                     (this == UNACCEPTABLE_NETWORK_PARAMETER);
         }
 
index a24414f..2cd64e1 100644 (file)
@@ -586,6 +586,6 @@ public class DataConnectionAc extends AsyncChannel {
     }
 
     private void log(String s) {
-        android.util.Log.d(mLogTag, "DataConnectionAc " + s);
+        android.telephony.Rlog.d(mLogTag, "DataConnectionAc " + s);
     }
 }
index a2980be..ec83723 100644 (file)
@@ -44,11 +44,12 @@ import android.telephony.ServiceState;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
 import android.util.EventLog;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.R;
 import com.android.internal.telephony.DataConnection.FailCause;
 import com.android.internal.telephony.DctConstants;
+import com.android.internal.telephony.uicc.IccRecords;
 import com.android.internal.telephony.uicc.UiccController;
 import com.android.internal.util.AsyncChannel;
 
@@ -706,7 +707,7 @@ public abstract class DataConnectionTracker extends Handler {
                 break;
 
             default:
-                Log.e("DATA", "Unidentified event msg=" + msg);
+                Rlog.e("DATA", "Unidentified event msg=" + msg);
                 break;
         }
     }
@@ -1294,6 +1295,7 @@ public abstract class DataConnectionTracker extends Handler {
                 throw new RuntimeException("doRecovery: Invalid recoveryAction=" +
                     recoveryAction);
             }
+            mSentSinceLastRecv = 0;
         }
     }
 
@@ -1373,32 +1375,34 @@ public abstract class DataConnectionTracker extends Handler {
         int nextAction = getRecoveryAction();
         int delayInMs;
 
-        // If screen is on or data stall is currently suspected, set the alarm
-        // with an aggresive timeout.
-        if (mIsScreenOn || suspectedStall || RecoveryAction.isAggressiveRecovery(nextAction)) {
-            delayInMs = Settings.Global.getInt(mResolver,
-                                       Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS,
-                                       DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS_DEFAULT);
-        } else {
-            delayInMs = Settings.Global.getInt(mResolver,
-                                       Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS,
-                                       DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS_DEFAULT);
-        }
+        if (getOverallState() == DctConstants.State.CONNECTED) {
+            // If screen is on or data stall is currently suspected, set the alarm
+            // with an aggresive timeout.
+            if (mIsScreenOn || suspectedStall || RecoveryAction.isAggressiveRecovery(nextAction)) {
+                delayInMs = Settings.Global.getInt(mResolver,
+                        Settings.Global.DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS,
+                        DATA_STALL_ALARM_AGGRESSIVE_DELAY_IN_MS_DEFAULT);
+            } else {
+                delayInMs = Settings.Global.getInt(mResolver,
+                        Settings.Global.DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS,
+                        DATA_STALL_ALARM_NON_AGGRESSIVE_DELAY_IN_MS_DEFAULT);
+            }
 
-        mDataStallAlarmTag += 1;
-        if (VDBG) {
-            log("startDataStallAlarm: tag=" + mDataStallAlarmTag +
-                    " delay=" + (delayInMs / 1000) + "s");
-        }
-        AlarmManager am =
-            (AlarmManager) mPhone.getContext().getSystemService(Context.ALARM_SERVICE);
+            mDataStallAlarmTag += 1;
+            if (VDBG) {
+                log("startDataStallAlarm: tag=" + mDataStallAlarmTag +
+                        " delay=" + (delayInMs / 1000) + "s");
+            }
+            AlarmManager am =
+                    (AlarmManager) mPhone.getContext().getSystemService(Context.ALARM_SERVICE);
 
-        Intent intent = new Intent(getActionIntentDataStallAlarm());
-        intent.putExtra(DATA_STALL_ALARM_TAG_EXTRA, mDataStallAlarmTag);
-        mDataStallAlarmIntent = PendingIntent.getBroadcast(mPhone.getContext(), 0, intent,
-                PendingIntent.FLAG_UPDATE_CURRENT);
-        am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
-                SystemClock.elapsedRealtime() + delayInMs, mDataStallAlarmIntent);
+            Intent intent = new Intent(getActionIntentDataStallAlarm());
+            intent.putExtra(DATA_STALL_ALARM_TAG_EXTRA, mDataStallAlarmTag);
+            mDataStallAlarmIntent = PendingIntent.getBroadcast(mPhone.getContext(), 0, intent,
+                    PendingIntent.FLAG_UPDATE_CURRENT);
+            am.set(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+                    SystemClock.elapsedRealtime() + delayInMs, mDataStallAlarmIntent);
+        }
     }
 
     protected void stopDataStallAlarm() {
index 29fea6e..deba3eb 100644 (file)
 
 package com.android.internal.telephony;
 
-import android.util.Log;
+import android.telephony.Rlog;
+
+import com.android.internal.telephony.uicc.UiccController;
+import com.android.internal.telephony.uicc.IccCardProxy;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
@@ -99,10 +102,24 @@ public class DebugService {
         }
         pw.flush();
         pw.println("++++++++++++++++++++++++++++++++");
+        try {
+            UiccController.getInstance().dump(fd, pw, args);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        pw.flush();
+        pw.println("++++++++++++++++++++++++++++++++");
+        try {
+            ((IccCardProxy)phoneProxy.getIccCard()).dump(fd, pw, args);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        pw.flush();
+        pw.println("++++++++++++++++++++++++++++++++");
         log("dump: -");
     }
 
     private static void log(String s) {
-        Log.d(TAG, "DebugService " + s);
+        Rlog.d(TAG, "DebugService " + s);
     }
 }
index 157fee6..8f4ae84 100644 (file)
@@ -24,7 +24,7 @@ import android.os.ServiceManager;
 import android.telephony.CellInfo;
 import android.telephony.ServiceState;
 import android.telephony.TelephonyManager;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.ITelephonyRegistry;
 
@@ -176,7 +176,7 @@ public class DefaultPhoneNotifier implements PhoneNotifier {
     }
 
     private void log(String s) {
-        Log.d(LOG_TAG, "[PhoneNotifier] " + s);
+        Rlog.d(LOG_TAG, "[PhoneNotifier] " + s);
     }
 
     /**
index b1e63ae..c76be5f 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony;
 //import com.android.internal.telephony.*;
-import android.util.Log;
+import android.telephony.Rlog;
 import java.lang.Comparable;
 import android.telephony.PhoneNumberUtils;
 
@@ -90,7 +90,7 @@ public class DriverCall implements Comparable {
 
             }
         } catch (ATParseEx ex) {
-            Log.e(LOG_TAG,"Invalid CLCC line: '" + line + "'");
+            Rlog.e(LOG_TAG,"Invalid CLCC line: '" + line + "'");
             return null;
         }
 
index f700dfe..95b3efb 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony;
 
-import com.android.internal.telephony.AdnRecord;
+import com.android.internal.telephony.uicc.AdnRecord;
 
 
 
index 1fd9f70..6917b1b 100644 (file)
@@ -150,7 +150,8 @@ interface ISms {
      * message identifier, they must both disable it for the device to stop
      * receiving those messages.
      *
-     * @param messageIdentifier Message identifier as specified in TS 23.041
+     * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
      * @return true if successful, false otherwise
      *
      * @see #disableCellBroadcast(int)
@@ -163,21 +164,24 @@ interface ISms {
      * message identifier, they must both disable it for the device to stop
      * receiving those messages.
      *
-     * @param messageIdentifier Message identifier as specified in TS 23.041
+     * @param messageIdentifier Message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
      * @return true if successful, false otherwise
      *
      * @see #enableCellBroadcast(int)
      */
     boolean disableCellBroadcast(int messageIdentifier);
 
-    /**
+    /*
      * Enable reception of cell broadcast (SMS-CB) messages with the given
      * message identifier range. Note that if two different clients enable
      * a message identifier range, they must both disable it for the device
      * to stop receiving those messages.
      *
-     * @param startMessageId first message identifier as specified in TS 23.041
-     * @param endMessageId last message identifier as specified in TS 23.041
+     * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
+     * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
      * @return true if successful, false otherwise
      *
      * @see #disableCellBroadcastRange(int, int)
@@ -190,8 +194,10 @@ interface ISms {
      * a message identifier range, they must both disable it for the device
      * to stop receiving those messages.
      *
-     * @param startMessageId first message identifier as specified in TS 23.041
-     * @param endMessageId last message identifier as specified in TS 23.041
+     * @param startMessageId first message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
+     * @param endMessageId last message identifier as specified in TS 23.041 (3GPP) or
+     *   C.R1001-G (3GPP2)
      * @return true if successful, false otherwise
      *
      * @see #enableCellBroadcastRange(int, int)
index f1ac581..1ec4f18 100644 (file)
@@ -20,6 +20,9 @@ import android.os.Handler;
 import android.os.Message;
 
 import com.android.internal.telephony.IccCardConstants.State;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus;
+import com.android.internal.telephony.uicc.IccFileHandler;
+import com.android.internal.telephony.uicc.IccRecords;
 
 /**
  * {@hide}
index 9f561da..2bab4bb 100644 (file)
@@ -23,7 +23,12 @@ import android.os.Looper;
 import android.os.Message;
 import android.os.ServiceManager;
 
-import com.android.internal.telephony.IccCardApplicationStatus.AppType;
+import com.android.internal.telephony.uicc.AdnRecord;
+import com.android.internal.telephony.uicc.AdnRecordCache;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType;
+import com.android.internal.telephony.uicc.IccConstants;
+import com.android.internal.telephony.uicc.IccRecords;
 
 import java.util.List;
 import java.util.concurrent.atomic.AtomicBoolean;
index 1c0fc52..6810fb0 100644 (file)
@@ -23,7 +23,10 @@ import android.os.Looper;
 import android.os.Message;
 import android.os.ServiceManager;
 import android.telephony.PhoneNumberUtils;
-import android.util.Log;
+import android.telephony.Rlog;
+
+import com.android.internal.telephony.uicc.AdnRecord;
+
 
 import java.util.ArrayList;
 import java.util.List;
index a66e19d..6f2c4ed 100644 (file)
@@ -25,13 +25,13 @@ import android.net.Uri;
 import android.os.RemoteException;
 import android.os.ServiceManager;
 import android.text.TextUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import java.util.List;
 
-import com.android.internal.telephony.IccConstants;
-import com.android.internal.telephony.AdnRecord;
 import com.android.internal.telephony.IIccPhoneBook;
+import com.android.internal.telephony.uicc.AdnRecord;
+import com.android.internal.telephony.uicc.IccConstants;
 
 
 /**
@@ -207,12 +207,7 @@ public class IccProvider extends ContentProvider {
             String param = tokens[n];
             if (DBG) log("parsing '" + param + "'");
 
-            String[] pair = param.split("=");
-
-            if (pair.length != 2) {
-                Log.e(TAG, "resolve: bad whereClause parameter: " + param);
-                continue;
-            }
+            String[] pair = param.split("=", 2);
 
             String key = pair[0].trim();
             String val = pair[1].trim();
@@ -312,7 +307,7 @@ public class IccProvider extends ContentProvider {
             return cursor;
         } else {
             // No results to load
-            Log.w(TAG, "Cannot load ADN records");
+            Rlog.w(TAG, "Cannot load ADN records");
             return new MatrixCursor(ADDRESS_BOOK_COLUMN_NAMES);
         }
     }
@@ -425,7 +420,7 @@ public class IccProvider extends ContentProvider {
     }
 
     private void log(String msg) {
-        Log.d(TAG, "[IccProvider] " + msg);
+        Rlog.d(TAG, "[IccProvider] " + msg);
     }
 
 }
index 525bcd9..10ca2cc 100644 (file)
@@ -18,29 +18,123 @@ package com.android.internal.telephony;
 
 import android.app.PendingIntent;
 import android.content.Context;
+import android.os.AsyncResult;
+import android.os.Handler;
+import android.os.Message;
+import android.telephony.Rlog;
 import android.util.Log;
 
+import com.android.internal.telephony.uicc.IccConstants;
+import com.android.internal.telephony.uicc.IccFileHandler;
 import com.android.internal.util.HexDump;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import static android.telephony.SmsManager.STATUS_ON_ICC_FREE;
+import static android.telephony.SmsManager.STATUS_ON_ICC_READ;
+import static android.telephony.SmsManager.STATUS_ON_ICC_UNREAD;
 
 /**
  * IccSmsInterfaceManager to provide an inter-process communication to
  * access Sms in Icc.
  */
 public abstract class IccSmsInterfaceManager extends ISms.Stub {
+    static final String LOG_TAG = "RIL_IccSms";
+    static final boolean DBG = true;
+
+    protected final Object mLock = new Object();
+    protected boolean mSuccess;
+    private List<SmsRawData> mSms;
+
+    private static final int EVENT_LOAD_DONE = 1;
+    private static final int EVENT_UPDATE_DONE = 2;
+    protected static final int EVENT_SET_BROADCAST_ACTIVATION_DONE = 3;
+    protected static final int EVENT_SET_BROADCAST_CONFIG_DONE = 4;
+
     protected PhoneBase mPhone;
     protected Context mContext;
     protected SMSDispatcher mDispatcher;
 
+    protected Handler mHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            AsyncResult ar;
+
+            switch (msg.what) {
+                case EVENT_UPDATE_DONE:
+                    ar = (AsyncResult) msg.obj;
+                    synchronized (mLock) {
+                        mSuccess = (ar.exception == null);
+                        mLock.notifyAll();
+                    }
+                    break;
+                case EVENT_LOAD_DONE:
+                    ar = (AsyncResult)msg.obj;
+                    synchronized (mLock) {
+                        if (ar.exception == null) {
+                            mSms = buildValidRawData((ArrayList<byte[]>) ar.result);
+                            //Mark SMS as read after importing it from card.
+                            markMessagesAsRead((ArrayList<byte[]>) ar.result);
+                        } else {
+                            if(DBG) log("Cannot load Sms records");
+                            if (mSms != null)
+                                mSms.clear();
+                        }
+                        mLock.notifyAll();
+                    }
+                    break;
+                case EVENT_SET_BROADCAST_ACTIVATION_DONE:
+                case EVENT_SET_BROADCAST_CONFIG_DONE:
+                    ar = (AsyncResult) msg.obj;
+                    synchronized (mLock) {
+                        mSuccess = (ar.exception == null);
+                        mLock.notifyAll();
+                    }
+                    break;
+            }
+        }
+    };
+
     protected IccSmsInterfaceManager(PhoneBase phone){
         mPhone = phone;
         mContext = phone.getContext();
     }
 
+    protected void markMessagesAsRead(ArrayList<byte[]> messages) {
+        if (messages == null) {
+            return;
+        }
+
+        //IccFileHandler can be null, if icc card is absent.
+        IccFileHandler fh = mPhone.getIccFileHandler();
+        if (fh == null) {
+            //shouldn't really happen, as messages are marked as read, only
+            //after importing it from icc.
+            if (Rlog.isLoggable("SMS", Log.DEBUG)) {
+                log("markMessagesAsRead - aborting, no icc card present.");
+            }
+            return;
+        }
+
+        int count = messages.size();
+
+        for (int i = 0; i < count; i++) {
+             byte[] ba = messages.get(i);
+             if (ba[0] == STATUS_ON_ICC_UNREAD) {
+                 int n = ba.length;
+                 byte[] nba = new byte[n - 1];
+                 System.arraycopy(ba, 1, nba, 0, n - 1);
+                 byte[] record = makeSmsRecordData(STATUS_ON_ICC_READ, nba);
+                 fh.updateEFLinearFixed(IccConstants.EF_SMS, i + 1, record, null, null);
+                 if (Rlog.isLoggable("SMS", Log.DEBUG)) {
+                     log("SMS " + (i + 1) + " marked as read");
+                 }
+             }
+        }
+    }
+
     protected void enforceReceiveAndSend(String message) {
         mContext.enforceCallingPermission(
                 "android.permission.RECEIVE_SMS", message);
@@ -49,6 +143,119 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
     }
 
     /**
+     * Update the specified message on the Icc.
+     *
+     * @param index record index of message to update
+     * @param status new message status (STATUS_ON_ICC_READ,
+     *                  STATUS_ON_ICC_UNREAD, STATUS_ON_ICC_SENT,
+     *                  STATUS_ON_ICC_UNSENT, STATUS_ON_ICC_FREE)
+     * @param pdu the raw PDU to store
+     * @return success or not
+     *
+     */
+    public boolean
+    updateMessageOnIccEf(int index, int status, byte[] pdu) {
+        if (DBG) log("updateMessageOnIccEf: index=" + index +
+                " status=" + status + " ==> " +
+                "("+ Arrays.toString(pdu) + ")");
+        enforceReceiveAndSend("Updating message on Icc");
+        synchronized(mLock) {
+            mSuccess = false;
+            Message response = mHandler.obtainMessage(EVENT_UPDATE_DONE);
+
+            if (status == STATUS_ON_ICC_FREE) {
+                // RIL_REQUEST_DELETE_SMS_ON_SIM vs RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM
+                // Special case FREE: call deleteSmsOnSim/Ruim instead of
+                // manipulating the record
+                // Will eventually fail if icc card is not present.
+                deleteSms(index, response);
+            } else {
+                //IccFilehandler can be null if ICC card is not present.
+                IccFileHandler fh = mPhone.getIccFileHandler();
+                if (fh == null) {
+                    response.recycle();
+                    return mSuccess; /* is false */
+                }
+                byte[] record = makeSmsRecordData(status, pdu);
+                fh.updateEFLinearFixed(
+                        IccConstants.EF_SMS,
+                        index, record, null, response);
+            }
+            try {
+                mLock.wait();
+            } catch (InterruptedException e) {
+                log("interrupted while trying to update by index");
+            }
+        }
+        return mSuccess;
+    }
+
+    /**
+     * Copy a raw SMS PDU to the Icc.
+     *
+     * @param pdu the raw PDU to store
+     * @param status message status (STATUS_ON_ICC_READ, STATUS_ON_ICC_UNREAD,
+     *               STATUS_ON_ICC_SENT, STATUS_ON_ICC_UNSENT)
+     * @return success or not
+     *
+     */
+    public boolean copyMessageToIccEf(int status, byte[] pdu, byte[] smsc) {
+        //NOTE smsc not used in RUIM
+        if (DBG) log("copyMessageToIccEf: status=" + status + " ==> " +
+                "pdu=("+ Arrays.toString(pdu) +
+                "), smsc=(" + Arrays.toString(smsc) +")");
+        enforceReceiveAndSend("Copying message to Icc");
+        synchronized(mLock) {
+            mSuccess = false;
+            Message response = mHandler.obtainMessage(EVENT_UPDATE_DONE);
+
+            //RIL_REQUEST_WRITE_SMS_TO_SIM vs RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM
+            writeSms(status, smsc, pdu, response);
+
+            try {
+                mLock.wait();
+            } catch (InterruptedException e) {
+                log("interrupted while trying to update by index");
+            }
+        }
+        return mSuccess;
+    }
+
+    /**
+     * Retrieves all messages currently stored on Icc.
+     *
+     * @return list of SmsRawData of all sms on Icc
+     */
+    public List<SmsRawData> getAllMessagesFromIccEf() {
+        if (DBG) log("getAllMessagesFromEF");
+
+        mContext.enforceCallingPermission(
+                "android.permission.RECEIVE_SMS",
+                "Reading messages from Icc");
+        synchronized(mLock) {
+
+            IccFileHandler fh = mPhone.getIccFileHandler();
+            if (fh == null) {
+                Rlog.e(LOG_TAG, "Cannot load Sms records. No icc card?");
+                if (mSms != null) {
+                    mSms.clear();
+                    return mSms;
+                }
+            }
+
+            Message response = mHandler.obtainMessage(EVENT_LOAD_DONE);
+            fh.loadEFLinearFixedAll(IccConstants.EF_SMS, response);
+
+            try {
+                mLock.wait();
+            } catch (InterruptedException e) {
+                log("interrupted while trying to load from the Icc");
+            }
+        }
+        return mSms;
+    }
+
+    /**
      * Send a data based SMS to a specific application port.
      *
      * @param destAddr the address to send the message to
@@ -78,7 +285,7 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
         mPhone.getContext().enforceCallingPermission(
                 "android.permission.SEND_SMS",
                 "Sending SMS message");
-        if (Log.isLoggable("SMS", Log.VERBOSE)) {
+        if (Rlog.isLoggable("SMS", Log.VERBOSE)) {
             log("sendData: destAddr=" + destAddr + " scAddr=" + scAddr + " destPort=" +
                 destPort + " data='"+ HexDump.toHexString(data)  + "' sentIntent=" +
                 sentIntent + " deliveryIntent=" + deliveryIntent);
@@ -115,7 +322,7 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
         mPhone.getContext().enforceCallingPermission(
                 "android.permission.SEND_SMS",
                 "Sending SMS message");
-        if (Log.isLoggable("SMS", Log.VERBOSE)) {
+        if (Rlog.isLoggable("SMS", Log.VERBOSE)) {
             log("sendText: destAddr=" + destAddr + " scAddr=" + scAddr +
                 " text='"+ text + "' sentIntent=" +
                 sentIntent + " deliveryIntent=" + deliveryIntent);
@@ -153,7 +360,7 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
         mPhone.getContext().enforceCallingPermission(
                 "android.permission.SEND_SMS",
                 "Sending SMS message");
-        if (Log.isLoggable("SMS", Log.VERBOSE)) {
+        if (Rlog.isLoggable("SMS", Log.VERBOSE)) {
             int i = 0;
             for (String part : parts) {
                 log("sendMultipartText: destAddr=" + destAddr + ", srAddr=" + scAddr +
@@ -220,6 +427,10 @@ public abstract class IccSmsInterfaceManager extends ISms.Stub {
         return data;
     }
 
+    protected abstract void deleteSms(int index, Message response);
+
+    protected abstract void writeSms(int status, byte[] pdu, byte[] smsc, Message response);
+
     protected abstract void log(String msg);
 
 }
index a966f76..795740c 100644 (file)
@@ -20,7 +20,7 @@ import android.content.res.Resources;
 import android.content.res.Resources.NotFoundException;
 import android.graphics.Bitmap;
 import android.graphics.Color;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.GsmAlphabet;
 import java.io.UnsupportedEncodingException;
@@ -187,7 +187,7 @@ public class IccUtils {
                 try {
                     ret = new String(data, offset + 1, ucslen * 2, "utf-16be");
                 } catch (UnsupportedEncodingException ex) {
-                    Log.e(LOG_TAG, "implausible UnsupportedEncodingException",
+                    Rlog.e(LOG_TAG, "implausible UnsupportedEncodingException",
                           ex);
                 }
 
@@ -360,7 +360,7 @@ public class IccUtils {
                             offset + 1, length - 1, "utf-16");
                 } catch (UnsupportedEncodingException ex) {
                     ret = "";
-                    Log.e(LOG_TAG,"implausible UnsupportedEncodingException", ex);
+                    Rlog.e(LOG_TAG,"implausible UnsupportedEncodingException", ex);
                 }
             break;
 
@@ -409,7 +409,7 @@ public class IccUtils {
         };
 
         if (pixelIndex != numOfPixels) {
-            Log.e(LOG_TAG, "parse end and size error");
+            Rlog.e(LOG_TAG, "parse end and size error");
         }
         return Bitmap.createBitmap(pixels, width, height, Bitmap.Config.ARGB_8888);
     }
@@ -461,7 +461,7 @@ public class IccUtils {
     private static int[] mapTo2OrderBitColor(byte[] data, int valueIndex,
             int length, int[] colorArray, int bits) {
         if (0 != (8 % bits)) {
-            Log.e(LOG_TAG, "not event number of color");
+            Rlog.e(LOG_TAG, "not event number of color");
             return mapToNon2OrderBitColor(data, valueIndex, length, colorArray,
                     bits);
         }
@@ -499,7 +499,7 @@ public class IccUtils {
     private static int[] mapToNon2OrderBitColor(byte[] data, int valueIndex,
             int length, int[] colorArray, int bits) {
         if (0 == (8 % bits)) {
-            Log.e(LOG_TAG, "not odd number of color");
+            Rlog.e(LOG_TAG, "not odd number of color");
             return mapTo2OrderBitColor(data, valueIndex, length, colorArray,
                     bits);
         }
index cb33521..8a2f30e 100644 (file)
@@ -26,12 +26,12 @@ import android.os.RemoteException;
 import android.os.SystemProperties;
 import android.telephony.TelephonyManager;
 import android.text.TextUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Locale;
-import libcore.icu.TimeZones;
+import libcore.icu.TimeZoneNames;
 
 /**
  * Mobile Country Code
@@ -105,7 +105,7 @@ public final class MccTable
             } else {
                 locale = new Locale(entry.language, entry.iso);
             }
-            String[] tz = TimeZones.forLocale(locale);
+            String[] tz = TimeZoneNames.forLocale(locale);
             if (tz.length == 0) return null;
             return tz[0];
         }
@@ -180,11 +180,11 @@ public final class MccTable
                 mcc = Integer.parseInt(mccmnc.substring(0,3));
                 mnc = Integer.parseInt(mccmnc.substring(3));
             } catch (NumberFormatException e) {
-                Log.e(LOG_TAG, "Error parsing IMSI");
+                Rlog.e(LOG_TAG, "Error parsing IMSI");
                 return;
             }
 
-            Log.d(LOG_TAG, "updateMccMncConfiguration: mcc=" + mcc + ", mnc=" + mnc);
+            Rlog.d(LOG_TAG, "updateMccMncConfiguration: mcc=" + mcc + ", mnc=" + mnc);
 
             if (mcc != 0) {
                 setTimezoneFromMccIfNeeded(context, mcc);
@@ -201,7 +201,7 @@ public final class MccTable
                 }
                 ActivityManagerNative.getDefault().updateConfiguration(config);
             } catch (RemoteException e) {
-                Log.e(LOG_TAG, "Can't update configuration", e);
+                Rlog.e(LOG_TAG, "Can't update configuration", e);
             }
         }
     }
@@ -273,7 +273,7 @@ public final class MccTable
                 AlarmManager alarm =
                         (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
                 alarm.setTimeZone(zoneId);
-                Log.d(LOG_TAG, "timezone set to "+zoneId);
+                Rlog.d(LOG_TAG, "timezone set to "+zoneId);
             }
         }
     }
@@ -292,7 +292,7 @@ public final class MccTable
         String language = MccTable.defaultLanguageForMcc(mcc);
         String country = MccTable.countryCodeForMcc(mcc);
 
-        Log.d(LOG_TAG, "locale set to "+language+"_"+country);
+        Rlog.d(LOG_TAG, "locale set to "+language+"_"+country);
         setSystemLocale(context, language, country);
     }
 
@@ -305,7 +305,7 @@ public final class MccTable
     private static void setWifiCountryCodeFromMcc(Context context, int mcc) {
         String country = MccTable.countryCodeForMcc(mcc);
         if (!country.isEmpty()) {
-            Log.d(LOG_TAG, "WIFI_COUNTRY_CODE set to " + country);
+            Rlog.d(LOG_TAG, "WIFI_COUNTRY_CODE set to " + country);
             WifiManager wM = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
             //persist
             wM.setCountryCode(country, true);
index 71912b6..fbce476 100644 (file)
@@ -29,9 +29,9 @@ import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
 
 import com.android.internal.telephony.DataConnection;
-import com.android.internal.telephony.gsm.UsimServiceTable;
-import com.android.internal.telephony.ims.IsimRecords;
 import com.android.internal.telephony.test.SimulatedRadioControl;
+import com.android.internal.telephony.uicc.IsimRecords;
+import com.android.internal.telephony.uicc.UsimServiceTable;
 
 import com.android.internal.telephony.PhoneConstants.*; // ???? 
 
@@ -126,9 +126,12 @@ public interface Phone {
     int NT_MODE_EVDO_NO_CDMA = RILConstants.NETWORK_MODE_EVDO_NO_CDMA;
     int NT_MODE_GLOBAL       = RILConstants.NETWORK_MODE_GLOBAL;
 
-    int NT_MODE_LTE_ONLY     = RILConstants.NETWORK_MODE_LTE_ONLY;
-    int PREFERRED_NT_MODE    = RILConstants.PREFERRED_NETWORK_MODE;
-
+    int NT_MODE_LTE_CDMA_AND_EVDO        = RILConstants.NETWORK_MODE_LTE_CDMA_EVDO;
+    int NT_MODE_LTE_GSM_WCDMA            = RILConstants.NETWORK_MODE_LTE_GSM_WCDMA;
+    int NT_MODE_LTE_CMDA_EVDO_GSM_WCDMA  = RILConstants.NETWORK_MODE_LTE_CMDA_EVDO_GSM_WCDMA;
+    int NT_MODE_LTE_ONLY                 = RILConstants.NETWORK_MODE_LTE_ONLY;
+    int NT_MODE_LTE_WCDMA                = RILConstants.NETWORK_MODE_LTE_WCDMA;
+    int PREFERRED_NT_MODE                = RILConstants.PREFERRED_NETWORK_MODE;
 
     // Used for CDMA roaming mode
     static final int CDMA_RM_HOME        = 0;  // Home Networks only, as defined in PRL
index f617e2b..c62f72f 100644 (file)
@@ -36,16 +36,19 @@ import android.telephony.CellInfo;
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
 import android.text.TextUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.R;
-import com.android.internal.telephony.IccCardApplicationStatus.AppState;
-import com.android.internal.telephony.IccCardApplicationStatus.AppType;
-import com.android.internal.telephony.gsm.UsimServiceTable;
-import com.android.internal.telephony.ims.IsimRecords;
 import com.android.internal.telephony.test.SimulatedRadioControl;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppType;
+import com.android.internal.telephony.uicc.IccFileHandler;
+import com.android.internal.telephony.uicc.IccRecords;
+import com.android.internal.telephony.uicc.IsimRecords;
+import com.android.internal.telephony.uicc.SIMRecords;
+import com.android.internal.telephony.uicc.UiccCardApplication;
 import com.android.internal.telephony.uicc.UiccController;
-import com.android.internal.telephony.gsm.SIMRecords;
+import com.android.internal.telephony.uicc.UsimServiceTable;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
@@ -253,11 +256,11 @@ public abstract class PhoneBase extends Handler implements Phone {
          */
         mDoesRilSendMultipleCallRing = SystemProperties.getBoolean(
                 TelephonyProperties.PROPERTY_RIL_SENDS_MULTIPLE_CALL_RING, true);
-        Log.d(LOG_TAG, "mDoesRilSendMultipleCallRing=" + mDoesRilSendMultipleCallRing);
+        Rlog.d(LOG_TAG, "mDoesRilSendMultipleCallRing=" + mDoesRilSendMultipleCallRing);
 
         mCallRingDelay = SystemProperties.getInt(
                 TelephonyProperties.PROPERTY_CALL_RING_DELAY, 3000);
-        Log.d(LOG_TAG, "mCallRingDelay=" + mCallRingDelay);
+        Rlog.d(LOG_TAG, "mCallRingDelay=" + mCallRingDelay);
 
         // Initialize device storage and outgoing SMS usage monitors for SMSDispatchers.
         mSmsStorageMonitor = new SmsStorageMonitor(this);
@@ -302,7 +305,7 @@ public abstract class PhoneBase extends Handler implements Phone {
 
         switch(msg.what) {
             case EVENT_CALL_RING:
-                Log.d(LOG_TAG, "Event EVENT_CALL_RING Received state=" + getState());
+                Rlog.d(LOG_TAG, "Event EVENT_CALL_RING Received state=" + getState());
                 ar = (AsyncResult)msg.obj;
                 if (ar.exception == null) {
                     PhoneConstants.State state = getState();
@@ -318,7 +321,7 @@ public abstract class PhoneBase extends Handler implements Phone {
                 break;
 
             case EVENT_CALL_RING_CONTINUE:
-                Log.d(LOG_TAG, "Event EVENT_CALL_RING_CONTINUE Received stat=" + getState());
+                Rlog.d(LOG_TAG, "Event EVENT_CALL_RING_CONTINUE Received stat=" + getState());
                 if (getState() == PhoneConstants.State.RINGING) {
                     sendIncomingCallRingNotification(msg.arg1);
                 }
@@ -1118,12 +1121,12 @@ public abstract class PhoneBase extends Handler implements Phone {
     private void sendIncomingCallRingNotification(int token) {
         if (mIsVoiceCapable && !mDoesRilSendMultipleCallRing &&
                 (token == mCallRingContinueToken)) {
-            Log.d(LOG_TAG, "Sending notifyIncomingRing");
+            Rlog.d(LOG_TAG, "Sending notifyIncomingRing");
             notifyIncomingRing();
             sendMessageDelayed(
                     obtainMessage(EVENT_CALL_RING_CONTINUE, token, 0), mCallRingDelay);
         } else {
-            Log.d(LOG_TAG, "Ignoring ring notification request,"
+            Rlog.d(LOG_TAG, "Ignoring ring notification request,"
                     + " mDoesRilSendMultipleCallRing=" + mDoesRilSendMultipleCallRing
                     + " token=" + token
                     + " mCallRingContinueToken=" + mCallRingContinueToken
@@ -1139,12 +1142,12 @@ public abstract class PhoneBase extends Handler implements Phone {
     }
 
     public IsimRecords getIsimRecords() {
-        Log.e(LOG_TAG, "getIsimRecords() is only supported on LTE devices");
+        Rlog.e(LOG_TAG, "getIsimRecords() is only supported on LTE devices");
         return null;
     }
 
     public void requestIsimAuthentication(String nonce, Message result) {
-        Log.e(LOG_TAG, "requestIsimAuthentication() is only supported on LTE devices");
+        Rlog.e(LOG_TAG, "requestIsimAuthentication() is only supported on LTE devices");
     }
 
     public String getMsisdn() {
@@ -1157,7 +1160,7 @@ public abstract class PhoneBase extends Handler implements Phone {
      */
     private static void logUnexpectedCdmaMethodCall(String name)
     {
-        Log.e(LOG_TAG, "Error! " + name + "() in PhoneBase should not be " +
+        Rlog.e(LOG_TAG, "Error! " + name + "() in PhoneBase should not be " +
                 "called, CDMAPhone inactive.");
     }
 
@@ -1169,14 +1172,14 @@ public abstract class PhoneBase extends Handler implements Phone {
      * Common error logger method for unexpected calls to GSM/WCDMA-only methods.
      */
     private static void logUnexpectedGsmMethodCall(String name) {
-        Log.e(LOG_TAG, "Error! " + name + "() in PhoneBase should not be " +
+        Rlog.e(LOG_TAG, "Error! " + name + "() in PhoneBase should not be " +
                 "called, GSMPhone inactive.");
     }
 
     // Called by SimRecords which is constructed with a PhoneBase instead of a GSMPhone.
     public void notifyCallForwardingIndicator() {
         // This function should be overridden by the class GSMPhone. Not implemented in CDMAPhone.
-        Log.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
+        Rlog.e(LOG_TAG, "Error! This function should never be executed, inactive CDMAPhone.");
     }
 
     public void notifyDataConnectionFailed(String reason, String apnType) {
index 1892427..c0641d5 100644 (file)
@@ -21,7 +21,7 @@ import android.net.LocalServerSocket;
 import android.os.Looper;
 import android.provider.Settings;
 import android.telephony.TelephonyManager;
-import android.util.Log;
+import android.telephony.Rlog;
 import android.os.SystemProperties;
 
 import com.android.internal.telephony.cdma.CDMAPhone;
@@ -108,7 +108,7 @@ public class PhoneFactory {
                 }
                 int networkMode = Settings.Global.getInt(context.getContentResolver(),
                         Settings.Global.PREFERRED_NETWORK_MODE, preferredNetworkMode);
-                Log.i(LOG_TAG, "Network Mode set to " + Integer.toString(networkMode));
+                Rlog.i(LOG_TAG, "Network Mode set to " + Integer.toString(networkMode));
 
                 // Get cdmaSubscription
                 // TODO: Change when the ril will provides a way to know at runtime
@@ -119,11 +119,11 @@ public class PhoneFactory {
                 switch (lteOnCdma) {
                     case PhoneConstants.LTE_ON_CDMA_FALSE:
                         cdmaSubscription = CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_NV;
-                        Log.i(LOG_TAG, "lteOnCdma is 0 use SUBSCRIPTION_FROM_NV");
+                        Rlog.i(LOG_TAG, "lteOnCdma is 0 use SUBSCRIPTION_FROM_NV");
                         break;
                     case PhoneConstants.LTE_ON_CDMA_TRUE:
                         cdmaSubscription = CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM;
-                        Log.i(LOG_TAG, "lteOnCdma is 1 use SUBSCRIPTION_FROM_RUIM");
+                        Rlog.i(LOG_TAG, "lteOnCdma is 1 use SUBSCRIPTION_FROM_RUIM");
                         break;
                     case PhoneConstants.LTE_ON_CDMA_UNKNOWN:
                     default:
@@ -131,10 +131,10 @@ public class PhoneFactory {
                         cdmaSubscription = Settings.Global.getInt(context.getContentResolver(),
                                 Settings.Global.PREFERRED_CDMA_SUBSCRIPTION,
                                 preferredCdmaSubscription);
-                        Log.i(LOG_TAG, "lteOnCdma not set, using PREFERRED_CDMA_SUBSCRIPTION");
+                        Rlog.i(LOG_TAG, "lteOnCdma not set, using PREFERRED_CDMA_SUBSCRIPTION");
                         break;
                 }
-                Log.i(LOG_TAG, "Cdma Subscription set to " + cdmaSubscription);
+                Rlog.i(LOG_TAG, "Cdma Subscription set to " + cdmaSubscription);
 
                 //reads the system properties and makes commandsinterface
                 sCommandsInterface = new RIL(context, networkMode, cdmaSubscription);
@@ -144,19 +144,19 @@ public class PhoneFactory {
 
                 int phoneType = TelephonyManager.getPhoneType(networkMode);
                 if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
-                    Log.i(LOG_TAG, "Creating GSMPhone");
+                    Rlog.i(LOG_TAG, "Creating GSMPhone");
                     sProxyPhone = new PhoneProxy(new GSMPhone(context,
                             sCommandsInterface, sPhoneNotifier));
                 } else if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
                     switch (TelephonyManager.getLteOnCdmaModeStatic()) {
                         case PhoneConstants.LTE_ON_CDMA_TRUE:
-                            Log.i(LOG_TAG, "Creating CDMALTEPhone");
+                            Rlog.i(LOG_TAG, "Creating CDMALTEPhone");
                             sProxyPhone = new PhoneProxy(new CDMALTEPhone(context,
                                 sCommandsInterface, sPhoneNotifier));
                             break;
                         case PhoneConstants.LTE_ON_CDMA_FALSE:
                         default:
-                            Log.i(LOG_TAG, "Creating CDMAPhone");
+                            Rlog.i(LOG_TAG, "Creating CDMAPhone");
                             sProxyPhone = new PhoneProxy(new CDMAPhone(context,
                                     sCommandsInterface, sPhoneNotifier));
                             break;
index 1c4bdc5..300529b 100644 (file)
@@ -31,13 +31,14 @@ import android.telephony.CellInfo;
 import android.telephony.CellLocation;
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.cdma.CDMAPhone;
 import com.android.internal.telephony.gsm.GSMPhone;
-import com.android.internal.telephony.gsm.UsimServiceTable;
-import com.android.internal.telephony.ims.IsimRecords;
 import com.android.internal.telephony.test.SimulatedRadioControl;
+import com.android.internal.telephony.uicc.IccCardProxy;
+import com.android.internal.telephony.uicc.IsimRecords;
+import com.android.internal.telephony.uicc.UsimServiceTable;
 import com.android.internal.telephony.CallManager;
 
 import java.util.List;
@@ -131,15 +132,15 @@ public class PhoneProxy extends Handler implements Phone {
     }
 
     private static void logd(String msg) {
-        Log.d(LOG_TAG, "[PhoneProxy] " + msg);
+        Rlog.d(LOG_TAG, "[PhoneProxy] " + msg);
     }
 
     private void logw(String msg) {
-        Log.w(LOG_TAG, "[PhoneProxy] " + msg);
+        Rlog.w(LOG_TAG, "[PhoneProxy] " + msg);
     }
 
     private void loge(String msg) {
-        Log.e(LOG_TAG, "[PhoneProxy] " + msg);
+        Rlog.e(LOG_TAG, "[PhoneProxy] " + msg);
     }
 
     private void updatePhoneObject(int newVoiceRadioTech) {
index 89084ac..40f0c34 100644 (file)
@@ -25,7 +25,7 @@ import android.os.Message;
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
 import android.telephony.TelephonyManager;
-import android.util.Log;
+import android.telephony.Rlog;
 
 /**
  *
@@ -174,7 +174,7 @@ public final class PhoneStateIntentReceiver extends BroadcastReceiver {
                     mTarget.sendMessage(message);
                 }
             } else if (TelephonyManager.ACTION_PHONE_STATE_CHANGED.equals(action)) {
-                if (DBG) Log.d(LOG_TAG, "onReceiveIntent: ACTION_PHONE_STATE_CHANGED, state="
+                if (DBG) Rlog.d(LOG_TAG, "onReceiveIntent: ACTION_PHONE_STATE_CHANGED, state="
                                + intent.getStringExtra(PhoneConstants.STATE_KEY));
                 String phoneState = intent.getStringExtra(PhoneConstants.STATE_KEY);
                 mPhoneState = (PhoneConstants.State) Enum.valueOf(
@@ -195,7 +195,7 @@ public final class PhoneStateIntentReceiver extends BroadcastReceiver {
                 }
             }
         } catch (Exception ex) {
-            Log.e(LOG_TAG, "[PhoneStateIntentRecv] caught " + ex);
+            Rlog.e(LOG_TAG, "[PhoneStateIntentRecv] caught " + ex);
             ex.printStackTrace();
         }
     }
index e8449ce..cbab817 100755 (executable)
@@ -22,9 +22,9 @@ import android.content.Context;
 import android.content.pm.PackageManager;
 import android.os.Binder;
 import android.telephony.PhoneNumberUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 
-import com.android.internal.telephony.ims.IsimRecords;
+import com.android.internal.telephony.uicc.IsimRecords;
 
 public class PhoneSubInfo extends IPhoneSubInfo.Stub {
     static final String LOG_TAG = "PHONE";
@@ -50,9 +50,9 @@ public class PhoneSubInfo extends IPhoneSubInfo.Stub {
         try {
             super.finalize();
         } catch (Throwable throwable) {
-            Log.e(LOG_TAG, "Error while finalizing:", throwable);
+            Rlog.e(LOG_TAG, "Error while finalizing:", throwable);
         }
-        Log.d(LOG_TAG, "PhoneSubInfo finalized");
+        Rlog.d(LOG_TAG, "PhoneSubInfo finalized");
     }
 
     /**
@@ -118,7 +118,7 @@ public class PhoneSubInfo extends IPhoneSubInfo.Stub {
     public String getVoiceMailNumber() {
         mContext.enforceCallingOrSelfPermission(READ_PHONE_STATE, "Requires READ_PHONE_STATE");
         String number = PhoneNumberUtils.extractNetworkPortion(mPhone.getVoiceMailNumber());
-        Log.d(LOG_TAG, "VM: PhoneSubInfo.getVoiceMailNUmber: "); // + number);
+        Rlog.d(LOG_TAG, "VM: PhoneSubInfo.getVoiceMailNUmber: "); // + number);
         return number;
     }
 
@@ -131,7 +131,7 @@ public class PhoneSubInfo extends IPhoneSubInfo.Stub {
         mContext.enforceCallingOrSelfPermission(CALL_PRIVILEGED,
                 "Requires CALL_PRIVILEGED");
         String number = mPhone.getVoiceMailNumber();
-        Log.d(LOG_TAG, "VM: PhoneSubInfo.getCompleteVoiceMailNUmber: "); // + number);
+        Rlog.d(LOG_TAG, "VM: PhoneSubInfo.getCompleteVoiceMailNUmber: "); // + number);
         return number;
     }
 
index faae72a..9c6f90e 100644 (file)
@@ -47,14 +47,18 @@ import android.telephony.SignalStrength;
 import android.telephony.SmsManager;
 import android.telephony.SmsMessage;
 import android.text.TextUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
 import com.android.internal.telephony.gsm.SuppServiceNotification;
-import com.android.internal.telephony.IccCardApplicationStatus;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus;
+import com.android.internal.telephony.uicc.IccCardStatus;
+import com.android.internal.telephony.uicc.IccIoResult;
+import com.android.internal.telephony.uicc.IccRefreshResponse;
+import com.android.internal.telephony.uicc.IccUtils;
 import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
 import com.android.internal.telephony.cdma.CdmaInformationRecords;
-import com.android.internal.telephony.IccRefreshResponse;
+import com.android.internal.telephony.cdma.CdmaSmsBroadcastConfigInfo;
 
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
@@ -179,7 +183,7 @@ class RILRequest {
 
         ex = CommandException.fromRilErrno(error);
 
-        if (RIL.RILJ_LOGD) Log.d(LOG_TAG, serialString() + "< "
+        if (RIL.RILJ_LOGD) Rlog.d(LOG_TAG, serialString() + "< "
             + RIL.requestToString(mRequest)
             + " error: " + ex);
 
@@ -232,7 +236,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
     int mRequestMessagesWaiting;
 
     //I'd rather this be LinkedList or something
-    ArrayList<RILRequest> mRequestsList = new ArrayList<RILRequest>();
+    ArrayList<RILRequest> mRequestList = new ArrayList<RILRequest>();
 
     Object     mLastNITZTimeInfo;
 
@@ -269,7 +273,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             } else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
                 sendScreenState(false);
             } else {
-                Log.w(LOG_TAG, "RIL received unexpected Intent: " + intent.getAction());
+                Rlog.w(LOG_TAG, "RIL received unexpected Intent: " + intent.getAction());
             }
         }
     };
@@ -317,8 +321,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                             return;
                         }
 
-                        synchronized (mRequestsList) {
-                            mRequestsList.add(rr);
+                        synchronized (mRequestList) {
+                            mRequestList.add(rr);
                             mRequestMessagesWaiting++;
                         }
 
@@ -343,12 +347,12 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                         dataLength[2] = (byte)((data.length >> 8) & 0xff);
                         dataLength[3] = (byte)((data.length) & 0xff);
 
-                        //Log.v(LOG_TAG, "writing packet: " + data.length + " bytes");
+                        //Rlog.v(LOG_TAG, "writing packet: " + data.length + " bytes");
 
                         s.getOutputStream().write(dataLength);
                         s.getOutputStream().write(data);
                     } catch (IOException ex) {
-                        Log.e(LOG_TAG, "IOException", ex);
+                        Rlog.e(LOG_TAG, "IOException", ex);
                         req = findAndRemoveRequestFromList(rr.mSerial);
                         // make sure this request has not already been handled,
                         // eg, if RILReceiver cleared the list.
@@ -357,7 +361,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                             rr.release();
                         }
                     } catch (RuntimeException exc) {
-                        Log.e(LOG_TAG, "Uncaught exception ", exc);
+                        Rlog.e(LOG_TAG, "Uncaught exception ", exc);
                         req = findAndRemoveRequestFromList(rr.mSerial);
                         // make sure this request has not already been handled,
                         // eg, if RILReceiver cleared the list.
@@ -393,21 +397,21 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                             // Note: Keep mRequestList so that delayed response
                             // can still be handled when response finally comes.
                             if (mRequestMessagesWaiting != 0) {
-                                Log.d(LOG_TAG, "NOTE: mReqWaiting is NOT 0 but"
+                                Rlog.d(LOG_TAG, "NOTE: mReqWaiting is NOT 0 but"
                                         + mRequestMessagesWaiting + " at TIMEOUT, reset!"
                                         + " There still msg waitng for response");
 
                                 mRequestMessagesWaiting = 0;
 
                                 if (RILJ_LOGD) {
-                                    synchronized (mRequestsList) {
-                                        int count = mRequestsList.size();
-                                        Log.d(LOG_TAG, "WAKE_LOCK_TIMEOUT " +
+                                    synchronized (mRequestList) {
+                                        int count = mRequestList.size();
+                                        Rlog.d(LOG_TAG, "WAKE_LOCK_TIMEOUT " +
                                                 " mRequestList=" + count);
 
                                         for (int i = 0; i < count; i++) {
-                                            rr = mRequestsList.get(i);
-                                            Log.d(LOG_TAG, i + ": [" + rr.mSerial + "] "
+                                            rr = mRequestList.get(i);
+                                            Rlog.d(LOG_TAG, i + ": [" + rr.mSerial + "] "
                                                     + requestToString(rr.mRequest));
                                         }
                                     }
@@ -421,7 +425,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                             // should already sent out (i.e.
                             // mRequestMessagesPending is 0 )while TIMEOUT occurs.
                             if (mRequestMessagesPending != 0) {
-                                Log.e(LOG_TAG, "ERROR: mReqPending is NOT 0 but"
+                                Rlog.e(LOG_TAG, "ERROR: mReqPending is NOT 0 but"
                                         + mRequestMessagesPending + " at TIMEOUT, reset!");
                                 mRequestMessagesPending = 0;
 
@@ -461,7 +465,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             countRead = is.read(buffer, offset, remaining);
 
             if (countRead < 0 ) {
-                Log.e(LOG_TAG, "Hit EOS reading message length");
+                Rlog.e(LOG_TAG, "Hit EOS reading message length");
                 return -1;
             }
 
@@ -481,7 +485,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             countRead = is.read(buffer, offset, remaining);
 
             if (countRead < 0 ) {
-                Log.e(LOG_TAG, "Hit EOS reading message.  messageLength=" + messageLength
+                Rlog.e(LOG_TAG, "Hit EOS reading message.  messageLength=" + messageLength
                         + " remaining=" + remaining);
                 return -1;
             }
@@ -526,12 +530,12 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                     // or after the 8th time
 
                     if (retryCount == 8) {
-                        Log.e (LOG_TAG,
+                        Rlog.e (LOG_TAG,
                             "Couldn't find '" + SOCKET_NAME_RIL
                             + "' socket after " + retryCount
                             + " times, continuing to retry silently");
                     } else if (retryCount > 0 && retryCount < 8) {
-                        Log.i (LOG_TAG,
+                        Rlog.i (LOG_TAG,
                             "Couldn't find '" + SOCKET_NAME_RIL
                             + "' socket; retrying after timeout");
                     }
@@ -548,7 +552,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 retryCount = 0;
 
                 mSocket = s;
-                Log.i(LOG_TAG, "Connected to '" + SOCKET_NAME_RIL + "' socket");
+                Rlog.i(LOG_TAG, "Connected to '" + SOCKET_NAME_RIL + "' socket");
 
                 int length = 0;
                 try {
@@ -568,20 +572,20 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                         p.unmarshall(buffer, 0, length);
                         p.setDataPosition(0);
 
-                        //Log.v(LOG_TAG, "Read packet: " + length + " bytes");
+                        //Rlog.v(LOG_TAG, "Read packet: " + length + " bytes");
 
                         processResponse(p);
                         p.recycle();
                     }
                 } catch (java.io.IOException ex) {
-                    Log.i(LOG_TAG, "'" + SOCKET_NAME_RIL + "' socket closed",
+                    Rlog.i(LOG_TAG, "'" + SOCKET_NAME_RIL + "' socket closed",
                           ex);
                 } catch (Throwable tr) {
-                    Log.e(LOG_TAG, "Uncaught exception read length=" + length +
+                    Rlog.e(LOG_TAG, "Uncaught exception read length=" + length +
                         "Exception:" + tr.toString());
                 }
 
-                Log.i(LOG_TAG, "Disconnected from '" + SOCKET_NAME_RIL
+                Rlog.i(LOG_TAG, "Disconnected from '" + SOCKET_NAME_RIL
                       + "' socket");
 
                 setRadioState (RadioState.RADIO_UNAVAILABLE);
@@ -595,9 +599,9 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 RILRequest.resetSerial();
 
                 // Clear request list on close
-                clearRequestsList(RADIO_NOT_AVAILABLE, false);
+                clearRequestList(RADIO_NOT_AVAILABLE, false);
             }} catch (Throwable tr) {
-                Log.e(LOG_TAG,"Uncaught exception", tr);
+                Rlog.e(LOG_TAG,"Uncaught exception", tr);
             }
 
             /* We're disconnected so we don't know the ril version */
@@ -637,6 +641,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 Context.CONNECTIVITY_SERVICE);
         if (cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE) == false) {
             riljLog("Not starting RILReceiver: wifi-only");
+        } if (SystemProperties.getBoolean("ro.radio.noril", false)) {
+            riljLog("Not starting RILReceiver: basebandless target");
         } else {
             riljLog("Starting RILReceiver");
             mReceiver = new RILReceiver();
@@ -1712,8 +1718,12 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         RILRequest rr
                 = RILRequest.obtain(RIL_REQUEST_SEND_USSD, response);
 
-        if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
-                            + " " + ussdString);
+        if (RILJ_LOGD) {
+            String logUssdString = "*******";
+            if (RILJ_LOGV) logUssdString = ussdString;
+            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
+                                   + " " + logUssdString);
+        }
 
         rr.mp.writeString(ussdString);
 
@@ -2047,9 +2057,8 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         // In case screen state was lost (due to process crash),
         // this ensures that the RIL knows the correct screen state.
 
-        // TODO: Should query Power Manager and send the actual
-        // screen state.  Just send true for now.
-        sendScreenState(true);
+        PowerManager pm = (PowerManager)mContext.getSystemService(Context.POWER_SERVICE);
+        sendScreenState(pm.isScreenOn());
    }
 
     private RadioState getRadioStateFromInt(int stateInt) {
@@ -2138,41 +2147,41 @@ public final class RIL extends BaseCommands implements CommandsInterface {
     }
 
     /**
-     * Release each request in mReqeustsList then clear the list
+     * Release each request in mRequestList then clear the list
      * @param error is the RIL_Errno sent back
-     * @param loggable true means to print all requests in mRequestslist
+     * @param loggable true means to print all requests in mRequestList
      */
-    private void clearRequestsList(int error, boolean loggable) {
+    private void clearRequestList(int error, boolean loggable) {
         RILRequest rr;
-        synchronized (mRequestsList) {
-            int count = mRequestsList.size();
+        synchronized (mRequestList) {
+            int count = mRequestList.size();
             if (RILJ_LOGD && loggable) {
-                Log.d(LOG_TAG, "WAKE_LOCK_TIMEOUT " +
+                Rlog.d(LOG_TAG, "WAKE_LOCK_TIMEOUT " +
                         " mReqPending=" + mRequestMessagesPending +
                         " mRequestList=" + count);
             }
 
             for (int i = 0; i < count ; i++) {
-                rr = mRequestsList.get(i);
+                rr = mRequestList.get(i);
                 if (RILJ_LOGD && loggable) {
-                    Log.d(LOG_TAG, i + ": [" + rr.mSerial + "] " +
+                    Rlog.d(LOG_TAG, i + ": [" + rr.mSerial + "] " +
                             requestToString(rr.mRequest));
                 }
                 rr.onError(error, null);
                 rr.release();
             }
-            mRequestsList.clear();
+            mRequestList.clear();
             mRequestMessagesWaiting = 0;
         }
     }
 
     private RILRequest findAndRemoveRequestFromList(int serial) {
-        synchronized (mRequestsList) {
-            for (int i = 0, s = mRequestsList.size() ; i < s ; i++) {
-                RILRequest rr = mRequestsList.get(i);
+        synchronized (mRequestList) {
+            for (int i = 0, s = mRequestList.size() ; i < s ; i++) {
+                RILRequest rr = mRequestList.get(i);
 
                 if (rr.mSerial == serial) {
-                    mRequestsList.remove(i);
+                    mRequestList.remove(i);
                     if (mRequestMessagesWaiting > 0)
                         mRequestMessagesWaiting--;
                     return rr;
@@ -2196,7 +2205,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         rr = findAndRemoveRequestFromList(serial);
 
         if (rr == null) {
-            Log.w(LOG_TAG, "Unexpected solicited response! sn: "
+            Rlog.w(LOG_TAG, "Unexpected solicited response! sn: "
                             + serial + " error: " + error);
             return;
         }
@@ -2334,7 +2343,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             }} catch (Throwable tr) {
                 // Exceptions here usually mean invalid RIL responses
 
-                Log.w(LOG_TAG, rr.serialString() + "< "
+                Rlog.w(LOG_TAG, rr.serialString() + "< "
                         + requestToString(rr.mRequest)
                         + " exception, possible invalid RIL response", tr);
 
@@ -2514,7 +2523,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 throw new RuntimeException("Unrecognized unsol response: " + response);
             //break; (implied)
         }} catch (Throwable tr) {
-            Log.e(LOG_TAG, "Exception processing unsol response: " + response +
+            Rlog.e(LOG_TAG, "Exception processing unsol response: " + response +
                 "Exception:" + tr.toString());
             return;
         }
@@ -2785,7 +2794,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 try {
                     listInfoRecs = (ArrayList<CdmaInformationRecords>)ret;
                 } catch (ClassCastException e) {
-                    Log.e(LOG_TAG, "Unexpected exception casting to listInfoRecs", e);
+                    Rlog.e(LOG_TAG, "Unexpected exception casting to listInfoRecs", e);
                     break;
                 }
 
@@ -3643,7 +3652,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             case RIL_UNSOL_CDMA_OTA_PROVISION_STATUS: return "UNSOL_CDMA_OTA_PROVISION_STATUS";
             case RIL_UNSOL_CDMA_INFO_REC: return "UNSOL_CDMA_INFO_REC";
             case RIL_UNSOL_OEM_HOOK_RAW: return "UNSOL_OEM_HOOK_RAW";
-            case RIL_UNSOL_RINGBACK_TONE: return "UNSOL_RINGBACK_TONG";
+            case RIL_UNSOL_RINGBACK_TONE: return "UNSOL_RINGBACK_TONE";
             case RIL_UNSOL_RESEND_INCALL_MUTE: return "UNSOL_RESEND_INCALL_MUTE";
             case RIL_UNSOL_CDMA_SUBSCRIPTION_SOURCE_CHANGED: return "CDMA_SUBSCRIPTION_SOURCE_CHANGED";
             case RIL_UNSOl_CDMA_PRL_CHANGED: return "UNSOL_CDMA_PRL_CHANGED";
@@ -3655,11 +3664,11 @@ public final class RIL extends BaseCommands implements CommandsInterface {
     }
 
     private void riljLog(String msg) {
-        Log.d(LOG_TAG, msg);
+        Rlog.d(LOG_TAG, msg);
     }
 
     private void riljLogv(String msg) {
-        Log.v(LOG_TAG, msg);
+        Rlog.v(LOG_TAG, msg);
     }
 
     private void unsljLog(int response) {
@@ -3810,15 +3819,36 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         send(rr);
     }
 
-    // TODO: Change the configValuesArray to a RIL_BroadcastSMSConfig
-    public void setCdmaBroadcastConfig(int[] configValuesArray, Message response) {
+    public void setCdmaBroadcastConfig(CdmaSmsBroadcastConfigInfo[] configs, Message response) {
         RILRequest rr = RILRequest.obtain(RIL_REQUEST_CDMA_SET_BROADCAST_CONFIG, response);
 
-        for(int i = 0; i < configValuesArray.length; i++) {
-            rr.mp.writeInt(configValuesArray[i]);
+        // Convert to 1 service category per config (the way RIL takes is)
+        ArrayList<CdmaSmsBroadcastConfigInfo> processedConfigs =
+            new ArrayList<CdmaSmsBroadcastConfigInfo>();
+        for (CdmaSmsBroadcastConfigInfo config : configs) {
+            for (int i = config.getFromServiceCategory(); i <= config.getToServiceCategory(); i++) {
+                processedConfigs.add(new CdmaSmsBroadcastConfigInfo(i,
+                        i,
+                        config.getLanguage(),
+                        config.isSelected()));
+            }
         }
 
-        if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
+        CdmaSmsBroadcastConfigInfo[] rilConfigs = processedConfigs.toArray(configs);
+        rr.mp.writeInt(rilConfigs.length);
+        for(int i = 0; i < rilConfigs.length; i++) {
+            rr.mp.writeInt(rilConfigs[i].getFromServiceCategory());
+            rr.mp.writeInt(rilConfigs[i].getLanguage());
+            rr.mp.writeInt(rilConfigs[i].isSelected() ? 1 : 0);
+        }
+
+        if (RILJ_LOGD) {
+            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
+                    + " with " + rilConfigs.length + " configs : ");
+            for (int i = 0; i < rilConfigs.length; i++) {
+                riljLog(rilConfigs[i].toString());
+            }
+        }
 
         send(rr);
     }
@@ -3865,7 +3895,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
     }
 
     public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
-        pw.println("RIL:");
+        pw.println("RIL: " + this);
         pw.println(" mSocket=" + mSocket);
         pw.println(" mSenderThread=" + mSenderThread);
         pw.println(" mSender=" + mSender);
@@ -3873,13 +3903,13 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         pw.println(" mReceiver=" + mReceiver);
         pw.println(" mWakeLock=" + mWakeLock);
         pw.println(" mWakeLockTimeout=" + mWakeLockTimeout);
-        synchronized (mRequestsList) {
+        synchronized (mRequestList) {
           pw.println(" mRequestMessagesPending=" + mRequestMessagesPending);
           pw.println(" mRequestMessagesWaiting=" + mRequestMessagesWaiting);
-            int count = mRequestsList.size();
+            int count = mRequestList.size();
             pw.println(" mRequestList count=" + count);
             for (int i = 0; i < count; i++) {
-                RILRequest rr = mRequestsList.get(i);
+                RILRequest rr = mRequestList.get(i);
                 pw.println("  [" + rr.mSerial + "] " + requestToString(rr.mRequest));
             }
         }
index 250d99e..7d9dc9c 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony;
 
-import android.util.Log;
+import android.telephony.Rlog;
 import android.util.Pair;
 import android.text.TextUtils;
 
@@ -208,7 +208,7 @@ public class RetryManager {
                             mMaxRetryCount = value.second;
                         }
                     } else {
-                        Log.e(LOG_TAG, "Unrecognized configuration name value pair: "
+                        Rlog.e(LOG_TAG, "Unrecognized configuration name value pair: "
                                         + strArray[i]);
                         return false;
                     }
@@ -365,7 +365,7 @@ public class RetryManager {
             value = Integer.parseInt(stringValue);
             retVal = new Pair<Boolean, Integer>(validateNonNegativeInt(name, value), value);
         } catch (NumberFormatException e) {
-            Log.e(LOG_TAG, name + " bad value: " + stringValue, e);
+            Rlog.e(LOG_TAG, name + " bad value: " + stringValue, e);
             retVal = new Pair<Boolean, Integer>(false, 0);
         }
         if (VDBG) log("parseNonNetativeInt: " + name + ", " + stringValue + ", "
@@ -383,7 +383,7 @@ public class RetryManager {
     private boolean validateNonNegativeInt(String name, int value) {
         boolean retVal;
         if (value < 0) {
-            Log.e(LOG_TAG, name + " bad value: is < 0");
+            Rlog.e(LOG_TAG, name + " bad value: is < 0");
             retVal = false;
         } else {
             retVal = true;
@@ -405,6 +405,6 @@ public class RetryManager {
     }
 
     private void log(String s) {
-        Log.d(LOG_TAG, "[RM] " + s);
+        Rlog.d(LOG_TAG, "[RM] " + s);
     }
 }
index 6740372..a13f30e 100644 (file)
@@ -51,7 +51,7 @@ import android.telephony.TelephonyManager;
 import android.text.Html;
 import android.text.Spanned;
 import android.util.EventLog;
-import android.util.Log;
+import android.telephony.Rlog;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -225,7 +225,7 @@ public abstract class SMSDispatcher extends Handler {
                                 TelephonyProperties.PROPERTY_SMS_RECEIVE, mSmsCapable);
         mSmsSendDisabled = !SystemProperties.getBoolean(
                                 TelephonyProperties.PROPERTY_SMS_SEND, mSmsCapable);
-        Log.d(TAG, "SMSDispatcher: ctor mSmsCapable=" + mSmsCapable + " format=" + getFormat()
+        Rlog.d(TAG, "SMSDispatcher: ctor mSmsCapable=" + mSmsCapable + " format=" + getFormat()
                 + " mSmsReceiveDisabled=" + mSmsReceiveDisabled
                 + " mSmsSendDisabled=" + mSmsSendDisabled);
     }
@@ -271,7 +271,7 @@ public abstract class SMSDispatcher extends Handler {
 
     @Override
     protected void finalize() {
-        Log.d(TAG, "SMSDispatcher finalized");
+        Rlog.d(TAG, "SMSDispatcher finalized");
     }
 
 
@@ -296,7 +296,7 @@ public abstract class SMSDispatcher extends Handler {
         case EVENT_NEW_SMS:
             // A new SMS has been received by the device
             if (false) {
-                Log.d(TAG, "New SMS Message Received");
+                Rlog.d(TAG, "New SMS Message Received");
             }
 
             SmsMessage sms;
@@ -304,7 +304,7 @@ public abstract class SMSDispatcher extends Handler {
             ar = (AsyncResult) msg.obj;
 
             if (ar.exception != null) {
-                Log.e(TAG, "Exception processing incoming SMS. Exception:" + ar.exception);
+                Rlog.e(TAG, "Exception processing incoming SMS. Exception:" + ar.exception);
                 return;
             }
 
@@ -318,7 +318,7 @@ public abstract class SMSDispatcher extends Handler {
                     notifyAndAcknowledgeLastIncomingSms(handled, result, null);
                 }
             } catch (RuntimeException ex) {
-                Log.e(TAG, "Exception dispatching message", ex);
+                Rlog.e(TAG, "Exception dispatching message", ex);
                 notifyAndAcknowledgeLastIncomingSms(false, Intents.RESULT_SMS_GENERIC_ERROR, null);
             }
 
@@ -364,7 +364,7 @@ public abstract class SMSDispatcher extends Handler {
                 try {
                     tracker.mSentIntent.send(RESULT_ERROR_LIMIT_EXCEEDED);
                 } catch (CanceledException ex) {
-                    Log.e(TAG, "failed to send RESULT_ERROR_LIMIT_EXCEEDED");
+                    Rlog.e(TAG, "failed to send RESULT_ERROR_LIMIT_EXCEEDED");
                 }
             }
             mPendingTrackerCount--;
@@ -424,16 +424,20 @@ public abstract class SMSDispatcher extends Handler {
         SmsTracker tracker = (SmsTracker) ar.userObj;
         PendingIntent sentIntent = tracker.mSentIntent;
 
+        if (ar.result != null) {
+            tracker.mMessageRef = ((SmsResponse)ar.result).messageRef;
+        } else {
+            Rlog.d(TAG, "SmsResponse was null");
+        }
+
         if (ar.exception == null) {
             if (false) {
-                Log.d(TAG, "SMS send complete. Broadcasting "
+                Rlog.d(TAG, "SMS send complete. Broadcasting "
                         + "intent: " + sentIntent);
             }
 
             if (tracker.mDeliveryIntent != null) {
                 // Expecting a status report.  Add it to the list.
-                int messageRef = ((SmsResponse)ar.result).messageRef;
-                tracker.mMessageRef = messageRef;
                 deliveryPendingList.add(tracker);
             }
 
@@ -454,7 +458,7 @@ public abstract class SMSDispatcher extends Handler {
             }
         } else {
             if (false) {
-                Log.d(TAG, "SMS send failed");
+                Rlog.d(TAG, "SMS send failed");
             }
 
             int ss = mPhone.getServiceState().getState();
@@ -609,12 +613,12 @@ public abstract class SMSDispatcher extends Handler {
 
             // moveToNext() returns false if no duplicates were found
             if (cursor.moveToNext()) {
-                Log.w(TAG, "Discarding duplicate message segment from address=" + address
+                Rlog.w(TAG, "Discarding duplicate message segment from address=" + address
                         + " refNumber=" + refNumber + " seqNumber=" + seqNumber);
                 String oldPduString = cursor.getString(PDU_COLUMN);
                 byte[] oldPdu = HexDump.hexStringToByteArray(oldPduString);
                 if (!Arrays.equals(oldPdu, pdu)) {
-                    Log.e(TAG, "Warning: dup message segment PDU of length " + pdu.length
+                    Rlog.e(TAG, "Warning: dup message segment PDU of length " + pdu.length
                             + " is different from existing PDU of length " + oldPdu.length);
                 }
                 return Intents.RESULT_SMS_HANDLED;
@@ -672,7 +676,7 @@ public abstract class SMSDispatcher extends Handler {
             // Remove the parts from the database
             mResolver.delete(mRawUri, where, whereArgs);
         } catch (SQLException e) {
-            Log.e(TAG, "Can't access multipart SMS database", e);
+            Rlog.e(TAG, "Can't access multipart SMS database", e);
             return Intents.RESULT_SMS_GENERIC_ERROR;
         } finally {
             if (cursor != null) cursor.close();
@@ -938,7 +942,7 @@ public abstract class SMSDispatcher extends Handler {
                     sentIntent.send(RESULT_ERROR_NO_SERVICE);
                 } catch (CanceledException ex) {}
             }
-            Log.d(TAG, "Device does not support sending sms.");
+            Rlog.d(TAG, "Device does not support sending sms.");
             return;
         }
 
@@ -961,12 +965,12 @@ public abstract class SMSDispatcher extends Handler {
 
         if (packageNames == null || packageNames.length == 0) {
             // Refuse to send SMS if we can't get the calling package name.
-            Log.e(TAG, "Can't get calling app package name: refusing to send SMS");
+            Rlog.e(TAG, "Can't get calling app package name: refusing to send SMS");
             if (sentIntent != null) {
                 try {
                     sentIntent.send(RESULT_ERROR_GENERIC_FAILURE);
                 } catch (CanceledException ex) {
-                    Log.e(TAG, "failed to send error result");
+                    Rlog.e(TAG, "failed to send error result");
                 }
             }
             return;
@@ -978,12 +982,12 @@ public abstract class SMSDispatcher extends Handler {
             // XXX this is lossy- apps can share a UID
             appInfo = pm.getPackageInfo(packageNames[0], PackageManager.GET_SIGNATURES);
         } catch (PackageManager.NameNotFoundException e) {
-            Log.e(TAG, "Can't get calling app package info: refusing to send SMS");
+            Rlog.e(TAG, "Can't get calling app package info: refusing to send SMS");
             if (sentIntent != null) {
                 try {
                     sentIntent.send(RESULT_ERROR_GENERIC_FAILURE);
                 } catch (CanceledException ex) {
-                    Log.e(TAG, "failed to send error result");
+                    Rlog.e(TAG, "failed to send error result");
                 }
             }
             return;
@@ -1031,7 +1035,7 @@ public abstract class SMSDispatcher extends Handler {
             if (rule == PREMIUM_RULE_USE_SIM || rule == PREMIUM_RULE_USE_BOTH) {
                 String simCountryIso = mTelephonyManager.getSimCountryIso();
                 if (simCountryIso == null || simCountryIso.length() != 2) {
-                    Log.e(TAG, "Can't get SIM country Iso: trying network country Iso");
+                    Rlog.e(TAG, "Can't get SIM country Iso: trying network country Iso");
                     simCountryIso = mTelephonyManager.getNetworkCountryIso();
                 }
 
@@ -1040,7 +1044,7 @@ public abstract class SMSDispatcher extends Handler {
             if (rule == PREMIUM_RULE_USE_NETWORK || rule == PREMIUM_RULE_USE_BOTH) {
                 String networkCountryIso = mTelephonyManager.getNetworkCountryIso();
                 if (networkCountryIso == null || networkCountryIso.length() != 2) {
-                    Log.e(TAG, "Can't get Network country Iso: trying SIM country Iso");
+                    Rlog.e(TAG, "Can't get Network country Iso: trying SIM country Iso");
                     networkCountryIso = mTelephonyManager.getSimCountryIso();
                 }
 
@@ -1064,11 +1068,11 @@ public abstract class SMSDispatcher extends Handler {
 
             switch (premiumSmsPermission) {
                 case SmsUsageMonitor.PREMIUM_SMS_PERMISSION_ALWAYS_ALLOW:
-                    Log.d(TAG, "User approved this app to send to premium SMS");
+                    Rlog.d(TAG, "User approved this app to send to premium SMS");
                     return true;
 
                 case SmsUsageMonitor.PREMIUM_SMS_PERMISSION_NEVER_ALLOW:
-                    Log.w(TAG, "User denied this app from sending to premium SMS");
+                    Rlog.w(TAG, "User denied this app from sending to premium SMS");
                     sendMessage(obtainMessage(EVENT_STOP_SENDING, tracker));
                     return false;   // reject this message
 
@@ -1096,9 +1100,11 @@ public abstract class SMSDispatcher extends Handler {
         if (mPendingTrackerCount >= MO_MSG_QUEUE_LIMIT) {
             // Deny sending message when the queue limit is reached.
             try {
-                tracker.mSentIntent.send(RESULT_ERROR_LIMIT_EXCEEDED);
+                if (tracker.mSentIntent != null) {
+                    tracker.mSentIntent.send(RESULT_ERROR_LIMIT_EXCEEDED);
+                }
             } catch (CanceledException ex) {
-                Log.e(TAG, "failed to send back RESULT_ERROR_LIMIT_EXCEEDED");
+                Rlog.e(TAG, "failed to send back RESULT_ERROR_LIMIT_EXCEEDED");
             }
             return true;
         }
@@ -1117,7 +1123,7 @@ public abstract class SMSDispatcher extends Handler {
             ApplicationInfo appInfo = pm.getApplicationInfo(appPackage, 0);
             return appInfo.loadLabel(pm);
         } catch (PackageManager.NameNotFoundException e) {
-            Log.e(TAG, "PackageManager Name Not Found for package " + appPackage);
+            Rlog.e(TAG, "PackageManager Name Not Found for package " + appPackage);
             return appPackage;  // fall back to package name if we can't get app label
         }
     }
@@ -1373,7 +1379,7 @@ public abstract class SMSDispatcher extends Handler {
             int newSmsPermission = SmsUsageMonitor.PREMIUM_SMS_PERMISSION_ASK_USER;
 
             if (which == DialogInterface.BUTTON_POSITIVE) {
-                Log.d(TAG, "CONFIRM sending SMS");
+                Rlog.d(TAG, "CONFIRM sending SMS");
                 // XXX this is lossy- apps can have more than one signature
                 EventLog.writeEvent(EventLogTags.SMS_SENT_BY_USER,
                                     mTracker.mAppInfo.signatures[0].toCharsString());
@@ -1382,7 +1388,7 @@ public abstract class SMSDispatcher extends Handler {
                     newSmsPermission = SmsUsageMonitor.PREMIUM_SMS_PERMISSION_ALWAYS_ALLOW;
                 }
             } else if (which == DialogInterface.BUTTON_NEGATIVE) {
-                Log.d(TAG, "DENY sending SMS");
+                Rlog.d(TAG, "DENY sending SMS");
                 // XXX this is lossy- apps can have more than one signature
                 EventLog.writeEvent(EventLogTags.SMS_DENIED_BY_USER,
                                     mTracker.mAppInfo.signatures[0].toCharsString());
@@ -1396,13 +1402,13 @@ public abstract class SMSDispatcher extends Handler {
 
         @Override
         public void onCancel(DialogInterface dialog) {
-            Log.d(TAG, "dialog dismissed: don't send SMS");
+            Rlog.d(TAG, "dialog dismissed: don't send SMS");
             sendMessage(obtainMessage(EVENT_STOP_SENDING, mTracker));
         }
 
         @Override
         public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-            Log.d(TAG, "remember this choice: " + isChecked);
+            Rlog.d(TAG, "remember this choice: " + isChecked);
             mRememberChoice = isChecked;
             if (isChecked) {
                 mPositiveButton.setText(R.string.sms_short_code_confirm_always_allow);
@@ -1426,15 +1432,20 @@ public abstract class SMSDispatcher extends Handler {
     private final BroadcastReceiver mResultReceiver = new BroadcastReceiver() {
         @Override
         public void onReceive(Context context, Intent intent) {
-            // Assume the intent is one of the SMS receive intents that
-            // was sent as an ordered broadcast.  Check result and ACK.
-            int rc = getResultCode();
-            boolean success = (rc == Activity.RESULT_OK)
-                    || (rc == Intents.RESULT_SMS_HANDLED);
-
-            // For a multi-part message, this only ACKs the last part.
-            // Previous parts were ACK'd as they were received.
-            acknowledgeLastIncomingSms(success, rc, null);
+            if (intent.getAction().equals(Intents.SMS_CB_RECEIVED_ACTION) ||
+                    intent.getAction().equals(Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION)) {
+                // Ignore this intent. Apps will process it.
+            } else {
+                // Assume the intent is one of the SMS receive intents that
+                // was sent as an ordered broadcast. Check result and ACK.
+                int rc = getResultCode();
+                boolean success = (rc == Activity.RESULT_OK)
+                        || (rc == Intents.RESULT_SMS_HANDLED);
+
+                // For a multi-part message, this only ACKs the last part.
+                // Previous parts were ACK'd as they were received.
+                acknowledgeLastIncomingSms(success, rc, null);
+            }
         }
     };
 
@@ -1442,12 +1453,12 @@ public abstract class SMSDispatcher extends Handler {
         if (message.isEmergencyMessage()) {
             Intent intent = new Intent(Intents.SMS_EMERGENCY_CB_RECEIVED_ACTION);
             intent.putExtra("message", message);
-            Log.d(TAG, "Dispatching emergency SMS CB");
+            Rlog.d(TAG, "Dispatching emergency SMS CB");
             dispatch(intent, RECEIVE_EMERGENCY_BROADCAST_PERMISSION);
         } else {
             Intent intent = new Intent(Intents.SMS_CB_RECEIVED_ACTION);
             intent.putExtra("message", message);
-            Log.d(TAG, "Dispatching SMS CB");
+            Rlog.d(TAG, "Dispatching SMS CB");
             dispatch(intent, RECEIVE_SMS_PERMISSION);
         }
     }
index 0fa2ca1..d4710cb 100644 (file)
@@ -33,7 +33,9 @@ import java.io.FileDescriptor;
 import java.io.PrintWriter;
 import java.util.List;
 
-import com.android.internal.telephony.IccCardApplicationStatus.AppState;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
+import com.android.internal.telephony.uicc.IccRecords;
+import com.android.internal.telephony.uicc.UiccCardApplication;
 import com.android.internal.telephony.uicc.UiccController;
 
 /**
@@ -198,6 +200,7 @@ public abstract class ServiceStateTracker extends Handler {
 
     public void dispose() {
         cm.unSetOnSignalStrengthUpdate(this);
+        mUiccController.unregisterForIccChanged(this);
     }
 
     public boolean getDesiredPowerState() {
index 0c06ffc..6a9283f 100644 (file)
@@ -25,7 +25,7 @@ import android.os.Handler;
 import android.os.Message;
 import android.os.PowerManager;
 import android.provider.Telephony.Sms.Intents;
-import android.util.Log;
+import android.telephony.Rlog;
 
 /**
  * Monitors the device and ICC storage, and sends the appropriate events.
@@ -107,7 +107,7 @@ public final class SmsStorageMonitor extends Handler {
                 ar = (AsyncResult) msg.obj;
                 if (ar.exception != null) {
                     mReportMemoryStatusPending = true;
-                    Log.v(TAG, "Memory status report to modem pending : mStorageAvailable = "
+                    Rlog.v(TAG, "Memory status report to modem pending : mStorageAvailable = "
                             + mStorageAvailable);
                 } else {
                     mReportMemoryStatusPending = false;
@@ -116,7 +116,7 @@ public final class SmsStorageMonitor extends Handler {
 
             case EVENT_RADIO_ON:
                 if (mReportMemoryStatusPending) {
-                    Log.v(TAG, "Sending pending memory status report : mStorageAvailable = "
+                    Rlog.v(TAG, "Sending pending memory status report : mStorageAvailable = "
                             + mStorageAvailable);
                     mCm.reportSmsMemoryStatus(mStorageAvailable,
                             obtainMessage(EVENT_REPORT_MEMORY_STATUS_DONE));
index c76987e..359069c 100644 (file)
@@ -31,7 +31,7 @@ import android.os.UserHandle;
 import android.provider.Settings;
 import android.telephony.PhoneNumberUtils;
 import android.util.AtomicFile;
-import android.util.Log;
+import android.telephony.Rlog;
 import android.util.Xml;
 
 import com.android.internal.util.FastXmlSerializer;
@@ -290,9 +290,9 @@ public class SmsUsageMonitor {
             parser.setInput(patternReader);
             return getPatternMatcherFromXmlParser(parser, country);
         } catch (FileNotFoundException e) {
-            Log.e(TAG, "Short Code Pattern File not found");
+            Rlog.e(TAG, "Short Code Pattern File not found");
         } catch (XmlPullParserException e) {
-            Log.e(TAG, "XML parser exception reading short code pattern file", e);
+            Rlog.e(TAG, "XML parser exception reading short code pattern file", e);
         } finally {
             mPatternFileLastModified = mPatternFile.lastModified();
             if (patternReader != null) {
@@ -324,13 +324,13 @@ public class SmsUsageMonitor {
                 XmlUtils.nextElement(parser);
                 String element = parser.getName();
                 if (element == null) {
-                    Log.e(TAG, "Parsing pattern data found null");
+                    Rlog.e(TAG, "Parsing pattern data found null");
                     break;
                 }
 
                 if (element.equals(TAG_SHORTCODE)) {
                     String currentCountry = parser.getAttributeValue(null, ATTR_COUNTRY);
-                    if (VDBG) Log.d(TAG, "Found country " + currentCountry);
+                    if (VDBG) Rlog.d(TAG, "Found country " + currentCountry);
                     if (country.equals(currentCountry)) {
                         String pattern = parser.getAttributeValue(null, ATTR_PATTERN);
                         String premium = parser.getAttributeValue(null, ATTR_PREMIUM);
@@ -339,15 +339,15 @@ public class SmsUsageMonitor {
                         return new ShortCodePatternMatcher(pattern, premium, free, standard);
                     }
                 } else {
-                    Log.e(TAG, "Error: skipping unknown XML tag " + element);
+                    Rlog.e(TAG, "Error: skipping unknown XML tag " + element);
                 }
             }
         } catch (XmlPullParserException e) {
-            Log.e(TAG, "XML parser exception reading short code patterns", e);
+            Rlog.e(TAG, "XML parser exception reading short code patterns", e);
         } catch (IOException e) {
-            Log.e(TAG, "I/O exception reading short code patterns", e);
+            Rlog.e(TAG, "I/O exception reading short code patterns", e);
         }
-        if (DBG) Log.d(TAG, "Country (" + country + ") not found");
+        if (DBG) Rlog.d(TAG, "Country (" + country + ") not found");
         return null;    // country not found
     }
 
@@ -398,12 +398,12 @@ public class SmsUsageMonitor {
         synchronized (mSettingsObserverHandler) {
             // always allow emergency numbers
             if (PhoneNumberUtils.isEmergencyNumber(destAddress, countryIso)) {
-                if (DBG) Log.d(TAG, "isEmergencyNumber");
+                if (DBG) Rlog.d(TAG, "isEmergencyNumber");
                 return CATEGORY_NOT_SHORT_CODE;
             }
             // always allow if the feature is disabled
             if (!mCheckEnabled.get()) {
-                if (DBG) Log.e(TAG, "check disabled");
+                if (DBG) Rlog.e(TAG, "check disabled");
                 return CATEGORY_NOT_SHORT_CODE;
             }
 
@@ -411,10 +411,10 @@ public class SmsUsageMonitor {
                 if (mCurrentCountry == null || !countryIso.equals(mCurrentCountry) ||
                         mPatternFile.lastModified() != mPatternFileLastModified) {
                     if (mPatternFile.exists()) {
-                        if (DBG) Log.d(TAG, "Loading SMS Short Code patterns from file");
+                        if (DBG) Rlog.d(TAG, "Loading SMS Short Code patterns from file");
                         mCurrentPatternMatcher = getPatternMatcherFromFile(countryIso);
                     } else {
-                        if (DBG) Log.d(TAG, "Loading SMS Short Code patterns from resource");
+                        if (DBG) Rlog.d(TAG, "Loading SMS Short Code patterns from resource");
                         mCurrentPatternMatcher = getPatternMatcherFromResource(countryIso);
                     }
                     mCurrentCountry = countryIso;
@@ -425,7 +425,7 @@ public class SmsUsageMonitor {
                 return mCurrentPatternMatcher.getNumberCategory(destAddress);
             } else {
                 // Generic rule: numbers of 5 digits or less are considered potential short codes
-                Log.e(TAG, "No patterns for \"" + countryIso + "\": using generic short code rule");
+                Rlog.e(TAG, "No patterns for \"" + countryIso + "\": using generic short code rule");
                 if (destAddress.length() <= 5) {
                     return CATEGORY_POSSIBLE_PREMIUM_SHORT_CODE;
                 } else {
@@ -465,26 +465,26 @@ public class SmsUsageMonitor {
                             String packageName = parser.getAttributeValue(null, ATTR_PACKAGE_NAME);
                             String policy = parser.getAttributeValue(null, ATTR_PACKAGE_SMS_POLICY);
                             if (packageName == null) {
-                                Log.e(TAG, "Error: missing package name attribute");
+                                Rlog.e(TAG, "Error: missing package name attribute");
                             } else if (policy == null) {
-                                Log.e(TAG, "Error: missing package policy attribute");
+                                Rlog.e(TAG, "Error: missing package policy attribute");
                             } else try {
                                 mPremiumSmsPolicy.put(packageName, Integer.parseInt(policy));
                             } catch (NumberFormatException e) {
-                                Log.e(TAG, "Error: non-numeric policy type " + policy);
+                                Rlog.e(TAG, "Error: non-numeric policy type " + policy);
                             }
                         } else {
-                            Log.e(TAG, "Error: skipping unknown XML tag " + element);
+                            Rlog.e(TAG, "Error: skipping unknown XML tag " + element);
                         }
                     }
                 } catch (FileNotFoundException e) {
                     // No data yet
                 } catch (IOException e) {
-                    Log.e(TAG, "Unable to read premium SMS policy database", e);
+                    Rlog.e(TAG, "Unable to read premium SMS policy database", e);
                 } catch (NumberFormatException e) {
-                    Log.e(TAG, "Unable to parse premium SMS policy database", e);
+                    Rlog.e(TAG, "Unable to parse premium SMS policy database", e);
                 } catch (XmlPullParserException e) {
-                    Log.e(TAG, "Unable to parse premium SMS policy database", e);
+                    Rlog.e(TAG, "Unable to parse premium SMS policy database", e);
                 } finally {
                     if (infile != null) {
                         try {
@@ -526,7 +526,7 @@ public class SmsUsageMonitor {
 
                 mPolicyFile.finishWrite(outfile);
             } catch (IOException e) {
-                Log.e(TAG, "Unable to write premium SMS policy database", e);
+                Rlog.e(TAG, "Unable to write premium SMS policy database", e);
                 if (outfile != null) {
                     mPolicyFile.failWrite(outfile);
                 }
@@ -649,6 +649,6 @@ public class SmsUsageMonitor {
     }
 
     private static void log(String msg) {
-        Log.d(TAG, msg);
+        Rlog.d(TAG, msg);
     }
 }
index a9e9376..f374f41 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony;
 
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.Phone;
 
@@ -104,7 +104,7 @@ public class TelephonyCapabilities {
         } else if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
             return com.android.internal.R.string.meid;
         } else {
-            Log.w(LOG_TAG, "getDeviceIdLabel: no known label for phone "
+            Rlog.w(LOG_TAG, "getDeviceIdLabel: no known label for phone "
                   + phone.getPhoneName());
             return 0;
         }
index e2779dc..ef74e1e 100755 (executable)
@@ -24,10 +24,12 @@ import android.content.Intent;
 import android.content.ServiceConnection;
 import android.provider.Telephony;
 import android.provider.Telephony.Sms.Intents;
-import android.util.Log;
+import android.telephony.Rlog;
 import android.os.IBinder;
 import android.os.RemoteException;
 
+import com.android.internal.telephony.uicc.IccUtils;
+
 /**
  * WAP push handler class.
  *
@@ -61,13 +63,15 @@ public class WapPushOverSms {
 
         public void onServiceConnected(ComponentName name, IBinder service) {
             mWapPushMan = IWapPushManager.Stub.asInterface(service);
-            if (false) Log.v(LOG_TAG, "wappush manager connected to " +
+            if (false) Rlog.v(LOG_TAG, "wappush manager connected to " +
                     mOwner.hashCode());
         }
 
         public void onServiceDisconnected(ComponentName name) {
             mWapPushMan = null;
-            if (false) Log.v(LOG_TAG, "wappush manager disconnected.");
+            if (false) Rlog.v(LOG_TAG, "wappush manager disconnected.");
+            // Detach the previous binder
+            mOwner.unbindService(mWapConn);
             // WapPushManager must be always attached.
             rebindWapPushManager();
         }
@@ -100,7 +104,7 @@ public class WapPushOverSms {
                         try {
                             Thread.sleep(BIND_RETRY_INTERVAL);
                         } catch (InterruptedException e) {
-                            if (false) Log.v(LOG_TAG, "sleep interrupted.");
+                            if (false) Rlog.v(LOG_TAG, "sleep interrupted.");
                         }
                     }
                 }
@@ -134,7 +138,7 @@ public class WapPushOverSms {
      */
     public int dispatchWapPdu(byte[] pdu) {
 
-        if (false) Log.d(LOG_TAG, "Rx: " + IccUtils.bytesToHexString(pdu));
+        if (false) Rlog.d(LOG_TAG, "Rx: " + IccUtils.bytesToHexString(pdu));
 
         int index = 0;
         int transactionId = pdu[index++] & 0xFF;
@@ -143,7 +147,7 @@ public class WapPushOverSms {
 
         if ((pduType != WspTypeDecoder.PDU_TYPE_PUSH) &&
                 (pduType != WspTypeDecoder.PDU_TYPE_CONFIRMED_PUSH)) {
-            if (false) Log.w(LOG_TAG, "Received non-PUSH WAP PDU. Type = " + pduType);
+            if (false) Rlog.w(LOG_TAG, "Received non-PUSH WAP PDU. Type = " + pduType);
             return Intents.RESULT_SMS_HANDLED;
         }
 
@@ -156,7 +160,7 @@ public class WapPushOverSms {
          * So it will be encoded in no more than 5 octets.
          */
         if (pduDecoder.decodeUintvarInteger(index) == false) {
-            if (false) Log.w(LOG_TAG, "Received PDU. Header Length error.");
+            if (false) Rlog.w(LOG_TAG, "Received PDU. Header Length error.");
             return Intents.RESULT_SMS_GENERIC_ERROR;
         }
         headerLength = (int)pduDecoder.getValue32();
@@ -177,7 +181,7 @@ public class WapPushOverSms {
          * Length = Uintvar-integer
          */
         if (pduDecoder.decodeContentType(index) == false) {
-            if (false) Log.w(LOG_TAG, "Received PDU. Header Content-Type error.");
+            if (false) Rlog.w(LOG_TAG, "Received PDU. Header Content-Type error.");
             return Intents.RESULT_SMS_GENERIC_ERROR;
         }
 
@@ -214,14 +218,14 @@ public class WapPushOverSms {
 
             String contentType = ((mimeType == null) ?
                                   Long.toString(binaryContentType) : mimeType);
-            if (false) Log.v(LOG_TAG, "appid found: " + wapAppId + ":" + contentType);
+            if (false) Rlog.v(LOG_TAG, "appid found: " + wapAppId + ":" + contentType);
 
             try {
                 boolean processFurther = true;
                 IWapPushManager wapPushMan = mWapConn.getWapPushManager();
 
                 if (wapPushMan == null) {
-                    if (false) Log.w(LOG_TAG, "wap push manager not found!");
+                    if (false) Rlog.w(LOG_TAG, "wap push manager not found!");
                 } else {
                     Intent intent = new Intent();
                     intent.putExtra("transactionId", transactionId);
@@ -232,7 +236,7 @@ public class WapPushOverSms {
                             pduDecoder.getContentParameters());
 
                     int procRet = wapPushMan.processMessage(wapAppId, contentType, intent);
-                    if (false) Log.v(LOG_TAG, "procRet:" + procRet);
+                    if (false) Rlog.v(LOG_TAG, "procRet:" + procRet);
                     if ((procRet & WapPushManagerParams.MESSAGE_HANDLED) > 0
                         && (procRet & WapPushManagerParams.FURTHER_PROCESSING) == 0) {
                         processFurther = false;
@@ -242,13 +246,13 @@ public class WapPushOverSms {
                     return Intents.RESULT_SMS_HANDLED;
                 }
             } catch (RemoteException e) {
-                if (false) Log.w(LOG_TAG, "remote func failed...");
+                if (false) Rlog.w(LOG_TAG, "remote func failed...");
             }
         }
-        if (false) Log.v(LOG_TAG, "fall back to existing handler");
+        if (false) Rlog.v(LOG_TAG, "fall back to existing handler");
 
         if (mimeType == null) {
-            if (false) Log.w(LOG_TAG, "Header Content-Type error.");
+            if (false) Rlog.w(LOG_TAG, "Header Content-Type error.");
             return Intents.RESULT_SMS_GENERIC_ERROR;
         }
 
index 299e140..01b86ef 100644 (file)
@@ -64,7 +64,8 @@ public interface AppInterface {
         OPEN_CHANNEL(0x40),
         CLOSE_CHANNEL(0x41),
         RECEIVE_DATA(0x42),
-        SEND_DATA(0x43);
+        SEND_DATA(0x43),
+        GET_CHANNEL_STATUS(0x44);
 
         private int mValue;
 
index 095e65b..c264c11 100644 (file)
@@ -28,15 +28,17 @@ import java.util.List;
 class BerTlv {
     private int mTag = BER_UNKNOWN_TAG;
     private List<ComprehensionTlv> mCompTlvs = null;
+    private boolean mLengthValid = true;
 
     public static final int BER_UNKNOWN_TAG             = 0x00;
     public static final int BER_PROACTIVE_COMMAND_TAG   = 0xd0;
     public static final int BER_MENU_SELECTION_TAG      = 0xd3;
     public static final int BER_EVENT_DOWNLOAD_TAG      = 0xd6;
 
-    private BerTlv(int tag, List<ComprehensionTlv> ctlvs) {
+    private BerTlv(int tag, List<ComprehensionTlv> ctlvs, boolean lengthValid) {
         mTag = tag;
         mCompTlvs = ctlvs;
+        mLengthValid = lengthValid;
     }
 
     /**
@@ -58,6 +60,15 @@ class BerTlv {
     }
 
     /**
+     * Gets if the length of the BER-TLV object is valid
+     *
+     * @return if length valid
+     */
+     public boolean isLengthValid() {
+         return mLengthValid;
+     }
+
+    /**
      * Decodes a BER-TLV object from a byte array.
      *
      * @param data A byte array to decode from
@@ -68,6 +79,7 @@ class BerTlv {
         int curIndex = 0;
         int endIndex = data.length;
         int tag, length = 0;
+        boolean isLengthValid = true;
 
         try {
             /* tag */
@@ -118,6 +130,32 @@ class BerTlv {
         List<ComprehensionTlv> ctlvs = ComprehensionTlv.decodeMany(data,
                 curIndex);
 
-        return new BerTlv(tag, ctlvs);
+        if (tag == BER_PROACTIVE_COMMAND_TAG) {
+            int totalLength = 0;
+            for (ComprehensionTlv item : ctlvs) {
+                int itemLength = item.getLength();
+                if (itemLength >= 0x80 && itemLength <= 0xFF) {
+                    totalLength += itemLength + 3; //3: 'tag'(1 byte) and 'length'(2 bytes).
+                } else if (itemLength >= 0 && itemLength < 0x80) {
+                    totalLength += itemLength + 2; //2: 'tag'(1 byte) and 'length'(1 byte).
+                } else {
+                    isLengthValid = false;
+                    break;
+                }
+            }
+
+            // According to 3gpp11.14, chapter 6.10.6 "Length errors",
+
+            // If the total lengths of the SIMPLE-TLV data objects are not
+            // consistent with the length given in the BER-TLV data object,
+            // then the whole BER-TLV data object shall be rejected. The
+            // result field in the TERMINAL RESPONSE shall have the error
+            // condition "Command data not understood by ME".
+            if (length != totalLength) {
+                isLengthValid = false;
+            }
+        }
+
+        return new BerTlv(tag, ctlvs, isLengthValid);
     }
 }
index 48c2e2b..9284d03 100644 (file)
@@ -80,6 +80,9 @@ public class CatCmdMessage implements Parcelable {
             mToneSettings = params.settings;
             mTextMsg = params.textMsg;
             break;
+        case GET_CHANNEL_STATUS:
+            mTextMsg = ((CallSetupParams) cmdParams).confirmMsg;
+            break;
         case SET_UP_CALL:
             mCallSettings = new CallSettings();
             mCallSettings.confirmMsg = ((CallSetupParams) cmdParams).confirmMsg;
index e19ff43..b2e641c 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony.cat;
 
-import android.util.Log;
+import android.telephony.Rlog;
 
 public abstract class CatLog {
     static final boolean DEBUG = true;
@@ -27,7 +27,7 @@ public abstract class CatLog {
         }
 
         String className = caller.getClass().getName();
-        Log.d("CAT", className.substring(className.lastIndexOf('.') + 1) + ": "
+        Rlog.d("CAT", className.substring(className.lastIndexOf('.') + 1) + ": "
                 + msg);
     }
 
@@ -36,6 +36,6 @@ public abstract class CatLog {
             return;
         }
 
-        Log.d("CAT", caller + ": " + msg);
+        Rlog.d("CAT", caller + ": " + msg);
     }
 }
index cfcac36..15309e4 100644 (file)
@@ -23,7 +23,8 @@ public class CatResponseMessage {
         String usersInput  = null;
         boolean usersYesNoSelection = false;
         boolean usersConfirm = false;
-
+        boolean includeAdditionalInfo = false;
+        int additionalInfo = 0;
         public CatResponseMessage(CatCmdMessage cmdMsg) {
             this.cmdDet = cmdMsg.mCmdDet;
         }
@@ -48,7 +49,12 @@ public class CatResponseMessage {
             usersConfirm = confirm;
         }
 
+        public void setAdditionalInfo(int info) {
+            this.includeAdditionalInfo = true;
+            this.additionalInfo = info;
+        }
+
         CommandDetails getCmdDetails() {
             return cmdDet;
         }
-    }
\ No newline at end of file
+    }
index f327d31..f84fba2 100644 (file)
@@ -26,12 +26,12 @@ import android.os.HandlerThread;
 import android.os.Message;
 import android.os.SystemProperties;
 
-import com.android.internal.telephony.IccUtils;
 import com.android.internal.telephony.CommandsInterface;
-import com.android.internal.telephony.IccFileHandler;
-import com.android.internal.telephony.IccRecords;
-import com.android.internal.telephony.UiccCard;
-import com.android.internal.telephony.UiccCardApplication;
+import com.android.internal.telephony.uicc.IccFileHandler;
+import com.android.internal.telephony.uicc.IccRecords;
+import com.android.internal.telephony.uicc.IccUtils;
+import com.android.internal.telephony.uicc.UiccCard;
+import com.android.internal.telephony.uicc.UiccCardApplication;
 
 
 import java.io.ByteArrayOutputStream;
@@ -704,6 +704,7 @@ public class CatService extends Handler implements AppInterface {
         ResponseData resp = null;
         boolean helpRequired = false;
         CommandDetails cmdDet = resMsg.getCmdDetails();
+        AppInterface.CommandType type = AppInterface.CommandType.fromInt(cmdDet.typeOfCommand);
 
         switch (resMsg.resCode) {
         case HELP_INFO_REQUIRED:
@@ -719,7 +720,8 @@ public class CatService extends Handler implements AppInterface {
         case PRFRMD_WITH_MODIFICATION:
         case PRFRMD_NAA_NOT_ACTIVE:
         case PRFRMD_TONE_NOT_PLAYED:
-            switch (AppInterface.CommandType.fromInt(cmdDet.typeOfCommand)) {
+        case TERMINAL_CRNTLY_UNABLE_TO_PROCESS:
+            switch (type) {
             case SET_UP_MENU:
                 helpRequired = resMsg.resCode == ResultCode.HELP_INFO_REQUIRED;
                 sendMenuSelection(resMsg.usersMenuSelection, helpRequired);
@@ -754,16 +756,29 @@ public class CatService extends Handler implements AppInterface {
                 return;
             }
             break;
-        case NO_RESPONSE_FROM_USER:
-        case UICC_SESSION_TERM_BY_USER:
         case BACKWARD_MOVE_BY_USER:
         case USER_NOT_ACCEPT:
+            // if the user dismissed the alert dialog for a
+            // setup call/open channel, consider that as the user
+            // rejecting the call. Use dedicated API for this, rather than
+            // sending a terminal response.
+            if (type == CommandType.SET_UP_CALL || type == CommandType.OPEN_CHANNEL) {
+                mCmdIf.handleCallSetupRequestFromSim(false, null);
+                mCurrntCmd = null;
+                return;
+            } else {
+                resp = null;
+            }
+            break;
+        case NO_RESPONSE_FROM_USER:
+        case UICC_SESSION_TERM_BY_USER:
             resp = null;
             break;
         default:
             return;
         }
-        sendTerminalResponse(cmdDet, resMsg.resCode, false, 0, resp);
+        sendTerminalResponse(cmdDet, resMsg.resCode, resMsg.includeAdditionalInfo,
+                resMsg.additionalInfo, resp);
         mCurrntCmd = null;
     }
 
index 9de8399..6e3b19f 100644 (file)
@@ -21,7 +21,7 @@ import android.os.Handler;
 import android.os.Message;
 
 import com.android.internal.telephony.GsmAlphabet;
-import com.android.internal.telephony.IccFileHandler;
+import com.android.internal.telephony.uicc.IccFileHandler;
 
 import java.util.Iterator;
 import java.util.List;
@@ -124,6 +124,13 @@ class CommandParamsFactory extends Handler {
             return;
         }
 
+        // proactive command length is incorrect.
+        if (!berTlv.isLengthValid()) {
+            mCmdParams = new CommandParams(cmdDet);
+            sendCmdParams(ResultCode.CMD_DATA_NOT_UNDERSTOOD);
+            return;
+        }
+
         try {
             switch (cmdType) {
             case SET_UP_MENU:
@@ -150,6 +157,7 @@ class CommandParamsFactory extends Handler {
              case SEND_USSD:
                  cmdPending = processEventNotify(cmdDet, ctlvs);
                  break;
+             case GET_CHANNEL_STATUS:
              case SET_UP_CALL:
                  cmdPending = processSetupCall(cmdDet, ctlvs);
                  break;
index 22cd5a4..e2522a4 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony.cat;
 
-import android.util.Log;
+import android.telephony.Rlog;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -125,7 +125,7 @@ class ComprehensionTlv {
             case 0:
             case 0xff:
             case 0x80:
-                Log.d("CAT     ", "decode: unexpected first tag byte=" + Integer.toHexString(temp) +
+                Rlog.d("CAT     ", "decode: unexpected first tag byte=" + Integer.toHexString(temp) +
                         ", startIndex=" + startIndex + " curIndex=" + curIndex +
                         " endIndex=" + endIndex);
                 // Return null which will stop decoding, this has occurred
index 2fa1811..c339f5e 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony.cat;
 
-import com.android.internal.telephony.IccFileHandler;
+import com.android.internal.telephony.uicc.IccFileHandler;
 
 import android.graphics.Bitmap;
 import android.graphics.Color;
@@ -25,7 +25,7 @@ import android.os.Handler;
 import android.os.HandlerThread;
 import android.os.Looper;
 import android.os.Message;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import java.util.HashMap;
 
index fb33a8e..d75c63d 100644 (file)
@@ -16,8 +16,8 @@
 
 package com.android.internal.telephony.cat;
 
-import com.android.internal.telephony.IccFileHandler;
-import com.android.internal.telephony.IccUtils;
+import com.android.internal.telephony.uicc.IccFileHandler;
+import com.android.internal.telephony.uicc.IccUtils;
 
 import android.os.Handler;
 import com.android.internal.util.State;
index 584d96c..5b1ae91 100644 (file)
@@ -17,8 +17,8 @@
 package com.android.internal.telephony.cat;
 
 import com.android.internal.telephony.GsmAlphabet;
-import com.android.internal.telephony.IccUtils;
 import com.android.internal.telephony.cat.Duration.TimeUnit;
+import com.android.internal.telephony.uicc.IccUtils;
 
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
index cc59b67..632a24c 100644 (file)
@@ -25,7 +25,7 @@ import android.os.AsyncResult;
 import android.os.Message;
 import android.preference.PreferenceManager;
 import android.provider.Telephony;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.CommandsInterface;
 import com.android.internal.telephony.OperatorInfo;
@@ -34,12 +34,12 @@ import com.android.internal.telephony.PhoneConstants;
 import com.android.internal.telephony.PhoneNotifier;
 import com.android.internal.telephony.PhoneProxy;
 import com.android.internal.telephony.SMSDispatcher;
-import com.android.internal.telephony.UiccCardApplication;
 import com.android.internal.telephony.gsm.GsmSMSDispatcher;
-import com.android.internal.telephony.gsm.SIMRecords;
 import com.android.internal.telephony.gsm.SmsMessage;
-import com.android.internal.telephony.ims.IsimRecords;
-import com.android.internal.telephony.ims.IsimUiccRecords;
+import com.android.internal.telephony.uicc.IsimRecords;
+import com.android.internal.telephony.uicc.IsimUiccRecords;
+import com.android.internal.telephony.uicc.SIMRecords;
+import com.android.internal.telephony.uicc.UiccCardApplication;
 import com.android.internal.telephony.uicc.UiccController;
 
 import java.io.FileDescriptor;
@@ -177,7 +177,7 @@ public class CDMALTEPhone extends CDMAPhone {
         // look for our wrapper within the asyncresult, skip the rest if it
         // is null.
         if (!(ar.userObj instanceof NetworkSelectMessage)) {
-            Log.e(LOG_TAG, "unexpected result from user object.");
+            Rlog.e(LOG_TAG, "unexpected result from user object.");
             return;
         }
 
@@ -200,7 +200,7 @@ public class CDMALTEPhone extends CDMAPhone {
 
         // commit and log the result.
         if (! editor.commit()) {
-            Log.e(LOG_TAG, "failed to commit network selection preference");
+            Rlog.e(LOG_TAG, "failed to commit network selection preference");
         }
 
     }
@@ -218,7 +218,7 @@ public class CDMALTEPhone extends CDMAPhone {
                 mContext.getContentResolver().insert(uri, map);
                 return true;
             } catch (SQLException e) {
-                Log.e(LOG_TAG, "[CDMALTEPhone] Can't store current operator ret false", e);
+                Rlog.e(LOG_TAG, "[CDMALTEPhone] Can't store current operator ret false", e);
             }
         } else {
             if (DBG) log("updateCurrentCarrierInProvider mIccRecords == null ret false");
@@ -302,7 +302,7 @@ public class CDMALTEPhone extends CDMAPhone {
 
     @Override
     protected void log(String s) {
-            Log.d(LOG_TAG, "[CDMALTEPhone] " + s);
+            Rlog.d(LOG_TAG, "[CDMALTEPhone] " + s);
     }
 
     @Override
index c43888b..1465a17 100755 (executable)
@@ -39,7 +39,7 @@ import android.telephony.PhoneNumberUtils;
 import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
 import android.text.TextUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.Call;
 import com.android.internal.telephony.CallStateException;
@@ -48,10 +48,7 @@ import com.android.internal.telephony.CommandException;
 import com.android.internal.telephony.CommandsInterface;
 import com.android.internal.telephony.Connection;
 import com.android.internal.telephony.IccCard;
-import com.android.internal.telephony.IccException;
-import com.android.internal.telephony.IccFileHandler;
 import com.android.internal.telephony.IccPhoneBookInterfaceManager;
-import com.android.internal.telephony.IccRecords;
 import com.android.internal.telephony.IccSmsInterfaceManager;
 import com.android.internal.telephony.MccTable;
 import com.android.internal.telephony.MmiCode;
@@ -65,12 +62,16 @@ import com.android.internal.telephony.PhoneSubInfo;
 import com.android.internal.telephony.ServiceStateTracker;
 import com.android.internal.telephony.TelephonyIntents;
 import com.android.internal.telephony.TelephonyProperties;
-import com.android.internal.telephony.UiccCard;
-import com.android.internal.telephony.UiccCardApplication;
 import com.android.internal.telephony.UUSInfo;
-import com.android.internal.telephony.IccCardApplicationStatus.AppState;
 import com.android.internal.telephony.cat.CatService;
+import com.android.internal.telephony.uicc.IccException;
+import com.android.internal.telephony.uicc.IccFileHandler;
+import com.android.internal.telephony.uicc.IccRecords;
+import com.android.internal.telephony.uicc.RuimRecords;
+import com.android.internal.telephony.uicc.UiccCard;
+import com.android.internal.telephony.uicc.UiccCardApplication;
 import com.android.internal.telephony.uicc.UiccController;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
 
 import java.io.FileDescriptor;
 import java.io.PrintWriter;
@@ -265,9 +266,9 @@ public class CDMAPhone extends PhoneBase {
 
     @Override
     protected void finalize() {
-        if(DBG) Log.d(LOG_TAG, "CDMAPhone finalized");
+        if(DBG) Rlog.d(LOG_TAG, "CDMAPhone finalized");
         if (mWakeLock.isHeld()) {
-            Log.e(LOG_TAG, "UNEXPECTED; mWakeLock is held when finalizing.");
+            Rlog.e(LOG_TAG, "UNEXPECTED; mWakeLock is held when finalizing.");
             mWakeLock.release();
         }
     }
@@ -297,7 +298,7 @@ public class CDMAPhone extends PhoneBase {
     }
 
     public boolean canTransfer() {
-        Log.e(LOG_TAG, "canTransfer: not possible in CDMA");
+        Rlog.e(LOG_TAG, "canTransfer: not possible in CDMA");
         return false;
     }
 
@@ -315,7 +316,7 @@ public class CDMAPhone extends PhoneBase {
 
     public void conference() throws CallStateException {
         // three way calls in CDMA will be handled by feature codes
-        Log.e(LOG_TAG, "conference: not possible in CDMA");
+        Rlog.e(LOG_TAG, "conference: not possible in CDMA");
     }
 
     public void enableEnhancedVoicePrivacy(boolean enable, Message onComplete) {
@@ -379,7 +380,7 @@ public class CDMAPhone extends PhoneBase {
 
     public void registerForSuppServiceNotification(
             Handler h, int what, Object obj) {
-        Log.e(LOG_TAG, "method registerForSuppServiceNotification is NOT supported in CDMA!");
+        Rlog.e(LOG_TAG, "method registerForSuppServiceNotification is NOT supported in CDMA!");
     }
 
     public CdmaCall getBackgroundCall() {
@@ -387,7 +388,7 @@ public class CDMAPhone extends PhoneBase {
     }
 
     public boolean handleInCallMmiCommands(String dialString) {
-        Log.e(LOG_TAG, "method handleInCallMmiCommands is NOT supported in CDMA!");
+        Rlog.e(LOG_TAG, "method handleInCallMmiCommands is NOT supported in CDMA!");
         return false;
     }
 
@@ -402,11 +403,11 @@ public class CDMAPhone extends PhoneBase {
 
     public void
     setNetworkSelectionModeAutomatic(Message response) {
-        Log.e(LOG_TAG, "method setNetworkSelectionModeAutomatic is NOT supported in CDMA!");
+        Rlog.e(LOG_TAG, "method setNetworkSelectionModeAutomatic is NOT supported in CDMA!");
     }
 
     public void unregisterForSuppServiceNotification(Handler h) {
-        Log.e(LOG_TAG, "method unregisterForSuppServiceNotification is NOT supported in CDMA!");
+        Rlog.e(LOG_TAG, "method unregisterForSuppServiceNotification is NOT supported in CDMA!");
     }
 
     public void
@@ -461,14 +462,14 @@ public class CDMAPhone extends PhoneBase {
     public String getDeviceId() {
         String id = getMeid();
         if ((id == null) || id.matches("^0*$")) {
-            Log.d(LOG_TAG, "getDeviceId(): MEID is not initialized use ESN");
+            Rlog.d(LOG_TAG, "getDeviceId(): MEID is not initialized use ESN");
             id = getEsn();
         }
         return id;
     }
 
     public String getDeviceSvn() {
-        Log.d(LOG_TAG, "getDeviceSvn(): return 0");
+        Rlog.d(LOG_TAG, "getDeviceSvn(): return 0");
         return "0";
     }
 
@@ -477,12 +478,12 @@ public class CDMAPhone extends PhoneBase {
     }
 
     public String getImei() {
-        Log.e(LOG_TAG, "IMEI is not available in CDMA");
+        Rlog.e(LOG_TAG, "IMEI is not available in CDMA");
         return null;
     }
 
     public boolean canConference() {
-        Log.e(LOG_TAG, "canConference: not possible in CDMA");
+        Rlog.e(LOG_TAG, "canConference: not possible in CDMA");
         return false;
     }
 
@@ -497,7 +498,7 @@ public class CDMAPhone extends PhoneBase {
     public void
     selectNetworkManually(OperatorInfo network,
             Message response) {
-        Log.e(LOG_TAG, "selectNetworkManually: not possible in CDMA");
+        Rlog.e(LOG_TAG, "selectNetworkManually: not possible in CDMA");
     }
 
     public void setOnPostDialCharacter(Handler h, int what, Object obj) {
@@ -508,7 +509,7 @@ public class CDMAPhone extends PhoneBase {
         CdmaMmiCode mmi = CdmaMmiCode.newFromDialString(dialString, this);
 
         if (mmi == null) {
-            Log.e(LOG_TAG, "Mmi is NULL!");
+            Rlog.e(LOG_TAG, "Mmi is NULL!");
             return false;
         } else if (mmi.isPukCommand()) {
             mPendingMmis.add(mmi);
@@ -516,7 +517,7 @@ public class CDMAPhone extends PhoneBase {
             mmi.processCode();
             return true;
         }
-        Log.e(LOG_TAG, "Unrecognized mmi!");
+        Rlog.e(LOG_TAG, "Unrecognized mmi!");
         return false;
     }
 
@@ -537,11 +538,11 @@ public class CDMAPhone extends PhoneBase {
     }
 
     public void setLine1Number(String alphaTag, String number, Message onComplete) {
-        Log.e(LOG_TAG, "setLine1Number: not possible in CDMA");
+        Rlog.e(LOG_TAG, "setLine1Number: not possible in CDMA");
     }
 
     public void setCallWaiting(boolean enable, Message onComplete) {
-        Log.e(LOG_TAG, "method setCallWaiting is NOT supported in CDMA!");
+        Rlog.e(LOG_TAG, "method setCallWaiting is NOT supported in CDMA!");
     }
 
     public void updateServiceLocation() {
@@ -647,12 +648,12 @@ public class CDMAPhone extends PhoneBase {
     }
 
     public void sendUssdResponse(String ussdMessge) {
-        Log.e(LOG_TAG, "sendUssdResponse: not possible in CDMA");
+        Rlog.e(LOG_TAG, "sendUssdResponse: not possible in CDMA");
     }
 
     public void sendDtmf(char c) {
         if (!PhoneNumberUtils.is12Key(c)) {
-            Log.e(LOG_TAG,
+            Rlog.e(LOG_TAG,
                     "sendDtmf called with invalid character '" + c + "'");
         } else {
             if (mCT.state ==  PhoneConstants.State.OFFHOOK) {
@@ -663,7 +664,7 @@ public class CDMAPhone extends PhoneBase {
 
     public void startDtmf(char c) {
         if (!PhoneNumberUtils.is12Key(c)) {
-            Log.e(LOG_TAG,
+            Rlog.e(LOG_TAG,
                     "startDtmf called with invalid character '" + c + "'");
         } else {
             mCM.startDtmf(c, null);
@@ -678,7 +679,7 @@ public class CDMAPhone extends PhoneBase {
         boolean check = true;
         for (int itr = 0;itr < dtmfString.length(); itr++) {
             if (!PhoneNumberUtils.is12Key(dtmfString.charAt(itr))) {
-                Log.e(LOG_TAG,
+                Rlog.e(LOG_TAG,
                         "sendDtmf called with invalid character '" + dtmfString.charAt(itr)+ "'");
                 check = false;
                 break;
@@ -690,11 +691,11 @@ public class CDMAPhone extends PhoneBase {
      }
 
     public void getAvailableNetworks(Message response) {
-        Log.e(LOG_TAG, "getAvailableNetworks: not possible in CDMA");
+        Rlog.e(LOG_TAG, "getAvailableNetworks: not possible in CDMA");
     }
 
     public void setOutgoingCallerIdDisplay(int commandInterfaceCLIRMode, Message onComplete) {
-        Log.e(LOG_TAG, "setOutgoingCallerIdDisplay: not possible in CDMA");
+        Rlog.e(LOG_TAG, "setOutgoingCallerIdDisplay: not possible in CDMA");
     }
 
     public void enableLocationUpdates() {
@@ -771,7 +772,7 @@ public class CDMAPhone extends PhoneBase {
     }
 
     public void getCallForwardingOption(int commandInterfaceCFReason, Message onComplete) {
-        Log.e(LOG_TAG, "getCallForwardingOption: not possible in CDMA");
+        Rlog.e(LOG_TAG, "getCallForwardingOption: not possible in CDMA");
     }
 
     public void setCallForwardingOption(int commandInterfaceCFAction,
@@ -779,26 +780,26 @@ public class CDMAPhone extends PhoneBase {
             String dialingNumber,
             int timerSeconds,
             Message onComplete) {
-        Log.e(LOG_TAG, "setCallForwardingOption: not possible in CDMA");
+        Rlog.e(LOG_TAG, "setCallForwardingOption: not possible in CDMA");
     }
 
     public void
     getOutgoingCallerIdDisplay(Message onComplete) {
-        Log.e(LOG_TAG, "getOutgoingCallerIdDisplay: not possible in CDMA");
+        Rlog.e(LOG_TAG, "getOutgoingCallerIdDisplay: not possible in CDMA");
     }
 
     public boolean
     getCallForwardingIndicator() {
-        Log.e(LOG_TAG, "getCallForwardingIndicator: not possible in CDMA");
+        Rlog.e(LOG_TAG, "getCallForwardingIndicator: not possible in CDMA");
         return false;
     }
 
     public void explicitCallTransfer() {
-        Log.e(LOG_TAG, "explicitCallTransfer: not possible in CDMA");
+        Rlog.e(LOG_TAG, "explicitCallTransfer: not possible in CDMA");
     }
 
     public String getLine1AlphaTag() {
-        Log.e(LOG_TAG, "getLine1AlphaTag: not possible in CDMA");
+        Rlog.e(LOG_TAG, "getLine1AlphaTag: not possible in CDMA");
         return null;
     }
 
@@ -852,7 +853,7 @@ public class CDMAPhone extends PhoneBase {
         Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
         intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, mIsPhoneInEcmState);
         ActivityManagerNative.broadcastStickyIntent(intent,null,UserHandle.USER_ALL);
-        if (DBG) Log.d(LOG_TAG, "sendEmergencyCallbackModeChange");
+        if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallbackModeChange");
     }
 
     @Override
@@ -866,7 +867,7 @@ public class CDMAPhone extends PhoneBase {
 
     private void handleEnterEmergencyCallbackMode(Message msg) {
         if (DBG) {
-            Log.d(LOG_TAG, "handleEnterEmergencyCallbackMode,mIsPhoneInEcmState= "
+            Rlog.d(LOG_TAG, "handleEnterEmergencyCallbackMode,mIsPhoneInEcmState= "
                     + mIsPhoneInEcmState);
         }
         // if phone is not in Ecm mode, and it's changed to Ecm mode
@@ -889,7 +890,7 @@ public class CDMAPhone extends PhoneBase {
     private void handleExitEmergencyCallbackMode(Message msg) {
         AsyncResult ar = (AsyncResult)msg.obj;
         if (DBG) {
-            Log.d(LOG_TAG, "handleExitEmergencyCallbackMode,ar.exception , mIsPhoneInEcmState "
+            Rlog.d(LOG_TAG, "handleExitEmergencyCallbackMode,ar.exception , mIsPhoneInEcmState "
                     + ar.exception + mIsPhoneInEcmState);
         }
         // Remove pending exit Ecm runnable, if any
@@ -929,7 +930,7 @@ public class CDMAPhone extends PhoneBase {
             mEcmTimerResetRegistrants.notifyResult(Boolean.FALSE);
             break;
         default:
-            Log.e(LOG_TAG, "handleTimerInEmergencyCallbackMode, unsupported action " + action);
+            Rlog.e(LOG_TAG, "handleTimerInEmergencyCallbackMode, unsupported action " + action);
         }
     }
 
@@ -967,7 +968,7 @@ public class CDMAPhone extends PhoneBase {
                     break;
                 }
 
-                if (DBG) Log.d(LOG_TAG, "Baseband version: " + ar.result);
+                if (DBG) Rlog.d(LOG_TAG, "Baseband version: " + ar.result);
                 setSystemProperty(TelephonyProperties.PROPERTY_BASEBAND_VERSION, (String)ar.result);
             }
             break;
@@ -1002,40 +1003,40 @@ public class CDMAPhone extends PhoneBase {
             break;
 
             case EVENT_RUIM_RECORDS_LOADED:{
-                Log.d(LOG_TAG, "Event EVENT_RUIM_RECORDS_LOADED Received");
+                Rlog.d(LOG_TAG, "Event EVENT_RUIM_RECORDS_LOADED Received");
                 updateCurrentCarrierInProvider();
             }
             break;
 
             case EVENT_RADIO_OFF_OR_NOT_AVAILABLE:{
-                Log.d(LOG_TAG, "Event EVENT_RADIO_OFF_OR_NOT_AVAILABLE Received");
+                Rlog.d(LOG_TAG, "Event EVENT_RADIO_OFF_OR_NOT_AVAILABLE Received");
             }
             break;
 
             case EVENT_RADIO_ON:{
-                Log.d(LOG_TAG, "Event EVENT_RADIO_ON Received");
+                Rlog.d(LOG_TAG, "Event EVENT_RADIO_ON Received");
                 handleCdmaSubscriptionSource(mCdmaSSM.getCdmaSubscriptionSource());
             }
             break;
 
             case EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED:{
-                Log.d(LOG_TAG, "EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED");
+                Rlog.d(LOG_TAG, "EVENT_CDMA_SUBSCRIPTION_SOURCE_CHANGED");
                 handleCdmaSubscriptionSource(mCdmaSSM.getCdmaSubscriptionSource());
             }
             break;
 
             case EVENT_SSN:{
-                Log.d(LOG_TAG, "Event EVENT_SSN Received");
+                Rlog.d(LOG_TAG, "Event EVENT_SSN Received");
             }
             break;
 
             case EVENT_REGISTERED_TO_NETWORK:{
-                Log.d(LOG_TAG, "Event EVENT_REGISTERED_TO_NETWORK Received");
+                Rlog.d(LOG_TAG, "Event EVENT_REGISTERED_TO_NETWORK Received");
             }
             break;
 
             case EVENT_NV_READY:{
-                Log.d(LOG_TAG, "Event EVENT_NV_READY Received");
+                Rlog.d(LOG_TAG, "Event EVENT_NV_READY Received");
                 prepareEri();
             }
             break;
@@ -1097,7 +1098,7 @@ public class CDMAPhone extends PhoneBase {
                 break;
 
             default:
-                Log.e(LOG_TAG,"Unknown icc records event code " + eventCode);
+                Rlog.e(LOG_TAG,"Unknown icc records event code " + eventCode);
                 break;
         }
     }
@@ -1162,7 +1163,7 @@ public class CDMAPhone extends PhoneBase {
      * @param response Callback message is empty on completion
      */
     public void activateCellBroadcastSms(int activate, Message response) {
-        Log.e(LOG_TAG, "[CDMAPhone] activateCellBroadcastSms() is obsolete; use SmsManager");
+        Rlog.e(LOG_TAG, "[CDMAPhone] activateCellBroadcastSms() is obsolete; use SmsManager");
         response.sendToTarget();
     }
 
@@ -1172,7 +1173,7 @@ public class CDMAPhone extends PhoneBase {
      * @param response Callback message is empty on completion
      */
     public void getCellBroadcastSmsConfig(Message response) {
-        Log.e(LOG_TAG, "[CDMAPhone] getCellBroadcastSmsConfig() is obsolete; use SmsManager");
+        Rlog.e(LOG_TAG, "[CDMAPhone] getCellBroadcastSmsConfig() is obsolete; use SmsManager");
         response.sendToTarget();
     }
 
@@ -1182,7 +1183,7 @@ public class CDMAPhone extends PhoneBase {
      * @param response Callback message is empty on completion
      */
     public void setCellBroadcastSmsConfig(int[] configValuesArray, Message response) {
-        Log.e(LOG_TAG, "[CDMAPhone] setCellBroadcastSmsConfig() is obsolete; use SmsManager");
+        Rlog.e(LOG_TAG, "[CDMAPhone] setCellBroadcastSmsConfig() is obsolete; use SmsManager");
         response.sendToTarget();
     }
 
@@ -1254,7 +1255,7 @@ public class CDMAPhone extends PhoneBase {
                                 dialStr.substring (IS683A_FEATURE_CODE_NUM_DIGITS,
                                 IS683A_FEATURE_CODE_NUM_DIGITS + IS683A_SYS_SEL_CODE_NUM_DIGITS));
         }
-        if (DBG) Log.d(LOG_TAG, "extractSelCodeFromOtaSpNum " + sysSelCodeInt);
+        if (DBG) Rlog.d(LOG_TAG, "extractSelCodeFromOtaSpNum " + sysSelCodeInt);
         return sysSelCodeInt;
     }
 
@@ -1284,7 +1285,7 @@ public class CDMAPhone extends PhoneBase {
         } catch (NumberFormatException ex) {
             // If the carrier ota sp number schema is not correct, we still allow dial
             // and only log the error:
-            Log.e(LOG_TAG, "checkOtaSpNumBasedOnSysSelCode, error", ex);
+            Rlog.e(LOG_TAG, "checkOtaSpNumBasedOnSysSelCode, error", ex);
         }
         return isOtaSpNum;
     }
@@ -1321,7 +1322,7 @@ public class CDMAPhone extends PhoneBase {
         if (!TextUtils.isEmpty(mCarrierOtaSpNumSchema)) {
             Matcher m = pOtaSpNumSchema.matcher(mCarrierOtaSpNumSchema);
             if (DBG) {
-                Log.d(LOG_TAG, "isCarrierOtaSpNum,schema" + mCarrierOtaSpNumSchema);
+                Rlog.d(LOG_TAG, "isCarrierOtaSpNum,schema" + mCarrierOtaSpNumSchema);
             }
 
             if (m.find()) {
@@ -1332,7 +1333,7 @@ public class CDMAPhone extends PhoneBase {
                         isOtaSpNum=checkOtaSpNumBasedOnSysSelCode(sysSelCodeInt,sch);
                     } else {
                         if (DBG) {
-                            Log.d(LOG_TAG, "isCarrierOtaSpNum,sysSelCodeInt is invalid");
+                            Rlog.d(LOG_TAG, "isCarrierOtaSpNum,sysSelCodeInt is invalid");
                         }
                     }
                 } else if (!TextUtils.isEmpty(sch[0]) && sch[0].equals("FC")) {
@@ -1341,21 +1342,21 @@ public class CDMAPhone extends PhoneBase {
                     if (dialStr.regionMatches(0,fc,0,fcLen)) {
                         isOtaSpNum = true;
                     } else {
-                        if (DBG) Log.d(LOG_TAG, "isCarrierOtaSpNum,not otasp number");
+                        if (DBG) Rlog.d(LOG_TAG, "isCarrierOtaSpNum,not otasp number");
                     }
                 } else {
                     if (DBG) {
-                        Log.d(LOG_TAG, "isCarrierOtaSpNum,ota schema not supported" + sch[0]);
+                        Rlog.d(LOG_TAG, "isCarrierOtaSpNum,ota schema not supported" + sch[0]);
                     }
                 }
             } else {
                 if (DBG) {
-                    Log.d(LOG_TAG, "isCarrierOtaSpNum,ota schema pattern not right" +
+                    Rlog.d(LOG_TAG, "isCarrierOtaSpNum,ota schema pattern not right" +
                           mCarrierOtaSpNumSchema);
                 }
             }
         } else {
-            if (DBG) Log.d(LOG_TAG, "isCarrierOtaSpNum,ota schema pattern empty");
+            if (DBG) Rlog.d(LOG_TAG, "isCarrierOtaSpNum,ota schema pattern empty");
         }
         return isOtaSpNum;
     }
@@ -1377,7 +1378,7 @@ public class CDMAPhone extends PhoneBase {
                 isOtaSpNum = isCarrierOtaSpNum(dialableStr);
             }
         }
-        if (DBG) Log.d(LOG_TAG, "isOtaSpNumber " + isOtaSpNum);
+        if (DBG) Rlog.d(LOG_TAG, "isOtaSpNumber " + isOtaSpNum);
         return isOtaSpNum;
     }
 
@@ -1430,9 +1431,9 @@ public class CDMAPhone extends PhoneBase {
                 iso = MccTable.countryCodeForMcc(Integer.parseInt(
                         operatorNumeric.substring(0,3)));
             } catch (NumberFormatException ex) {
-                Log.w(LOG_TAG, "countryCodeForMcc error" + ex);
+                Rlog.w(LOG_TAG, "countryCodeForMcc error" + ex);
             } catch (StringIndexOutOfBoundsException ex) {
-                Log.w(LOG_TAG, "countryCodeForMcc error" + ex);
+                Rlog.w(LOG_TAG, "countryCodeForMcc error" + ex);
             }
 
             setSystemProperty(PROPERTY_ICC_OPERATOR_ISO_COUNTRY, iso);
@@ -1459,7 +1460,7 @@ public class CDMAPhone extends PhoneBase {
 
                 return true;
             } catch (SQLException e) {
-                Log.e(LOG_TAG, "Can't store current operator", e);
+                Rlog.e(LOG_TAG, "Can't store current operator", e);
             }
         }
         return false;
@@ -1508,7 +1509,7 @@ public class CDMAPhone extends PhoneBase {
 
     protected void log(String s) {
         if (DBG)
-            Log.d(LOG_TAG, "[CDMAPhone] " + s);
+            Rlog.d(LOG_TAG, "[CDMAPhone] " + s);
     }
 
     @Override
index a7d5d0a..8ec5633 100644 (file)
@@ -23,7 +23,7 @@ import android.os.Registrant;
 import android.os.RegistrantList;
 import android.telephony.PhoneNumberUtils;
 import android.telephony.ServiceState;
-import android.util.Log;
+import android.telephony.Rlog;
 import android.os.SystemProperties;
 
 import com.android.internal.telephony.CallStateException;
@@ -112,14 +112,14 @@ public final class CdmaCallTracker extends CallTracker {
             try {
                 if(c != null) hangup(c);
             } catch (CallStateException ex) {
-                Log.e(LOG_TAG, "unexpected error on hangup during dispose");
+                Rlog.e(LOG_TAG, "unexpected error on hangup during dispose");
             }
         }
 
         try {
             if(pendingMO != null) hangup(pendingMO);
         } catch (CallStateException ex) {
-            Log.e(LOG_TAG, "unexpected error on hangup during dispose");
+            Rlog.e(LOG_TAG, "unexpected error on hangup during dispose");
         }
 
         clearDisconnected();
@@ -128,7 +128,7 @@ public final class CdmaCallTracker extends CallTracker {
 
     @Override
     protected void finalize() {
-        Log.d(LOG_TAG, "CdmaCallTracker finalized");
+        Rlog.d(LOG_TAG, "CdmaCallTracker finalized");
     }
 
     //***** Instance Methods
@@ -274,7 +274,7 @@ public final class CdmaCallTracker extends CallTracker {
     void
     acceptCall() throws CallStateException {
         if (ringingCall.getState() == CdmaCall.State.INCOMING) {
-            Log.i("phone", "acceptCall: incoming...");
+            Rlog.i("phone", "acceptCall: incoming...");
             // Always unmute when answering a new call
             setMute(false);
             cm.acceptCall(obtainCompleteMessage());
@@ -386,7 +386,7 @@ public final class CdmaCallTracker extends CallTracker {
 
     boolean
     canTransfer() {
-        Log.e(LOG_TAG, "canTransfer: not possible in CDMA");
+        Rlog.e(LOG_TAG, "canTransfer: not possible in CDMA");
         return false;
     }
 
@@ -436,7 +436,7 @@ public final class CdmaCallTracker extends CallTracker {
             cm.getCurrentCalls(lastRelevantPoll);
         } else if (pendingOperations < 0) {
             // this should never happen
-            Log.e(LOG_TAG,"CdmaCallTracker.pendingOperations < 0");
+            Rlog.e(LOG_TAG,"CdmaCallTracker.pendingOperations < 0");
             pendingOperations = 0;
         }
     }
@@ -540,7 +540,7 @@ public final class CdmaCallTracker extends CallTracker {
                                     "poll: hangupPendingMO, hangup conn " + i);
                             hangup(connections[i]);
                         } catch (CallStateException ex) {
-                            Log.e(LOG_TAG, "unexpected error on hangup");
+                            Rlog.e(LOG_TAG, "unexpected error on hangup");
                         }
 
                         // Do not continue processing this poll
@@ -608,7 +608,7 @@ public final class CdmaCallTracker extends CallTracker {
                         // We should follow the rule of MT calls taking precedence over MO calls
                         // when there is conflict, so here we drop the call info from dc and
                         // continue to use the call info from conn, and only take a log.
-                        Log.e(LOG_TAG,"Error in RIL, Phantom call appeared " + dc);
+                        Rlog.e(LOG_TAG,"Error in RIL, Phantom call appeared " + dc);
                     }
                 } else {
                     boolean changed;
@@ -641,7 +641,7 @@ public final class CdmaCallTracker extends CallTracker {
         // We expect the pending call to appear in the list
         // If it does not, we land here
         if (pendingMO != null) {
-            Log.d(LOG_TAG,"Pending MO dropped before poll fg state:"
+            Rlog.d(LOG_TAG,"Pending MO dropped before poll fg state:"
                             + foregroundCall.getState());
 
             droppedDuringPoll.add(pendingMO);
@@ -756,7 +756,7 @@ public final class CdmaCallTracker extends CallTracker {
             } catch (CallStateException ex) {
                 // Ignore "connection not found"
                 // Call may have hung up already
-                Log.w(LOG_TAG,"CdmaCallTracker WARN: hangup() on absent connection "
+                Rlog.w(LOG_TAG,"CdmaCallTracker WARN: hangup() on absent connection "
                                 + conn);
             }
         }
@@ -776,7 +776,7 @@ public final class CdmaCallTracker extends CallTracker {
         } catch (CallStateException ex) {
             // Ignore "connection not found"
             // Call may have hung up already
-            Log.w(LOG_TAG,"CdmaCallTracker WARN: separate() on absent connection "
+            Rlog.w(LOG_TAG,"CdmaCallTracker WARN: separate() on absent connection "
                           + conn);
         }
     }
@@ -867,7 +867,7 @@ public final class CdmaCallTracker extends CallTracker {
                 cm.hangupConnection(cn.getCDMAIndex(), obtainCompleteMessage());
             }
         } catch (CallStateException ex) {
-            Log.e(LOG_TAG, "hangupConnectionByIndex caught " + ex);
+            Rlog.e(LOG_TAG, "hangupConnectionByIndex caught " + ex);
         }
     }
 
@@ -949,7 +949,7 @@ public final class CdmaCallTracker extends CallTracker {
 
         switch (msg.what) {
             case EVENT_POLL_CALLS_RESULT:{
-                Log.d(LOG_TAG, "Event EVENT_POLL_CALLS_RESULT Received");
+                Rlog.d(LOG_TAG, "Event EVENT_POLL_CALLS_RESULT Received");
                 ar = (AsyncResult)msg.obj;
 
                 if(msg == lastRelevantPoll) {
@@ -982,7 +982,7 @@ public final class CdmaCallTracker extends CallTracker {
                     // An exception occurred...just treat the disconnect
                     // cause as "normal"
                     causeCode = CallFailCause.NORMAL_CLEARING;
-                    Log.i(LOG_TAG,
+                    Rlog.i(LOG_TAG,
                             "Exception during getLastCallFailCause, assuming normal disconnect");
                 } else {
                     causeCode = ((int[])ar.result)[0];
@@ -1028,7 +1028,7 @@ public final class CdmaCallTracker extends CallTracker {
                ar = (AsyncResult)msg.obj;
                if (ar.exception == null) {
                    handleCallWaitingInfo((CdmaCallWaitingNotification)ar.result);
-                   Log.d(LOG_TAG, "Event EVENT_CALL_WAITING_INFO_CDMA Received");
+                   Rlog.d(LOG_TAG, "Event EVENT_CALL_WAITING_INFO_CDMA Received");
                }
             break;
 
@@ -1056,7 +1056,7 @@ public final class CdmaCallTracker extends CallTracker {
         case CDMAPhone.CANCEL_ECM_TIMER: mIsEcmTimerCanceled = true; break;
         case CDMAPhone.RESTART_ECM_TIMER: mIsEcmTimerCanceled = false; break;
         default:
-            Log.e(LOG_TAG, "handleEcmTimer, unsupported action " + action);
+            Rlog.e(LOG_TAG, "handleEcmTimer, unsupported action " + action);
         }
     }
 
@@ -1106,13 +1106,17 @@ public final class CdmaCallTracker extends CallTracker {
             // Something strange happened: a call which is neither
             // a ringing call nor the one we created. It could be the
             // call collision result from RIL
-            Log.e(LOG_TAG,"Phantom call appeared " + dc);
+            Rlog.e(LOG_TAG,"Phantom call appeared " + dc);
             // If it's a connected call, set the connect time so that
             // it's non-zero.  It may not be accurate, but at least
             // it won't appear as a Missed Call.
             if (dc.state != DriverCall.State.ALERTING
                 && dc.state != DriverCall.State.DIALING) {
-                connections[i].connectTime = System.currentTimeMillis();
+                connections[i].onConnectedInOrOut();
+                if (dc.state == DriverCall.State.HOLDING) {
+                    // We've transitioned into HOLDING
+                    connections[i].onStartedHolding();
+                }
             }
         }
         return newRinging;
@@ -1129,7 +1133,7 @@ public final class CdmaCallTracker extends CallTracker {
     }
 
     protected void log(String msg) {
-        Log.d(LOG_TAG, "[CdmaCallTracker] " + msg);
+        Rlog.d(LOG_TAG, "[CdmaCallTracker] " + msg);
     }
 
     @Override
index 0a9bdb7..1d50c8b 100644 (file)
@@ -16,7 +16,7 @@
 
 package com.android.internal.telephony.cdma;
 
-import android.util.Log;
+import android.telephony.Rlog;
 import com.android.internal.telephony.Connection;
 import com.android.internal.telephony.PhoneConstants;
 
@@ -62,7 +62,7 @@ public class CdmaCallWaitingNotification {
             case 2: return PhoneConstants.PRESENTATION_UNKNOWN;
             default:
                 // This shouldn't happen, just log an error and treat as Unknown
-                Log.d(LOG_TAG, "Unexpected presentation " + cli);
+                Rlog.d(LOG_TAG, "Unexpected presentation " + cli);
                 return PhoneConstants.PRESENTATION_UNKNOWN;
         }
     }
index 17eecbd..29ed9cb 100755 (executable)
@@ -25,17 +25,15 @@ import android.os.Message;
 import android.os.PowerManager;
 import android.os.Registrant;
 import android.os.SystemClock;
-import android.os.SystemProperties;
-import android.util.Log;
+import android.telephony.Rlog;
 import android.text.TextUtils;
 
 import android.telephony.PhoneNumberUtils;
 import android.telephony.ServiceState;
 
-import com.android.internal.telephony.IccCardApplicationStatus.AppState;
-import com.android.internal.telephony.TelephonyProperties;
-import com.android.internal.telephony.RILConstants;
+import com.android.internal.telephony.uicc.UiccCardApplication;
 import com.android.internal.telephony.uicc.UiccController;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
 
 /**
  * {@hide}
@@ -151,9 +149,9 @@ public class CdmaConnection extends Connection {
         h = new MyHandler(owner.getLooper());
 
         this.dialString = dialString;
-        Log.d(LOG_TAG, "[CDMAConn] CdmaConnection: dialString=" + dialString);
+        Rlog.d(LOG_TAG, "[CDMAConn] CdmaConnection: dialString=" + dialString);
         dialString = formatDialString(dialString);
-        Log.d(LOG_TAG, "[CDMAConn] CdmaConnection:formated dialString=" + dialString);
+        Rlog.d(LOG_TAG, "[CDMAConn] CdmaConnection:formated dialString=" + dialString);
 
         this.address = PhoneNumberUtils.extractNetworkPortionAlt(dialString);
         this.postDialString = PhoneNumberUtils.extractPostDialPortion(dialString);
@@ -304,7 +302,7 @@ public class CdmaConnection extends Connection {
 
     public void proceedAfterWaitChar() {
         if (postDialState != PostDialState.WAIT) {
-            Log.w(LOG_TAG, "CdmaConnection.proceedAfterWaitChar(): Expected "
+            Rlog.w(LOG_TAG, "CdmaConnection.proceedAfterWaitChar(): Expected "
                 + "getPostDialState() to be WAIT but was " + postDialState);
             return;
         }
@@ -316,7 +314,7 @@ public class CdmaConnection extends Connection {
 
     public void proceedAfterWildChar(String str) {
         if (postDialState != PostDialState.WILD) {
-            Log.w(LOG_TAG, "CdmaConnection.proceedAfterWaitChar(): Expected "
+            Rlog.w(LOG_TAG, "CdmaConnection.proceedAfterWaitChar(): Expected "
                 + "getPostDialState() to be WILD but was " + postDialState);
             return;
         }
@@ -418,10 +416,10 @@ public class CdmaConnection extends Connection {
             default:
                 CDMAPhone phone = owner.phone;
                 int serviceState = phone.getServiceState().getState();
-                AppState uiccAppState = UiccController
+                UiccCardApplication app = UiccController
                         .getInstance()
-                        .getUiccCardApplication(UiccController.APP_FAM_3GPP2)
-                        .getState();
+                        .getUiccCardApplication(UiccController.APP_FAM_3GPP2);
+                AppState uiccAppState = (app != null) ? app.getState() : AppState.APPSTATE_UNKNOWN;
                 if (serviceState == ServiceState.STATE_POWER_OFF) {
                     return DisconnectCause.POWER_OFF;
                 } else if (serviceState == ServiceState.STATE_OUT_OF_SERVICE
@@ -451,7 +449,7 @@ public class CdmaConnection extends Connection {
 
         if (!disconnected) {
             doDisconnect();
-            if (false) Log.d(LOG_TAG,
+            if (false) Rlog.d(LOG_TAG,
                     "[CDMAConn] onDisconnect: cause=" + cause);
 
             owner.phone.notifyDisconnect(this);
@@ -468,7 +466,7 @@ public class CdmaConnection extends Connection {
     onLocalDisconnect() {
         if (!disconnected) {
             doDisconnect();
-            if (false) Log.d(LOG_TAG,
+            if (false) Rlog.d(LOG_TAG,
                     "[CDMAConn] onLoalDisconnect" );
 
             if (parent != null) {
@@ -605,7 +603,7 @@ public class CdmaConnection extends Connection {
        disconnected = true;
     }
 
-    private void
+    /*package*/ void
     onStartedHolding() {
         holdingStartTime = SystemClock.elapsedRealtime();
     }
@@ -679,7 +677,7 @@ public class CdmaConnection extends Connection {
          * and or onConnectedInOrOut.
          */
         if (mPartialWakeLock.isHeld()) {
-            Log.e(LOG_TAG, "[CdmaConn] UNEXPECTED; mPartialWakeLock is held when finalizing.");
+            Rlog.e(LOG_TAG, "[CdmaConn] UNEXPECTED; mPartialWakeLock is held when finalizing.");
         }
         releaseWakeLock();
     }
@@ -690,7 +688,7 @@ public class CdmaConnection extends Connection {
 
         if (postDialState == PostDialState.CANCELLED) {
             releaseWakeLock();
-            //Log.v("CDMA", "##### processNextPostDialChar: postDialState == CANCELLED, bail");
+            //Rlog.v("CDMA", "##### processNextPostDialChar: postDialState == CANCELLED, bail");
             return;
         }
 
@@ -716,7 +714,7 @@ public class CdmaConnection extends Connection {
                 // Will call processNextPostDialChar
                 h.obtainMessage(EVENT_NEXT_POST_DIAL).sendToTarget();
                 // Don't notify application
-                Log.e("CDMA", "processNextPostDialChar: c=" + c + " isn't valid!");
+                Rlog.e("CDMA", "processNextPostDialChar: c=" + c + " isn't valid!");
                 return;
             }
         }
@@ -936,7 +934,7 @@ public class CdmaConnection extends Connection {
     }
 
     private void log(String msg) {
-        Log.d(LOG_TAG, "[CDMAConn] " + msg);
+        Rlog.d(LOG_TAG, "[CDMAConn] " + msg);
     }
 
     @Override
index 8761828..a041974 100644 (file)
@@ -17,7 +17,7 @@
 package com.android.internal.telephony.cdma;
 
 import android.os.Message;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.DataConnection;
 import com.android.internal.telephony.DataConnectionTracker;
@@ -113,7 +113,7 @@ public class CdmaDataConnection extends DataConnection {
 
     @Override
     protected void log(String s) {
-        Log.d(LOG_TAG, "[" + getName() + "] " + s);
+        Rlog.d(LOG_TAG, "[" + getName() + "] " + s);
     }
 
     @Override
index 2acc5f9..0e68125 100644 (file)
@@ -29,7 +29,7 @@ import android.telephony.TelephonyManager;
 import android.telephony.cdma.CdmaCellLocation;
 import android.text.TextUtils;
 import android.util.EventLog;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import com.android.internal.telephony.ApnSetting;
 import com.android.internal.telephony.CommandsInterface;
@@ -41,11 +41,11 @@ import com.android.internal.telephony.DataConnectionTracker;
 import com.android.internal.telephony.DctConstants;
 import com.android.internal.telephony.EventLogTags;
 import com.android.internal.telephony.PhoneConstants;
-import com.android.internal.telephony.IccRecords;
 import com.android.internal.telephony.Phone;
 import com.android.internal.telephony.RetryManager;
 import com.android.internal.telephony.RILConstants;
-import com.android.internal.telephony.UiccCard;
+import com.android.internal.telephony.uicc.IccRecords;
+import com.android.internal.telephony.uicc.UiccCard;
 import com.android.internal.telephony.uicc.UiccController;
 import com.android.internal.util.AsyncChannel;
 
@@ -951,12 +951,12 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
 
     @Override
     protected void log(String s) {
-        Log.d(LOG_TAG, "[CdmaDCT] " + s);
+        Rlog.d(LOG_TAG, "[CdmaDCT] " + s);
     }
 
     @Override
     protected void loge(String s) {
-        Log.e(LOG_TAG, "[CdmaDCT] " + s);
+        Rlog.e(LOG_TAG, "[CdmaDCT] " + s);
     }
 
     @Override
index 50e87b1..9a84303 100644 (file)
@@ -37,11 +37,12 @@ import android.os.SystemClock;
 import android.os.SystemProperties;
 
 import android.text.TextUtils;
-import android.util.Log;
+import android.telephony.Rlog;
 import android.util.EventLog;
 
-import com.android.internal.telephony.IccCardApplicationStatus.AppState;
 import com.android.internal.telephony.gsm.GsmDataConnectionTracker;
+import com.android.internal.telephony.uicc.RuimRecords;
+import com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState;
 import com.android.internal.telephony.IccCardConstants;
 
 import java.io.FileDescriptor;
@@ -222,6 +223,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
         switch (cm.getRadioState()) {
             case RADIO_UNAVAILABLE:
                 newSS.setStateOutOfService();
+                mLteSS.setStateOutOfService();
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;
@@ -231,6 +233,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
 
             case RADIO_OFF:
                 newSS.setStateOff();
+                mLteSS.setStateOff();
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;
@@ -564,10 +567,12 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
 
     @Override
     public boolean isConcurrentVoiceAndDataAllowed() {
-        // Note: it needs to be confirmed which CDMA network types
-        // can support voice and data calls concurrently.
-        // For the time-being, the return value will be false.
-        return (mRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_LTE);
+        // For non-LTE, look at the CSS indicator to check on SV capability
+        if (mRilRadioTechnology == ServiceState.RIL_RADIO_TECHNOLOGY_LTE) {
+            return true;
+        } else {
+            return ss.getCssIndicator() == 1;
+        }
     }
 
     /**
@@ -614,12 +619,12 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
 
     @Override
     protected void log(String s) {
-        Log.d(LOG_TAG, "[CdmaLteSST] " + s);
+        Rlog.d(LOG_TAG, "[CdmaLteSST] " + s);
     }
 
     @Override
     protected void loge(String s) {
-        Log.e(LOG_TAG, "[CdmaLteSST] " + s);
+        Rlog.e(LOG_TAG, "[CdmaLteSST] " + s);
     }
 
     @Override
index 8dd8c2e..eaf5d01 100644 (file)
@@ -24,7 +24,7 @@ import com.android.internal.telephony.MmiCode;
 import android.os.AsyncResult;
 import android.os.Handler;
 import android.os.Message;
-import android.util.Log;
+import android.telephony.Rlog;
 
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
@@ -183,7 +183,7 @@ public final class CdmaMmiCode  extends Handler implements MmiCode {
     }
 
     public boolean isUssdRequest() {
-        Log.w(LOG_TAG, "isUssdRequest is not implemented in CdmaMmiCode");
+        Rlog.w(LOG_TAG, "isUssdRequest is not implemented in CdmaMmiCode");
         return false;
     }
 
@@ -239,7 +239,7 @@ public final class CdmaMmiCode  extends Handler implements MmiCode {
             ar = (AsyncResult) (msg.obj);