diff options
Diffstat (limited to 'telephony/java/android')
15 files changed, 139 insertions, 45 deletions
diff --git a/telephony/java/android/telephony/CellIdentityCdma.java b/telephony/java/android/telephony/CellIdentityCdma.java index 9579b91..6e2a70d 100644 --- a/telephony/java/android/telephony/CellIdentityCdma.java +++ b/telephony/java/android/telephony/CellIdentityCdma.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * CellIdentity is to represent a unique CDMA cell @@ -219,6 +219,6 @@ public final class CellIdentityCdma implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellIdentityGsm.java b/telephony/java/android/telephony/CellIdentityGsm.java index 21cb790..bda96be 100644 --- a/telephony/java/android/telephony/CellIdentityGsm.java +++ b/telephony/java/android/telephony/CellIdentityGsm.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * CellIdentity to represent a unique GSM or UMTS cell @@ -204,6 +204,6 @@ public final class CellIdentityGsm implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellIdentityLte.java b/telephony/java/android/telephony/CellIdentityLte.java index ad822bb..f72d583 100644 --- a/telephony/java/android/telephony/CellIdentityLte.java +++ b/telephony/java/android/telephony/CellIdentityLte.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * CellIdentity is to represent a unique LTE cell @@ -199,6 +199,6 @@ public final class CellIdentityLte implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellInfoCdma.java b/telephony/java/android/telephony/CellInfoCdma.java index ea48e2e..a5d6e9c 100644 --- a/telephony/java/android/telephony/CellInfoCdma.java +++ b/telephony/java/android/telephony/CellInfoCdma.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Immutable cell information from a point in time. @@ -143,6 +143,6 @@ public final class CellInfoCdma extends CellInfo implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellInfoGsm.java b/telephony/java/android/telephony/CellInfoGsm.java index bd14d45..bf0eca8 100644 --- a/telephony/java/android/telephony/CellInfoGsm.java +++ b/telephony/java/android/telephony/CellInfoGsm.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Immutable cell information from a point in time. @@ -142,6 +142,6 @@ public final class CellInfoGsm extends CellInfo implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellInfoLte.java b/telephony/java/android/telephony/CellInfoLte.java index 2f81b65..35dea24 100644 --- a/telephony/java/android/telephony/CellInfoLte.java +++ b/telephony/java/android/telephony/CellInfoLte.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Immutable cell information from a point in time. @@ -148,6 +148,6 @@ public final class CellInfoLte extends CellInfo implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellSignalStrengthCdma.java b/telephony/java/android/telephony/CellSignalStrengthCdma.java index 660326c..190fea2 100644 --- a/telephony/java/android/telephony/CellSignalStrengthCdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthCdma.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * LTE signal strength related information. @@ -376,6 +376,6 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellSignalStrengthGsm.java b/telephony/java/android/telephony/CellSignalStrengthGsm.java index 4108f61..2c36344 100644 --- a/telephony/java/android/telephony/CellSignalStrengthGsm.java +++ b/telephony/java/android/telephony/CellSignalStrengthGsm.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * LTE signal strength related information. @@ -229,6 +229,6 @@ public final class CellSignalStrengthGsm extends CellSignalStrength implements P * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/CellSignalStrengthLte.java b/telephony/java/android/telephony/CellSignalStrengthLte.java index 925f4d4..55680c8 100644 --- a/telephony/java/android/telephony/CellSignalStrengthLte.java +++ b/telephony/java/android/telephony/CellSignalStrengthLte.java @@ -18,7 +18,7 @@ package android.telephony; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * LTE signal strength related information. @@ -293,6 +293,6 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index f740718..8b85d8c 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -33,7 +33,7 @@ import android.provider.ContactsContract; import android.text.Editable; import android.text.SpannableStringBuilder; import android.text.TextUtils; -import android.util.Log; +import android.telephony.Rlog; import android.util.SparseIntArray; import static com.android.internal.telephony.TelephonyProperties.PROPERTY_ICC_OPERATOR_ISO_COUNTRY; @@ -353,7 +353,7 @@ public class PhoneNumberUtils } private static void log(String msg) { - Log.d(LOG_TAG, msg); + Rlog.d(LOG_TAG, msg); } /** index of the last character of the network portion * (eg anything after is a post-dial string) @@ -1711,7 +1711,7 @@ public class PhoneNumberUtils return false; } - Log.d(LOG_TAG, "System property doesn't provide any emergency numbers." + Rlog.d(LOG_TAG, "System property doesn't provide any emergency numbers." + " Use embedded logic for determining ones."); // No ecclist system property, so use our own list. @@ -1805,7 +1805,7 @@ public class PhoneNumberUtils } else { Locale locale = context.getResources().getConfiguration().locale; countryIso = locale.getCountry(); - Log.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: " + Rlog.w(LOG_TAG, "No CountryDetector; falling back to countryIso based on locale: " + countryIso); } return isEmergencyNumberInternal(number, countryIso, useExactMatch); @@ -2015,7 +2015,7 @@ public class PhoneNumberUtils // This should never happen since we checked the if dialStr is null // and if it contains the plus sign in the beginning of this function. // The plus sign is part of the network portion. - Log.e("checkAndProcessPlusCode: null newDialStr", networkDialStr); + Rlog.e("checkAndProcessPlusCode: null newDialStr", networkDialStr); return dialStr; } postDialStr = extractPostDialPortion(tempDialStr); @@ -2035,7 +2035,7 @@ public class PhoneNumberUtils if (dialableIndex < 0) { postDialStr = ""; } - Log.e("wrong postDialStr=", postDialStr); + Rlog.e("wrong postDialStr=", postDialStr); } } if (DBG) log("checkAndProcessPlusCode,postDialStr=" + postDialStr); @@ -2044,7 +2044,7 @@ public class PhoneNumberUtils // TODO: Support NANP international conversion and other telephone numbering plans. // Currently the phone is never used in non-NANP system, so return the original // dial string. - Log.e("checkAndProcessPlusCode:non-NANP not supported", dialStr); + Rlog.e("checkAndProcessPlusCode:non-NANP not supported", dialStr); } } return retStr; @@ -2103,7 +2103,7 @@ public class PhoneNumberUtils } } } else { - Log.e("isNanp: null dialStr passed in", dialStr); + Rlog.e("isNanp: null dialStr passed in", dialStr); } return retVal; } @@ -2119,7 +2119,7 @@ public class PhoneNumberUtils retVal = true; } } else { - Log.e("isOneNanp: null dialStr passed in", dialStr); + Rlog.e("isOneNanp: null dialStr passed in", dialStr); } return retVal; } @@ -2158,7 +2158,7 @@ public class PhoneNumberUtils delimiterIndex = number.indexOf("%40"); } if (delimiterIndex < 0) { - Log.w(LOG_TAG, + Rlog.w(LOG_TAG, "getUsernameFromUriNumber: no delimiter found in SIP addr '" + number + "'"); delimiterIndex = number.length(); } diff --git a/telephony/java/android/telephony/PhoneStateListener.java b/telephony/java/android/telephony/PhoneStateListener.java index f3ccae6..ff77fc0 100644 --- a/telephony/java/android/telephony/PhoneStateListener.java +++ b/telephony/java/android/telephony/PhoneStateListener.java @@ -23,7 +23,7 @@ import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.CellLocation; import android.telephony.CellInfo; -import android.util.Log; +import android.telephony.Rlog; import com.android.internal.telephony.IPhoneStateListener; @@ -348,7 +348,7 @@ public class PhoneStateListener { Handler mHandler = new Handler() { public void handleMessage(Message msg) { - //Log.d("TelephonyRegistry", "what=0x" + Integer.toHexString(msg.what) + " msg=" + msg); + //Rlog.d("TelephonyRegistry", "what=0x" + Integer.toHexString(msg.what) + " msg=" + msg); switch (msg.what) { case LISTEN_SERVICE_STATE: PhoneStateListener.this.onServiceStateChanged((ServiceState)msg.obj); diff --git a/telephony/java/android/telephony/Rlog.java b/telephony/java/android/telephony/Rlog.java new file mode 100644 index 0000000..9ac7bda --- /dev/null +++ b/telephony/java/android/telephony/Rlog.java @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2012 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.telephony; + +import com.android.internal.os.RuntimeInit; + +import android.util.Log; + +import java.io.PrintWriter; +import java.io.StringWriter; + +/** + * A class to log strings to the RADIO LOG. + * + * @hide + */ +public final class Rlog { + + private Rlog() { + } + + public static int v(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.VERBOSE, tag, msg); + } + + public static int v(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.VERBOSE, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int d(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.DEBUG, tag, msg); + } + + public static int d(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.DEBUG, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int i(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.INFO, tag, msg); + } + + public static int i(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.INFO, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int w(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag, msg); + } + + public static int w(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int w(String tag, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.WARN, tag, Log.getStackTraceString(tr)); + } + + public static int e(String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, Log.ERROR, tag, msg); + } + + public static int e(String tag, String msg, Throwable tr) { + return Log.println_native(Log.LOG_ID_RADIO, Log.ERROR, tag, + msg + '\n' + Log.getStackTraceString(tr)); + } + + public static int println(int priority, String tag, String msg) { + return Log.println_native(Log.LOG_ID_RADIO, priority, tag, msg); + } + + public static boolean isLoggable(String tag, int level) { + return Log.isLoggable(tag, level); + } + +} + diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java index 2c171b1..6c4bd66 100644 --- a/telephony/java/android/telephony/ServiceState.java +++ b/telephony/java/android/telephony/ServiceState.java @@ -19,7 +19,7 @@ package android.telephony; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Contains phone state and service related information. @@ -535,7 +535,7 @@ public class ServiceState implements Parcelable { break; default: rtString = "Unexpected"; - Log.w(LOG_TAG, "Unexpected radioTechnology=" + rt); + Rlog.w(LOG_TAG, "Unexpected radioTechnology=" + rt); break; } return rtString; @@ -562,7 +562,7 @@ public class ServiceState implements Parcelable { } private void setNullState(int state) { - if (DBG) Log.d(LOG_TAG, "[ServiceState] setNullState=" + state); + if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setNullState=" + state); mVoiceRegState = state; mDataRegState = state; mRoaming = false; @@ -592,19 +592,19 @@ public class ServiceState implements Parcelable { public void setState(int state) { setVoiceRegState(state); - if (DBG) Log.e(LOG_TAG, "[ServiceState] setState deprecated use setVoiceRegState()"); + if (DBG) Rlog.e(LOG_TAG, "[ServiceState] setState deprecated use setVoiceRegState()"); } /** @hide */ public void setVoiceRegState(int state) { mVoiceRegState = state; - if (DBG) Log.d(LOG_TAG, "[ServiceState] setVoiceRegState=" + mVoiceRegState); + if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setVoiceRegState=" + mVoiceRegState); } /** @hide */ public void setDataRegState(int state) { mDataRegState = state; - if (DBG) Log.d(LOG_TAG, "[ServiceState] setDataRegState=" + mDataRegState); + if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setDataRegState=" + mDataRegState); } public void setRoaming(boolean roaming) { @@ -734,7 +734,7 @@ public class ServiceState implements Parcelable { /** @hide */ public void setRilDataRadioTechnology(int rt) { this.mRilDataRadioTechnology = rt; - if (DBG) Log.d(LOG_TAG, "[ServiceState] setDataRadioTechnology=" + mRilDataRadioTechnology); + if (DBG) Rlog.d(LOG_TAG, "[ServiceState] setDataRadioTechnology=" + mRilDataRadioTechnology); } /** @hide */ @@ -762,7 +762,7 @@ public class ServiceState implements Parcelable { * {@link #getRilVoiceRadioTechnology} */ public int getRadioTechnology() { - Log.e(LOG_TAG, "ServiceState.getRadioTechnology() DEPRECATED will be removed *******"); + Rlog.e(LOG_TAG, "ServiceState.getRadioTechnology() DEPRECATED will be removed *******"); return getRilDataRadioTechnology(); } @@ -807,7 +807,7 @@ public class ServiceState implements Parcelable { * @hide */ public int getNetworkType() { - Log.e(LOG_TAG, "ServiceState.getNetworkType() DEPRECATED will be removed *******"); + Rlog.e(LOG_TAG, "ServiceState.getNetworkType() DEPRECATED will be removed *******"); return rilRadioTechnologyToNetworkType(mRilVoiceRadioTechnology); } diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java index f998935..e2da53e 100644 --- a/telephony/java/android/telephony/SignalStrength.java +++ b/telephony/java/android/telephony/SignalStrength.java @@ -19,7 +19,7 @@ package android.telephony; import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; +import android.telephony.Rlog; /** * Contains phone signal strength related information. @@ -919,6 +919,6 @@ public class SignalStrength implements Parcelable { * log */ private static void log(String s) { - Log.w(LOG_TAG, s); + Rlog.w(LOG_TAG, s); } } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 261174a..2e8de3b 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -23,7 +23,7 @@ import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; -import android.util.Log; +import android.telephony.Rlog; import com.android.internal.telephony.IPhoneSubInfo; import com.android.internal.telephony.ITelephony; @@ -411,7 +411,7 @@ public class TelephonyManager { cmdline = new String(buffer, 0, count); } } catch (IOException e) { - Log.d(TAG, "No /proc/cmdline exception=" + e); + Rlog.d(TAG, "No /proc/cmdline exception=" + e); } finally { if (is != null) { try { @@ -420,7 +420,7 @@ public class TelephonyManager { } } } - Log.d(TAG, "/proc/cmdline=" + cmdline); + Rlog.d(TAG, "/proc/cmdline=" + cmdline); return cmdline; } @@ -467,7 +467,7 @@ public class TelephonyManager { } } - Log.d(TAG, "getLteOnCdmaMode=" + retVal + " curVal=" + curVal + + Rlog.d(TAG, "getLteOnCdmaMode=" + retVal + " curVal=" + curVal + " product_type='" + productType + "' lteOnCdmaProductType='" + sLteOnCdmaProductType + "'"); return retVal; |