summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2010-10-18 19:13:23 -0400
committerJoe Onorato <joeo@google.com>2010-10-19 15:08:05 -0400
commit431bb2269532f2514861b908d5fafda8fa64da79 (patch)
treec862fe87c2525c18057728a75f2b3da9cdc30d2b
parent1858031946b3627b599475c5894655362e510351 (diff)
downloadframeworks_base-431bb2269532f2514861b908d5fafda8fa64da79.zip
frameworks_base-431bb2269532f2514861b908d5fafda8fa64da79.tar.gz
frameworks_base-431bb2269532f2514861b908d5fafda8fa64da79.tar.bz2
Reduce logging.
Remember, the system and main logs are - Shared resources - Primarily for recording problems - To be used only for large grained events during normal operation Bug: 3104855 Change-Id: I136fbd101917dcbc8ebc3f96f276426b48bde7b7
-rw-r--r--core/java/com/android/internal/util/HierarchicalStateMachine.java4
-rw-r--r--libs/utils/StreamingZipInflater.cpp3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java10
-rw-r--r--policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java6
-rw-r--r--services/java/com/android/server/BackupManagerService.java4
-rwxr-xr-xservices/java/com/android/server/NotificationManagerService.java3
-rw-r--r--services/java/com/android/server/PackageManagerService.java6
-rw-r--r--services/java/com/android/server/StatusBarManagerService.java3
-rw-r--r--services/java/com/android/server/TelephonyRegistry.java6
-rw-r--r--services/java/com/android/server/WifiService.java29
-rw-r--r--services/java/com/android/server/connectivity/Tethering.java2
-rw-r--r--services/java/com/android/server/location/GpsXtraDownloader.java7
-rw-r--r--telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java41
-rw-r--r--voip/java/com/android/server/sip/SipService.java18
15 files changed, 76 insertions, 67 deletions
diff --git a/core/java/com/android/internal/util/HierarchicalStateMachine.java b/core/java/com/android/internal/util/HierarchicalStateMachine.java
index f789301..fc1e866 100644
--- a/core/java/com/android/internal/util/HierarchicalStateMachine.java
+++ b/core/java/com/android/internal/util/HierarchicalStateMachine.java
@@ -1094,7 +1094,9 @@ public class HierarchicalStateMachine {
* @param msg that couldn't be handled.
*/
protected void unhandledMessage(Message msg) {
- Log.e(TAG, mName + " - unhandledMessage: msg.what=" + msg.what);
+ if (false) {
+ Log.e(TAG, mName + " - unhandledMessage: msg.what=" + msg.what);
+ }
}
/**
diff --git a/libs/utils/StreamingZipInflater.cpp b/libs/utils/StreamingZipInflater.cpp
index 7ebde78..1f62ac5 100644
--- a/libs/utils/StreamingZipInflater.cpp
+++ b/libs/utils/StreamingZipInflater.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#define LOG_NDEBUG 1
#define LOG_TAG "szipinf"
#include <utils/Log.h>
@@ -157,7 +158,7 @@ ssize_t StreamingZipInflater::read(void* outBuf, size_t count) {
*/
int result = Z_OK;
if (mStreamNeedsInit) {
- LOGI("Initializing zlib to inflate");
+ LOGD("Initializing zlib to inflate");
result = inflateInit2(&mInflateState, -MAX_WBITS);
mStreamNeedsInit = false;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java
index 0309430..9ef6e6f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarPolicy.java
@@ -710,7 +710,6 @@ public class StatusBarPolicy {
NetworkInfo info = (NetworkInfo)(intent.getParcelableExtra(
ConnectivityManager.EXTRA_NETWORK_INFO));
int connectionStatus = intent.getIntExtra(ConnectivityManager.EXTRA_INET_CONDITION, 0);
- Slog.d(TAG, "got CONNECTIVITY_ACTION - info=" + info + ", status = " + connectionStatus);
int inetCondition = (connectionStatus > INET_CONDITION_THRESHOLD ? 1 : 0);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
index b1c6ad8..de30ccd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBarService.java
@@ -392,8 +392,6 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks
}
public void updateNotification(IBinder key, StatusBarNotification notification) {
- Slog.d(TAG, "updateNotification key=" + key + " notification=" + notification);
-
NotificationData oldList;
int oldIndex = mOngoing.findEntry(key);
if (oldIndex >= 0) {
@@ -628,27 +626,27 @@ public class StatusBarService extends Service implements CommandQueue.Callbacks
if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
if ((state & StatusBarManager.DISABLE_EXPAND) != 0) {
- Slog.d(TAG, "DISABLE_EXPAND: yes");
+ if (SPEW) Slog.d(TAG, "DISABLE_EXPAND: yes");
animateCollapse();
}
}
if ((diff & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
if ((state & StatusBarManager.DISABLE_NOTIFICATION_ICONS) != 0) {
- Slog.d(TAG, "DISABLE_NOTIFICATION_ICONS: yes");
+ if (SPEW) Slog.d(TAG, "DISABLE_NOTIFICATION_ICONS: yes");
if (mTicking) {
mTicker.halt();
} else {
setNotificationIconVisibility(false, com.android.internal.R.anim.fade_out);
}
} else {
- Slog.d(TAG, "DISABLE_NOTIFICATION_ICONS: no");
+ if (SPEW) Slog.d(TAG, "DISABLE_NOTIFICATION_ICONS: no");
if (!mExpandedVisible) {
setNotificationIconVisibility(true, com.android.internal.R.anim.fade_in);
}
}
} else if ((diff & StatusBarManager.DISABLE_NOTIFICATION_TICKER) != 0) {
if (mTicking && (state & StatusBarManager.DISABLE_NOTIFICATION_TICKER) != 0) {
- Slog.d(TAG, "DISABLE_NOTIFICATION_TICKER: yes");
+ if (SPEW) Slog.d(TAG, "DISABLE_NOTIFICATION_TICKER: yes");
mTicker.halt();
}
}
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
index 88203c3..9d10ce5 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewMediator.java
@@ -93,8 +93,8 @@ import android.view.WindowManagerPolicy;
*/
public class KeyguardViewMediator implements KeyguardViewCallback,
KeyguardUpdateMonitor.SimStateCallback {
- private final static boolean DEBUG = false && Config.LOGD;
- private final static boolean DBG_WAKE = DEBUG || true;
+ private final static boolean DEBUG = false;
+ private final static boolean DBG_WAKE = false;
private final static String TAG = "KeyguardViewMediator";
@@ -605,7 +605,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback,
* @see #onWakeKeyWhenKeyguardShowingTq(int)
*/
private void wakeWhenReadyLocked(int keyCode) {
- if (DBG_WAKE) Log.d(TAG, "wakeWhenReadyLocked(" + keyCode + ")");
+ if (true || DBG_WAKE) Log.d(TAG, "wakeWhenReadyLocked(" + keyCode + ")");
/**
* acquire the handoff lock that will keep the cpu running. this will
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java
index aa87f29..a7e02a5 100644
--- a/services/java/com/android/server/BackupManagerService.java
+++ b/services/java/com/android/server/BackupManagerService.java
@@ -664,11 +664,11 @@ class BackupManagerService extends IBackupManager.Stub {
// backup.
RandomAccessFile in = null;
try {
- Slog.i(TAG, "Found stale backup journal, scheduling:");
+ Slog.i(TAG, "Found stale backup journal, scheduling");
in = new RandomAccessFile(f, "r");
while (true) {
String packageName = in.readUTF();
- Slog.i(TAG, " + " + packageName);
+ Slog.i(TAG, " " + packageName);
dataChangedImpl(packageName);
}
} catch (EOFException e) {
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index 0a5b72b..e8c1613 100755
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -684,9 +684,6 @@ public class NotificationManagerService extends INotificationManager.Stub
public void enqueueNotificationInternal(String pkg, int callingUid, int callingPid,
String tag, int id, Notification notification, int[] idOut)
{
- Slog.d(TAG, "enqueueNotificationWithTag: calling uid=" + callingUid
- + ", pid=" + callingPid);
-
checkIncomingCall(pkg);
// Limit the number of notifications that any given package except the android
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index c7735d9..d324c2b 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -2500,7 +2500,9 @@ class PackageManagerService extends IPackageManager.Stub {
return;
}
- Log.d(TAG, "Scanning app dir " + dir);
+ if (false) {
+ Log.d(TAG, "Scanning app dir " + dir);
+ }
int i;
for (i=0; i<files.length; i++) {
@@ -2866,10 +2868,8 @@ class PackageManagerService extends IPackageManager.Stub {
TAG, "Scanning package " + pkg.packageName);
if (mPackages.containsKey(pkg.packageName)
|| mSharedLibraries.containsKey(pkg.packageName)) {
- Slog.w(TAG, "*************************************************");
Slog.w(TAG, "Application package " + pkg.packageName
+ " already installed. Skipping duplicate.");
- Slog.w(TAG, "*************************************************");
mLastScanError = PackageManager.INSTALL_FAILED_DUPLICATE_PACKAGE;
return null;
}
diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java
index 4177432..e5dfb18 100644
--- a/services/java/com/android/server/StatusBarManagerService.java
+++ b/services/java/com/android/server/StatusBarManagerService.java
@@ -54,7 +54,7 @@ import java.util.Map;
public class StatusBarManagerService extends IStatusBarService.Stub
{
static final String TAG = "StatusBarManagerService";
- static final boolean SPEW = true;
+ static final boolean SPEW = false;
final Context mContext;
Handler mHandler = new Handler();
@@ -154,7 +154,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub
synchronized (mDisableRecords) {
manageDisableListLocked(what, token, pkg);
final int net = gatherDisableActionsLocked();
- Slog.d(TAG, "disable... net=0x" + Integer.toHexString(net));
if (net != mDisabled) {
mDisabled = net;
mHandler.post(new Runnable() {
diff --git a/services/java/com/android/server/TelephonyRegistry.java b/services/java/com/android/server/TelephonyRegistry.java
index 7e23422..3370279 100644
--- a/services/java/com/android/server/TelephonyRegistry.java
+++ b/services/java/com/android/server/TelephonyRegistry.java
@@ -254,6 +254,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (!checkNotifyPermission("notifyServiceState()")){
return;
}
+ Slog.i(TAG, "notifyServiceState: " + state);
synchronized (mRecords) {
mServiceState = state;
for (int i = mRecords.size() - 1; i >= 0; i--) {
@@ -295,6 +296,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (!checkNotifyPermission("notifyMessageWaitingChanged()")) {
return;
}
+ Slog.i(TAG, "notifyMessageWaitingChanged: " + mwi);
synchronized (mRecords) {
mMessageWaiting = mwi;
for (int i = mRecords.size() - 1; i >= 0; i--) {
@@ -314,6 +316,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (!checkNotifyPermission("notifyCallForwardingChanged()")) {
return;
}
+ Slog.i(TAG, "notifyCallForwardingChanged: " + cfi);
synchronized (mRecords) {
mCallForwarding = cfi;
for (int i = mRecords.size() - 1; i >= 0; i--) {
@@ -354,6 +357,9 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub {
if (!checkNotifyPermission("notifyDataConnection()" )) {
return;
}
+ Slog.i(TAG, "notifyDataConnection: state=" + state + " isDataConnectivityPossible="
+ + isDataConnectivityPossible + " reason=" + reason
+ + " interfaceName=" + interfaceName + " networkType=" + networkType);
synchronized (mRecords) {
mDataConnectionState = state;
mDataConnectionPossible = isDataConnectivityPossible;
diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java
index a63b3d8..c1e9965 100644
--- a/services/java/com/android/server/WifiService.java
+++ b/services/java/com/android/server/WifiService.java
@@ -1656,7 +1656,9 @@ public class WifiService extends IWifiManager.Stub {
Settings.System.getInt(mContext.getContentResolver(),
Settings.System.STAY_ON_WHILE_PLUGGED_IN, 0);
if (action.equals(Intent.ACTION_SCREEN_ON)) {
- Slog.d(TAG, "ACTION_SCREEN_ON");
+ if (DBG) {
+ Slog.d(TAG, "ACTION_SCREEN_ON");
+ }
mAlarmManager.cancel(mIdleIntent);
mDeviceIdle = false;
mScreenOff = false;
@@ -1671,7 +1673,9 @@ public class WifiService extends IWifiManager.Stub {
sendEnableNetworksMessage();
}
} else if (action.equals(Intent.ACTION_SCREEN_OFF)) {
- Slog.d(TAG, "ACTION_SCREEN_OFF");
+ if (DBG) {
+ Slog.d(TAG, "ACTION_SCREEN_OFF");
+ }
mScreenOff = true;
mWifiStateTracker.enableRssiPolling(false);
/*
@@ -1688,21 +1692,28 @@ public class WifiService extends IWifiManager.Stub {
// as long as we would if connected (below)
// TODO - fix the race conditions and switch back to the immediate turn-off
long triggerTime = System.currentTimeMillis() + (2*60*1000); // 2 min
- Slog.d(TAG, "setting ACTION_DEVICE_IDLE timer for 120,000 ms");
+ if (DBG) {
+ Slog.d(TAG, "setting ACTION_DEVICE_IDLE timer for 120,000 ms");
+ }
mAlarmManager.set(AlarmManager.RTC_WAKEUP, triggerTime, mIdleIntent);
// // do not keep Wifi awake when screen is off if Wifi is not associated
// mDeviceIdle = true;
// updateWifiState();
} else {
long triggerTime = System.currentTimeMillis() + idleMillis;
- Slog.d(TAG, "setting ACTION_DEVICE_IDLE timer for " + idleMillis + "ms");
+ if (DBG) {
+ Slog.d(TAG, "setting ACTION_DEVICE_IDLE timer for " + idleMillis
+ + "ms");
+ }
mAlarmManager.set(AlarmManager.RTC_WAKEUP, triggerTime, mIdleIntent);
}
}
/* we can return now -- there's nothing to do until we get the idle intent back */
return;
} else if (action.equals(ACTION_DEVICE_IDLE)) {
- Slog.d(TAG, "got ACTION_DEVICE_IDLE");
+ if (DBG) {
+ Slog.d(TAG, "got ACTION_DEVICE_IDLE");
+ }
mDeviceIdle = true;
reportStartWorkSource();
} else if (action.equals(Intent.ACTION_BATTERY_CHANGED)) {
@@ -1714,11 +1725,15 @@ public class WifiService extends IWifiManager.Stub {
* the already-set timer.
*/
int pluggedType = intent.getIntExtra("plugged", 0);
- Slog.d(TAG, "ACTION_BATTERY_CHANGED pluggedType: " + pluggedType);
+ if (DBG) {
+ Slog.d(TAG, "ACTION_BATTERY_CHANGED pluggedType: " + pluggedType);
+ }
if (mScreenOff && shouldWifiStayAwake(stayAwakeConditions, mPluggedType) &&
!shouldWifiStayAwake(stayAwakeConditions, pluggedType)) {
long triggerTime = System.currentTimeMillis() + idleMillis;
- Slog.d(TAG, "setting ACTION_DEVICE_IDLE timer for " + idleMillis + "ms");
+ if (DBG) {
+ Slog.d(TAG, "setting ACTION_DEVICE_IDLE timer for " + idleMillis + "ms");
+ }
mAlarmManager.set(AlarmManager.RTC_WAKEUP, triggerTime, mIdleIntent);
mPluggedType = pluggedType;
return;
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java
index 1bc5e4b..a73a4ce 100644
--- a/services/java/com/android/server/connectivity/Tethering.java
+++ b/services/java/com/android/server/connectivity/Tethering.java
@@ -120,7 +120,6 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
static final long USB_DISCONNECT_DELAY = 1000;
public Tethering(Context context, Looper looper) {
- Log.d(TAG, "Tethering starting");
mContext = context;
mLooper = looper;
@@ -457,7 +456,6 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
mUsbMassStorageOff = true;
updateUsbStatus();
} else if (action.equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
- Log.d(TAG, "Tethering got CONNECTIVITY_ACTION");
mTetherMasterSM.sendMessage(TetherMasterSM.CMD_UPSTREAM_CHANGED);
} else if (action.equals(Intent.ACTION_BOOT_COMPLETED)) {
mBooted = true;
diff --git a/services/java/com/android/server/location/GpsXtraDownloader.java b/services/java/com/android/server/location/GpsXtraDownloader.java
index bc96980..813d255 100644
--- a/services/java/com/android/server/location/GpsXtraDownloader.java
+++ b/services/java/com/android/server/location/GpsXtraDownloader.java
@@ -44,6 +44,7 @@ import java.util.Random;
public class GpsXtraDownloader {
private static final String TAG = "GpsXtraDownloader";
+ static final boolean DEBUG = false;
private Context mContext;
private String[] mXtraServers;
@@ -107,7 +108,7 @@ public class GpsXtraDownloader {
protected static byte[] doDownload(String url, boolean isProxySet,
String proxyHost, int proxyPort) {
- if (Config.LOGD) Log.d(TAG, "Downloading XTRA data from " + url);
+ if (DEBUG) Log.d(TAG, "Downloading XTRA data from " + url);
AndroidHttpClient client = null;
try {
@@ -130,7 +131,7 @@ public class GpsXtraDownloader {
HttpResponse response = client.execute(req);
StatusLine status = response.getStatusLine();
if (status.getStatusCode() != 200) { // HTTP 200 is success.
- if (Config.LOGD) Log.d(TAG, "HTTP error: " + status.getReasonPhrase());
+ if (DEBUG) Log.d(TAG, "HTTP error: " + status.getReasonPhrase());
return null;
}
@@ -159,7 +160,7 @@ public class GpsXtraDownloader {
}
return body;
} catch (Exception e) {
- if (Config.LOGD) Log.d(TAG, "error " + e);
+ if (DEBUG) Log.d(TAG, "error " + e);
} finally {
if (client != null) {
client.close();
diff --git a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
index 46ef118..9561c6e 100644
--- a/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
+++ b/telephony/java/com/android/internal/telephony/CallerInfoAsyncQuery.java
@@ -37,7 +37,7 @@ import android.util.Log;
*/
public class CallerInfoAsyncQuery {
- private static final boolean DBG = (SystemProperties.getInt("ro.debuggable", 0) == 1);
+ private static final boolean DBG = false;
private static final String LOG_TAG = "CallerInfoAsyncQuery";
private static final int EVENT_NEW_QUERY = 1;
@@ -128,13 +128,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("Unexpected command (CookieWrapper is null): " + msg.what +
+ if (DBG) Log.d(LOG_TAG, "Unexpected command (CookieWrapper is null): " + msg.what +
" ignored by CallerInfoWorkerHandler, passing onto parent.");
super.handleMessage(msg);
} else {
- if (DBG) log("Processing event: " + cw.event + " token (arg1): " + msg.arg1 +
+ if (DBG) Log.d(LOG_TAG, "Processing event: " + cw.event + " token (arg1): " + msg.arg1 +
" command: " + msg.what + " query URI: " + sanitizeUriToString(args.uri));
switch (cw.event) {
@@ -190,7 +190,7 @@ public class CallerInfoAsyncQuery {
*/
@Override
protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
- if (DBG) log("##### onQueryComplete() ##### query complete for token: " + token);
+ if (DBG) Log.d(LOG_TAG, "##### onQueryComplete() ##### query complete for token: " + token);
//get the cookie and notify the listener.
CookieWrapper cw = (CookieWrapper) cookie;
@@ -199,7 +199,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("Cookie is null, ignoring onQueryComplete() request.");
+ if (DBG) Log.d(LOG_TAG, "Cookie is null, ignoring onQueryComplete() request.");
return;
}
@@ -228,7 +228,7 @@ public class CallerInfoAsyncQuery {
mCallerInfo = new CallerInfo().markAsVoiceMail();
} else {
mCallerInfo = CallerInfo.getCallerInfo(mQueryContext, mQueryUri, cursor);
- if (DBG) log("==> Got mCallerInfo: " + mCallerInfo);
+ if (DBG) Log.d(LOG_TAG, "==> Got mCallerInfo: " + mCallerInfo);
// Use the number entered by the user for display.
if (!TextUtils.isEmpty(cw.number)) {
@@ -236,7 +236,7 @@ public class CallerInfoAsyncQuery {
}
}
- if (DBG) log("constructing CallerInfo object for token: " + token);
+ if (DBG) Log.d(LOG_TAG, "constructing CallerInfo object for token: " + token);
//notify that we can clean up the queue after this.
CookieWrapper endMarker = new CookieWrapper();
@@ -246,7 +246,7 @@ public class CallerInfoAsyncQuery {
//notify the listener that the query is complete.
if (cw.listener != null) {
- if (DBG) log("notifying listener: " + cw.listener.getClass().toString() +
+ if (DBG) Log.d(LOG_TAG, "notifying listener: " + cw.listener.getClass().toString() +
" for token: " + token + mCallerInfo);
cw.listener.onQueryComplete(token, cw.cookie, mCallerInfo);
}
@@ -269,7 +269,7 @@ public class CallerInfoAsyncQuery {
CallerInfoAsyncQuery c = new CallerInfoAsyncQuery();
c.allocate(context, contactRef);
- if (DBG) log("starting query for URI: " + contactRef + " handler: " + c.toString());
+ if (DBG) Log.d(LOG_TAG, "starting query for URI: " + contactRef + " handler: " + c.toString());
//create cookieWrapper, start query
CookieWrapper cw = new CookieWrapper();
@@ -296,9 +296,9 @@ public class CallerInfoAsyncQuery {
public static CallerInfoAsyncQuery startQuery(int token, Context context, String number,
OnQueryCompleteListener listener, Object cookie) {
if (DBG) {
- log("##### CallerInfoAsyncQuery startQuery()... #####");
- log("- number: " + /*number*/ "xxxxxxx");
- log("- cookie: " + cookie);
+ Log.d(LOG_TAG, "##### CallerInfoAsyncQuery startQuery()... #####");
+ Log.d(LOG_TAG, "- number: " + /*number*/ "xxxxxxx");
+ Log.d(LOG_TAG, "- cookie: " + cookie);
}
// Construct the URI object and query params, and start the query.
@@ -309,7 +309,7 @@ public class CallerInfoAsyncQuery {
if (PhoneNumberUtils.isUriNumber(number)) {
// "number" is really a SIP address.
- if (DBG) log(" - Treating number as a SIP address: " + /*number*/ "xxxxxxx");
+ if (DBG) Log.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;
@@ -341,11 +341,11 @@ public class CallerInfoAsyncQuery {
}
if (DBG) {
- log("==> contactRef: " + sanitizeUriToString(contactRef));
- log("==> selection: " + selection);
+ Log.d(LOG_TAG, "==> contactRef: " + sanitizeUriToString(contactRef));
+ Log.d(LOG_TAG, "==> selection: " + selection);
if (selectionArgs != null) {
for (int i = 0; i < selectionArgs.length; i++) {
- log("==> selectionArgs[" + i + "]: " + selectionArgs[i]);
+ Log.d(LOG_TAG, "==> selectionArgs[" + i + "]: " + selectionArgs[i]);
}
}
}
@@ -383,7 +383,7 @@ public class CallerInfoAsyncQuery {
*/
public void addQueryListener(int token, OnQueryCompleteListener listener, Object cookie) {
- if (DBG) log("adding listener to query: " + sanitizeUriToString(mHandler.mQueryUri) +
+ if (DBG) Log.d(LOG_TAG, "adding listener to query: " + sanitizeUriToString(mHandler.mQueryUri) +
" handler: " + mHandler.toString());
//create cookieWrapper, add query request to end of queue.
@@ -431,11 +431,4 @@ public class CallerInfoAsyncQuery {
return "";
}
}
-
- /**
- * static logging method
- */
- private static void log(String msg) {
- Log.d(LOG_TAG, msg);
- }
}
diff --git a/voip/java/com/android/server/sip/SipService.java b/voip/java/com/android/server/sip/SipService.java
index 1df08c0..a6f0d88 100644
--- a/voip/java/com/android/server/sip/SipService.java
+++ b/voip/java/com/android/server/sip/SipService.java
@@ -68,7 +68,7 @@ import javax.sip.SipException;
public final class SipService extends ISipService.Stub {
static final String TAG = "SipService";
static final boolean DEBUGV = false;
- private static final boolean DEBUG = true;
+ private static final boolean DEBUG = false;
private static final boolean DEBUG_TIMER = DEBUG && false;
private static final int EXPIRY_TIME = 3600;
private static final int SHORT_EXPIRY_TIME = 10;
@@ -104,7 +104,7 @@ public final class SipService extends ISipService.Stub {
if (SipManager.isApiSupported(context)) {
ServiceManager.addService("sip", new SipService(context));
context.sendBroadcast(new Intent(SipManager.ACTION_SIP_SERVICE_UP));
- Log.i(TAG, "SIP service started");
+ if (DEBUG) Log.i(TAG, "SIP service started");
}
}
@@ -222,7 +222,7 @@ public final class SipService extends ISipService.Stub {
SipSessionGroupExt group = mSipGroups.get(localProfileUri);
if (group == null) return;
if (!isCallerCreatorOrRadio(group)) {
- Log.d(TAG, "only creator or radio can close this profile");
+ Log.w(TAG, "only creator or radio can close this profile");
return;
}
@@ -244,7 +244,7 @@ public final class SipService extends ISipService.Stub {
if (isCallerCreatorOrRadio(group)) {
return group.isOpened();
} else {
- Log.i(TAG, "only creator or radio can query on the profile");
+ Log.w(TAG, "only creator or radio can query on the profile");
return false;
}
}
@@ -257,7 +257,7 @@ public final class SipService extends ISipService.Stub {
if (isCallerCreatorOrRadio(group)) {
return group.isRegistered();
} else {
- Log.i(TAG, "only creator or radio can query on the profile");
+ Log.w(TAG, "only creator or radio can query on the profile");
return false;
}
}
@@ -271,7 +271,7 @@ public final class SipService extends ISipService.Stub {
if (isCallerCreator(group)) {
group.setListener(listener);
} else {
- Log.i(TAG, "only creator can set listener on the profile");
+ Log.w(TAG, "only creator can set listener on the profile");
}
}
@@ -285,7 +285,7 @@ public final class SipService extends ISipService.Stub {
SipSessionGroupExt group = createGroup(localProfile);
return group.createSession(listener);
} catch (SipException e) {
- Log.w(TAG, "createSession()", e);
+ if (DEBUG) Log.d(TAG, "createSession()", e);
return null;
}
}
@@ -303,7 +303,7 @@ public final class SipService extends ISipService.Stub {
s.connect(InetAddress.getByName("192.168.1.1"), 80);
return s.getLocalAddress().getHostAddress();
} catch (IOException e) {
- Log.w(TAG, "determineLocalIp()", e);
+ if (DEBUG) Log.d(TAG, "determineLocalIp()", e);
// dont do anything; there should be a connectivity change going
return null;
}
@@ -467,7 +467,7 @@ public final class SipService extends ISipService.Stub {
return createSipSessionGroup(null, localProfile, password);
} else {
// recursive
- Log.wtf(TAG, "impossible!");
+ Log.wtf(TAG, "impossible! recursive!");
throw new RuntimeException("createSipSessionGroup");
}
}