am 9eef81ce: am 89558696: Merge "Telephony: Define enable/disable APIs for Cdma CMAS"
[android/platform/frameworks/opt/telephony.git] / src / java / com / android / internal / telephony / RIL.java
index 9c6f90e..6840b46 100644 (file)
@@ -43,11 +43,11 @@ import android.os.SystemProperties;
 import android.os.PowerManager.WakeLock;
 import android.telephony.NeighboringCellInfo;
 import android.telephony.PhoneNumberUtils;
+import android.telephony.Rlog;
 import android.telephony.SignalStrength;
 import android.telephony.SmsManager;
 import android.telephony.SmsMessage;
 import android.text.TextUtils;
-import android.telephony.Rlog;
 
 import com.android.internal.telephony.gsm.SmsBroadcastConfigInfo;
 import com.android.internal.telephony.gsm.SuppServiceNotification;
@@ -206,7 +206,7 @@ class RILRequest {
  * {@hide}
  */
 public final class RIL extends BaseCommands implements CommandsInterface {
-    static final String LOG_TAG = "RILJ";
+    static final String RILJ_LOG_TAG = "RILJ";
     static final boolean RILJ_LOGD = true;
     static final boolean RILJ_LOGV = false; // STOP SHIP if true
 
@@ -273,7 +273,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             } else if (intent.getAction().equals(Intent.ACTION_SCREEN_OFF)) {
                 sendScreenState(false);
             } else {
-                Rlog.w(LOG_TAG, "RIL received unexpected Intent: " + intent.getAction());
+                Rlog.w(RILJ_LOG_TAG, "RIL received unexpected Intent: " + intent.getAction());
             }
         }
     };
@@ -347,12 +347,12 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                         dataLength[2] = (byte)((data.length >> 8) & 0xff);
                         dataLength[3] = (byte)((data.length) & 0xff);
 
-                        //Rlog.v(LOG_TAG, "writing packet: " + data.length + " bytes");
+                        //Rlog.v(RILJ_LOG_TAG, "writing packet: " + data.length + " bytes");
 
                         s.getOutputStream().write(dataLength);
                         s.getOutputStream().write(data);
                     } catch (IOException ex) {
-                        Rlog.e(LOG_TAG, "IOException", ex);
+                        Rlog.e(RILJ_LOG_TAG, "IOException", ex);
                         req = findAndRemoveRequestFromList(rr.mSerial);
                         // make sure this request has not already been handled,
                         // eg, if RILReceiver cleared the list.
@@ -361,7 +361,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                             rr.release();
                         }
                     } catch (RuntimeException exc) {
-                        Rlog.e(LOG_TAG, "Uncaught exception ", exc);
+                        Rlog.e(RILJ_LOG_TAG, "Uncaught exception ", exc);
                         req = findAndRemoveRequestFromList(rr.mSerial);
                         // make sure this request has not already been handled,
                         // eg, if RILReceiver cleared the list.
@@ -397,7 +397,7 @@ 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) {
-                                Rlog.d(LOG_TAG, "NOTE: mReqWaiting is NOT 0 but"
+                                Rlog.d(RILJ_LOG_TAG, "NOTE: mReqWaiting is NOT 0 but"
                                         + mRequestMessagesWaiting + " at TIMEOUT, reset!"
                                         + " There still msg waitng for response");
 
@@ -406,12 +406,12 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                                 if (RILJ_LOGD) {
                                     synchronized (mRequestList) {
                                         int count = mRequestList.size();
-                                        Rlog.d(LOG_TAG, "WAKE_LOCK_TIMEOUT " +
+                                        Rlog.d(RILJ_LOG_TAG, "WAKE_LOCK_TIMEOUT " +
                                                 " mRequestList=" + count);
 
                                         for (int i = 0; i < count; i++) {
                                             rr = mRequestList.get(i);
-                                            Rlog.d(LOG_TAG, i + ": [" + rr.mSerial + "] "
+                                            Rlog.d(RILJ_LOG_TAG, i + ": [" + rr.mSerial + "] "
                                                     + requestToString(rr.mRequest));
                                         }
                                     }
@@ -425,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) {
-                                Rlog.e(LOG_TAG, "ERROR: mReqPending is NOT 0 but"
+                                Rlog.e(RILJ_LOG_TAG, "ERROR: mReqPending is NOT 0 but"
                                         + mRequestMessagesPending + " at TIMEOUT, reset!");
                                 mRequestMessagesPending = 0;
 
@@ -465,7 +465,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             countRead = is.read(buffer, offset, remaining);
 
             if (countRead < 0 ) {
-                Rlog.e(LOG_TAG, "Hit EOS reading message length");
+                Rlog.e(RILJ_LOG_TAG, "Hit EOS reading message length");
                 return -1;
             }
 
@@ -485,7 +485,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             countRead = is.read(buffer, offset, remaining);
 
             if (countRead < 0 ) {
-                Rlog.e(LOG_TAG, "Hit EOS reading message.  messageLength=" + messageLength
+                Rlog.e(RILJ_LOG_TAG, "Hit EOS reading message.  messageLength=" + messageLength
                         + " remaining=" + remaining);
                 return -1;
             }
@@ -530,12 +530,12 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                     // or after the 8th time
 
                     if (retryCount == 8) {
-                        Rlog.e (LOG_TAG,
+                        Rlog.e (RILJ_LOG_TAG,
                             "Couldn't find '" + SOCKET_NAME_RIL
                             + "' socket after " + retryCount
                             + " times, continuing to retry silently");
                     } else if (retryCount > 0 && retryCount < 8) {
-                        Rlog.i (LOG_TAG,
+                        Rlog.i (RILJ_LOG_TAG,
                             "Couldn't find '" + SOCKET_NAME_RIL
                             + "' socket; retrying after timeout");
                     }
@@ -552,7 +552,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 retryCount = 0;
 
                 mSocket = s;
-                Rlog.i(LOG_TAG, "Connected to '" + SOCKET_NAME_RIL + "' socket");
+                Rlog.i(RILJ_LOG_TAG, "Connected to '" + SOCKET_NAME_RIL + "' socket");
 
                 int length = 0;
                 try {
@@ -572,20 +572,20 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                         p.unmarshall(buffer, 0, length);
                         p.setDataPosition(0);
 
-                        //Rlog.v(LOG_TAG, "Read packet: " + length + " bytes");
+                        //Rlog.v(RILJ_LOG_TAG, "Read packet: " + length + " bytes");
 
                         processResponse(p);
                         p.recycle();
                     }
                 } catch (java.io.IOException ex) {
-                    Rlog.i(LOG_TAG, "'" + SOCKET_NAME_RIL + "' socket closed",
+                    Rlog.i(RILJ_LOG_TAG, "'" + SOCKET_NAME_RIL + "' socket closed",
                           ex);
                 } catch (Throwable tr) {
-                    Rlog.e(LOG_TAG, "Uncaught exception read length=" + length +
+                    Rlog.e(RILJ_LOG_TAG, "Uncaught exception read length=" + length +
                         "Exception:" + tr.toString());
                 }
 
-                Rlog.i(LOG_TAG, "Disconnected from '" + SOCKET_NAME_RIL
+                Rlog.i(RILJ_LOG_TAG, "Disconnected from '" + SOCKET_NAME_RIL
                       + "' socket");
 
                 setRadioState (RadioState.RADIO_UNAVAILABLE);
@@ -601,7 +601,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 // Clear request list on close
                 clearRequestList(RADIO_NOT_AVAILABLE, false);
             }} catch (Throwable tr) {
-                Rlog.e(LOG_TAG,"Uncaught exception", tr);
+                Rlog.e(RILJ_LOG_TAG,"Uncaught exception", tr);
             }
 
             /* We're disconnected so we don't know the ril version */
@@ -624,7 +624,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         mPhoneType = RILConstants.NO_PHONE;
 
         PowerManager pm = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
-        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG);
+        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, RILJ_LOG_TAG);
         mWakeLock.setReferenceCounted(false);
         mWakeLockTimeout = SystemProperties.getInt(TelephonyProperties.PROPERTY_WAKE_LOCK_TIMEOUT,
                 DEFAULT_WAKE_LOCK_TIMEOUT);
@@ -2156,7 +2156,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         synchronized (mRequestList) {
             int count = mRequestList.size();
             if (RILJ_LOGD && loggable) {
-                Rlog.d(LOG_TAG, "WAKE_LOCK_TIMEOUT " +
+                Rlog.d(RILJ_LOG_TAG, "WAKE_LOCK_TIMEOUT " +
                         " mReqPending=" + mRequestMessagesPending +
                         " mRequestList=" + count);
             }
@@ -2164,7 +2164,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             for (int i = 0; i < count ; i++) {
                 rr = mRequestList.get(i);
                 if (RILJ_LOGD && loggable) {
-                    Rlog.d(LOG_TAG, i + ": [" + rr.mSerial + "] " +
+                    Rlog.d(RILJ_LOG_TAG, i + ": [" + rr.mSerial + "] " +
                             requestToString(rr.mRequest));
                 }
                 rr.onError(error, null);
@@ -2205,7 +2205,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
         rr = findAndRemoveRequestFromList(serial);
 
         if (rr == null) {
-            Rlog.w(LOG_TAG, "Unexpected solicited response! sn: "
+            Rlog.w(RILJ_LOG_TAG, "Unexpected solicited response! sn: "
                             + serial + " error: " + error);
             return;
         }
@@ -2343,7 +2343,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
             }} catch (Throwable tr) {
                 // Exceptions here usually mean invalid RIL responses
 
-                Rlog.w(LOG_TAG, rr.serialString() + "< "
+                Rlog.w(RILJ_LOG_TAG, rr.serialString() + "< "
                         + requestToString(rr.mRequest)
                         + " exception, possible invalid RIL response", tr);
 
@@ -2523,7 +2523,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 throw new RuntimeException("Unrecognized unsol response: " + response);
             //break; (implied)
         }} catch (Throwable tr) {
-            Rlog.e(LOG_TAG, "Exception processing unsol response: " + response +
+            Rlog.e(RILJ_LOG_TAG, "Exception processing unsol response: " + response +
                 "Exception:" + tr.toString());
             return;
         }
@@ -2794,7 +2794,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                 try {
                     listInfoRecs = (ArrayList<CdmaInformationRecords>)ret;
                 } catch (ClassCastException e) {
-                    Rlog.e(LOG_TAG, "Unexpected exception casting to listInfoRecs", e);
+                    Rlog.e(RILJ_LOG_TAG, "Unexpected exception casting to listInfoRecs", e);
                     break;
                 }
 
@@ -3664,11 +3664,11 @@ public final class RIL extends BaseCommands implements CommandsInterface {
     }
 
     private void riljLog(String msg) {
-        Rlog.d(LOG_TAG, msg);
+        Rlog.d(RILJ_LOG_TAG, msg);
     }
 
     private void riljLogv(String msg) {
-        Rlog.v(LOG_TAG, msg);
+        Rlog.v(RILJ_LOG_TAG, msg);
     }
 
     private void unsljLog(int response) {