diff options
author | Wink Saville <wink@google.com> | 2012-12-08 13:11:45 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-12-08 13:11:45 -0800 |
commit | 64a98645919461deb8a61a6ff4e6336ccb1ab362 (patch) | |
tree | df85a28641ad17b77ccbbe07456e54985ffa25de /telephony/java/com | |
parent | 20ab6d1f02c64a7c428d9059e854fe10b754500a (diff) | |
parent | be5316e012d98cd3e74f8aff628c88845cc3fb13 (diff) | |
download | frameworks_base-64a98645919461deb8a61a6ff4e6336ccb1ab362.zip frameworks_base-64a98645919461deb8a61a6ff4e6336ccb1ab362.tar.gz frameworks_base-64a98645919461deb8a61a6ff4e6336ccb1ab362.tar.bz2 |
am be5316e0: Merge "Use Rlog"
* commit 'be5316e012d98cd3e74f8aff628c88845cc3fb13':
Use Rlog
Diffstat (limited to 'telephony/java/com')
3 files changed, 49 insertions, 48 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallerInfo.java b/telephony/java/com/android/internal/telephony/CallerInfo.java index b1a5872..228a630 100644 --- a/telephony/java/com/android/internal/telephony/CallerInfo.java +++ b/telephony/java/com/android/internal/telephony/CallerInfo.java @@ -29,6 +29,7 @@ import android.provider.ContactsContract.RawContacts; import android.telephony.PhoneNumberUtils; import android.telephony.TelephonyManager; import android.text.TextUtils; +import android.telephony.Rlog; import android.util.Log; import com.android.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; @@ -46,7 +47,7 @@ import java.util.Locale; */ public class CallerInfo { private static final String TAG = "CallerInfo"; - private static final boolean VDBG = Log.isLoggable(TAG, Log.VERBOSE); + private static final boolean VDBG = Rlog.isLoggable(TAG, Log.VERBOSE); public static final String UNKNOWN_NUMBER = "-1"; public static final String PRIVATE_NUMBER = "-2"; @@ -164,7 +165,7 @@ public class CallerInfo { info.isCachedPhotoCurrent = false; info.contactExists = false; - if (VDBG) Log.v(TAG, "getCallerInfo() based on cursor..."); + if (VDBG) Rlog.v(TAG, "getCallerInfo() based on cursor..."); if (cursor != null) { if (cursor.moveToFirst()) { @@ -209,10 +210,10 @@ public class CallerInfo { columnIndex = getColumnIndexForPersonId(contactRef, cursor); if (columnIndex != -1) { info.person_id = cursor.getLong(columnIndex); - if (VDBG) Log.v(TAG, "==> got info.person_id: " + info.person_id); + if (VDBG) Rlog.v(TAG, "==> got info.person_id: " + info.person_id); } else { // No valid columnIndex, so we can't look up person_id. - Log.w(TAG, "Couldn't find person_id column for " + contactRef); + Rlog.w(TAG, "Couldn't find person_id column for " + contactRef); // Watch out: this means that anything that depends on // person_id will be broken (like contact photo lookups in // the in-call UI, for example.) @@ -269,7 +270,7 @@ public class CallerInfo { * with all relevant fields empty or null. */ public static CallerInfo getCallerInfo(Context context, String number) { - if (VDBG) Log.v(TAG, "getCallerInfo() based on number..."); + if (VDBG) Rlog.v(TAG, "getCallerInfo() based on number..."); if (TextUtils.isEmpty(number)) { return null; @@ -414,7 +415,7 @@ public class CallerInfo { // permission to retrieve VM number and would not call // this method. // Leave phoneNumber untouched. - Log.e(TAG, "Cannot access VoiceMail.", se); + Rlog.e(TAG, "Cannot access VoiceMail.", se); } // TODO: There is no voicemail picture? // FIXME: FIND ANOTHER ICON @@ -473,10 +474,10 @@ public class CallerInfo { // So instead, figure out the column to use for person_id by just // looking at the URI itself. - if (VDBG) Log.v(TAG, "- getColumnIndexForPersonId: contactRef URI = '" + if (VDBG) Rlog.v(TAG, "- getColumnIndexForPersonId: contactRef URI = '" + contactRef + "'..."); // Warning: Do not enable the following logging (due to ANR risk.) - // if (VDBG) Log.v(TAG, "- MIME type: " + // if (VDBG) Rlog.v(TAG, "- MIME type: " // + context.getContentResolver().getType(contactRef)); String url = contactRef.toString(); @@ -484,25 +485,25 @@ public class CallerInfo { if (url.startsWith("content://com.android.contacts/data/phones")) { // Direct lookup in the Phone table. // MIME type: Phone.CONTENT_ITEM_TYPE (= "vnd.android.cursor.item/phone_v2") - if (VDBG) Log.v(TAG, "'data/phones' URI; using RawContacts.CONTACT_ID"); + if (VDBG) Rlog.v(TAG, "'data/phones' URI; using RawContacts.CONTACT_ID"); columnName = RawContacts.CONTACT_ID; } else if (url.startsWith("content://com.android.contacts/data")) { // Direct lookup in the Data table. // MIME type: Data.CONTENT_TYPE (= "vnd.android.cursor.dir/data") - if (VDBG) Log.v(TAG, "'data' URI; using Data.CONTACT_ID"); + if (VDBG) Rlog.v(TAG, "'data' URI; using Data.CONTACT_ID"); // (Note Data.CONTACT_ID and RawContacts.CONTACT_ID are equivalent.) columnName = Data.CONTACT_ID; } else if (url.startsWith("content://com.android.contacts/phone_lookup")) { // Lookup in the PhoneLookup table, which provides "fuzzy matching" // for phone numbers. // MIME type: PhoneLookup.CONTENT_TYPE (= "vnd.android.cursor.dir/phone_lookup") - if (VDBG) Log.v(TAG, "'phone_lookup' URI; using PhoneLookup._ID"); + if (VDBG) Rlog.v(TAG, "'phone_lookup' URI; using PhoneLookup._ID"); columnName = PhoneLookup._ID; } else { - Log.w(TAG, "Unexpected prefix for contactRef '" + url + "'"); + Rlog.w(TAG, "Unexpected prefix for contactRef '" + url + "'"); } int columnIndex = (columnName != null) ? cursor.getColumnIndex(columnName) : -1; - if (VDBG) Log.v(TAG, "==> Using column '" + columnName + if (VDBG) Rlog.v(TAG, "==> Using column '" + columnName + "' (columnIndex = " + columnIndex + ") for person_id lookup..."); return columnIndex; } @@ -529,7 +530,7 @@ public class CallerInfo { * @see com.android.i18n.phonenumbers.PhoneNumberOfflineGeocoder */ private static String getGeoDescription(Context context, String number) { - if (VDBG) Log.v(TAG, "getGeoDescription('" + number + "')..."); + if (VDBG) Rlog.v(TAG, "getGeoDescription('" + number + "')..."); if (TextUtils.isEmpty(number)) { return null; @@ -542,17 +543,17 @@ public class CallerInfo { String countryIso = getCurrentCountryIso(context, locale); PhoneNumber pn = null; try { - if (VDBG) Log.v(TAG, "parsing '" + number + if (VDBG) Rlog.v(TAG, "parsing '" + number + "' for countryIso '" + countryIso + "'..."); pn = util.parse(number, countryIso); - if (VDBG) Log.v(TAG, "- parsed number: " + pn); + if (VDBG) Rlog.v(TAG, "- parsed number: " + pn); } catch (NumberParseException e) { - Log.w(TAG, "getGeoDescription: NumberParseException for incoming number '" + number + "'"); + Rlog.w(TAG, "getGeoDescription: NumberParseException for incoming number '" + number + "'"); } if (pn != null) { String description = geocoder.getDescriptionForNumber(pn, locale); - if (VDBG) Log.v(TAG, "- got description: '" + description + "'"); + if (VDBG) Rlog.v(TAG, "- got description: '" + description + "'"); return description; } else { return null; @@ -571,7 +572,7 @@ public class CallerInfo { countryIso = detector.detectCountry().getCountryIso(); } else { countryIso = locale.getCountry(); - Log.w(TAG, "No CountryDetector; falling back to countryIso based on locale: " + Rlog.w(TAG, "No CountryDetector; falling back to countryIso based on locale: " + countryIso); } return countryIso; diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java index 4912749..dd5f644 100644 --- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java +++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java @@ -31,7 +31,7 @@ import android.provider.ContactsContract.Data; import android.provider.ContactsContract.PhoneLookup; import android.telephony.PhoneNumberUtils; import android.text.TextUtils; -import android.util.Log; +import android.telephony.Rlog; /** * Helper class to make it easier to run asynchronous caller-id lookup queries. @@ -137,13 +137,13 @@ public class CallerInfoAsyncQuery { // However, if there is any code that this Handler calls (such as in // super.handleMessage) that DOES place unexpected messages on the // queue, then we need pass these messages on. - if (DBG) Log.d(LOG_TAG, "Unexpected command (CookieWrapper is null): " + msg.what + + if (DBG) Rlog.d(LOG_TAG, "Unexpected command (CookieWrapper is null): " + msg.what + " ignored by CallerInfoWorkerHandler, passing onto parent."); super.handleMessage(msg); } else { - if (DBG) Log.d(LOG_TAG, "Processing event: " + cw.event + " token (arg1): " + msg.arg1 + + if (DBG) Rlog.d(LOG_TAG, "Processing event: " + cw.event + " token (arg1): " + msg.arg1 + " command: " + msg.what + " query URI: " + sanitizeUriToString(args.uri)); switch (cw.event) { @@ -199,7 +199,7 @@ public class CallerInfoAsyncQuery { */ @Override protected void onQueryComplete(int token, Object cookie, Cursor cursor) { - if (DBG) Log.d(LOG_TAG, "##### onQueryComplete() ##### query complete for token: " + token); + if (DBG) Rlog.d(LOG_TAG, "##### onQueryComplete() ##### query complete for token: " + token); //get the cookie and notify the listener. CookieWrapper cw = (CookieWrapper) cookie; @@ -208,7 +208,7 @@ public class CallerInfoAsyncQuery { // from within this code. // However, if there is any code that calls this method, we should // check the parameters to make sure they're viable. - if (DBG) Log.d(LOG_TAG, "Cookie is null, ignoring onQueryComplete() request."); + if (DBG) Rlog.d(LOG_TAG, "Cookie is null, ignoring onQueryComplete() request."); return; } @@ -237,13 +237,13 @@ public class CallerInfoAsyncQuery { mCallerInfo = new CallerInfo().markAsVoiceMail(); } else { mCallerInfo = CallerInfo.getCallerInfo(mQueryContext, mQueryUri, cursor); - if (DBG) Log.d(LOG_TAG, "==> Got mCallerInfo: " + mCallerInfo); + if (DBG) Rlog.d(LOG_TAG, "==> Got mCallerInfo: " + mCallerInfo); CallerInfo newCallerInfo = CallerInfo.doSecondaryLookupIfNecessary( mQueryContext, cw.number, mCallerInfo); if (newCallerInfo != mCallerInfo) { mCallerInfo = newCallerInfo; - if (DBG) Log.d(LOG_TAG, "#####async contact look up with numeric username" + if (DBG) Rlog.d(LOG_TAG, "#####async contact look up with numeric username" + mCallerInfo); } @@ -279,7 +279,7 @@ public class CallerInfoAsyncQuery { } } - if (DBG) Log.d(LOG_TAG, "constructing CallerInfo object for token: " + token); + if (DBG) Rlog.d(LOG_TAG, "constructing CallerInfo object for token: " + token); //notify that we can clean up the queue after this. CookieWrapper endMarker = new CookieWrapper(); @@ -289,7 +289,7 @@ public class CallerInfoAsyncQuery { //notify the listener that the query is complete. if (cw.listener != null) { - if (DBG) Log.d(LOG_TAG, "notifying listener: " + cw.listener.getClass().toString() + + if (DBG) Rlog.d(LOG_TAG, "notifying listener: " + cw.listener.getClass().toString() + " for token: " + token + mCallerInfo); cw.listener.onQueryComplete(token, cw.cookie, mCallerInfo); } @@ -312,7 +312,7 @@ public class CallerInfoAsyncQuery { CallerInfoAsyncQuery c = new CallerInfoAsyncQuery(); c.allocate(context, contactRef); - if (DBG) Log.d(LOG_TAG, "starting query for URI: " + contactRef + " handler: " + c.toString()); + if (DBG) Rlog.d(LOG_TAG, "starting query for URI: " + contactRef + " handler: " + c.toString()); //create cookieWrapper, start query CookieWrapper cw = new CookieWrapper(); @@ -339,9 +339,9 @@ public class CallerInfoAsyncQuery { public static CallerInfoAsyncQuery startQuery(int token, Context context, String number, OnQueryCompleteListener listener, Object cookie) { if (DBG) { - Log.d(LOG_TAG, "##### CallerInfoAsyncQuery startQuery()... #####"); - Log.d(LOG_TAG, "- number: " + /*number*/ "xxxxxxx"); - Log.d(LOG_TAG, "- cookie: " + cookie); + Rlog.d(LOG_TAG, "##### CallerInfoAsyncQuery startQuery()... #####"); + Rlog.d(LOG_TAG, "- number: " + /*number*/ "xxxxxxx"); + Rlog.d(LOG_TAG, "- cookie: " + cookie); } // Construct the URI object and query params, and start the query. @@ -352,7 +352,7 @@ public class CallerInfoAsyncQuery { if (PhoneNumberUtils.isUriNumber(number)) { // "number" is really a SIP address. - if (DBG) Log.d(LOG_TAG, " - Treating number as a SIP address: " + /*number*/ "xxxxxxx"); + if (DBG) Rlog.d(LOG_TAG, " - Treating number as a SIP address: " + /*number*/ "xxxxxxx"); // We look up SIP addresses directly in the Data table: contactRef = Data.CONTENT_URI; @@ -384,11 +384,11 @@ public class CallerInfoAsyncQuery { } if (DBG) { - Log.d(LOG_TAG, "==> contactRef: " + sanitizeUriToString(contactRef)); - Log.d(LOG_TAG, "==> selection: " + selection); + Rlog.d(LOG_TAG, "==> contactRef: " + sanitizeUriToString(contactRef)); + Rlog.d(LOG_TAG, "==> selection: " + selection); if (selectionArgs != null) { for (int i = 0; i < selectionArgs.length; i++) { - Log.d(LOG_TAG, "==> selectionArgs[" + i + "]: " + selectionArgs[i]); + Rlog.d(LOG_TAG, "==> selectionArgs[" + i + "]: " + selectionArgs[i]); } } } @@ -426,7 +426,7 @@ public class CallerInfoAsyncQuery { */ public void addQueryListener(int token, OnQueryCompleteListener listener, Object cookie) { - if (DBG) Log.d(LOG_TAG, "adding listener to query: " + sanitizeUriToString(mHandler.mQueryUri) + + if (DBG) Rlog.d(LOG_TAG, "adding listener to query: " + sanitizeUriToString(mHandler.mQueryUri) + " handler: " + mHandler.toString()); //create cookieWrapper, add query request to end of queue. diff --git a/telephony/java/com/android/internal/telephony/GsmAlphabet.java b/telephony/java/com/android/internal/telephony/GsmAlphabet.java index ba14ea7..4cba70d 100644 --- a/telephony/java/com/android/internal/telephony/GsmAlphabet.java +++ b/telephony/java/com/android/internal/telephony/GsmAlphabet.java @@ -20,7 +20,7 @@ import android.content.res.Resources; import android.text.TextUtils; import android.util.SparseIntArray; -import android.util.Log; +import android.telephony.Rlog; import java.nio.ByteBuffer; import java.nio.charset.Charset; @@ -477,11 +477,11 @@ public class GsmAlphabet { StringBuilder ret = new StringBuilder(lengthSeptets); if (languageTable < 0 || languageTable > sLanguageTables.length) { - Log.w(TAG, "unknown language table " + languageTable + ", using default"); + Rlog.w(TAG, "unknown language table " + languageTable + ", using default"); languageTable = 0; } if (shiftTable < 0 || shiftTable > sLanguageShiftTables.length) { - Log.w(TAG, "unknown single shift table " + shiftTable + ", using default"); + Rlog.w(TAG, "unknown single shift table " + shiftTable + ", using default"); shiftTable = 0; } @@ -491,11 +491,11 @@ public class GsmAlphabet { String shiftTableToChar = sLanguageShiftTables[shiftTable]; if (languageTableToChar.isEmpty()) { - Log.w(TAG, "no language table for code " + languageTable + ", using default"); + Rlog.w(TAG, "no language table for code " + languageTable + ", using default"); languageTableToChar = sLanguageTables[0]; } if (shiftTableToChar.isEmpty()) { - Log.w(TAG, "no single shift table for code " + shiftTable + ", using default"); + Rlog.w(TAG, "no single shift table for code " + shiftTable + ", using default"); shiftTableToChar = sLanguageShiftTables[0]; } @@ -535,7 +535,7 @@ public class GsmAlphabet { } } } catch (RuntimeException ex) { - Log.e(TAG, "Error GSM 7 bit packed: ", ex); + Rlog.e(TAG, "Error GSM 7 bit packed: ", ex); return null; } @@ -767,7 +767,7 @@ public class GsmAlphabet { for (int i = 0; i < sz; i++) { char c = s.charAt(i); if (c == GSM_EXTENDED_ESCAPE) { - Log.w(TAG, "countGsmSeptets() string contains Escape character, skipping."); + Rlog.w(TAG, "countGsmSeptets() string contains Escape character, skipping."); continue; } if (charToLanguageTable.get(c, -1) != -1) { @@ -847,7 +847,7 @@ public class GsmAlphabet { for (int i = 0; i < sz && !lpcList.isEmpty(); i++) { char c = s.charAt(i); if (c == GSM_EXTENDED_ESCAPE) { - Log.w(TAG, "countGsmSeptets() string contains Escape character, ignoring!"); + Rlog.w(TAG, "countGsmSeptets() string contains Escape character, ignoring!"); continue; } // iterate through enabled locking shift tables @@ -1439,7 +1439,7 @@ public class GsmAlphabet { int numTables = sLanguageTables.length; int numShiftTables = sLanguageShiftTables.length; if (numTables != numShiftTables) { - Log.e(TAG, "Error: language tables array length " + numTables + + Rlog.e(TAG, "Error: language tables array length " + numTables + " != shift tables array length " + numShiftTables); } @@ -1449,7 +1449,7 @@ public class GsmAlphabet { int tableLen = table.length(); if (tableLen != 0 && tableLen != 128) { - Log.e(TAG, "Error: language tables index " + i + + Rlog.e(TAG, "Error: language tables index " + i + " length " + tableLen + " (expected 128 or 0)"); } @@ -1467,7 +1467,7 @@ public class GsmAlphabet { int shiftTableLen = shiftTable.length(); if (shiftTableLen != 0 && shiftTableLen != 128) { - Log.e(TAG, "Error: language shift tables index " + i + + Rlog.e(TAG, "Error: language shift tables index " + i + " length " + shiftTableLen + " (expected 128 or 0)"); } |