From 0c484107b17e04964de03607df40c3f7c91b147b Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Mon, 1 Feb 2016 18:04:24 -0800 Subject: [PATCH] Turn down the logging a little bit. Change-Id: I2ea19f9a7951c215aee98825f9cb2923295a965d --- .../server/location/GnssLocationProvider.java | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/services/core/java/com/android/server/location/GnssLocationProvider.java b/services/core/java/com/android/server/location/GnssLocationProvider.java index 7fb1783e2e03..ed68abe4a9a8 100644 --- a/services/core/java/com/android/server/location/GnssLocationProvider.java +++ b/services/core/java/com/android/server/location/GnssLocationProvider.java @@ -508,18 +508,18 @@ public class GnssLocationProvider implements LocationProviderInterface { }; private void subscriptionOrSimChanged(Context context) { - Log.d(TAG, "received SIM related action: "); + if (DEBUG) Log.d(TAG, "received SIM related action: "); TelephonyManager phone = (TelephonyManager) mContext.getSystemService(Context.TELEPHONY_SERVICE); String mccMnc = phone.getSimOperator(); if (!TextUtils.isEmpty(mccMnc)) { - Log.d(TAG, "SIM MCC/MNC is available: " + mccMnc); + if (DEBUG) Log.d(TAG, "SIM MCC/MNC is available: " + mccMnc); synchronized (mLock) { reloadGpsProperties(context, mProperties); mNIHandler.setSuplEsEnabled(mSuplEsEnabled); } } else { - Log.d(TAG, "SIM MCC/MNC is still not available"); + if (DEBUG) Log.d(TAG, "SIM MCC/MNC is still not available"); } } @@ -569,7 +569,7 @@ public class GnssLocationProvider implements LocationProviderInterface { } private void reloadGpsProperties(Context context, Properties properties) { - Log.d(TAG, "Reset GPS properties, previous size = " + properties.size()); + if (DEBUG) Log.d(TAG, "Reset GPS properties, previous size = " + properties.size()); loadPropertiesFromResource(context, properties); boolean isPropertiesLoadedFromFile = false; final String gpsHardware = SystemProperties.get("ro.hardware.gps"); @@ -582,7 +582,7 @@ public class GnssLocationProvider implements LocationProviderInterface { if (!isPropertiesLoadedFromFile) { loadPropertiesFromFile(DEFAULT_PROPERTIES_FILE, properties); } - Log.d(TAG, "GPS properties reloaded, size = " + properties.size()); + if (DEBUG) Log.d(TAG, "GPS properties reloaded, size = " + properties.size()); // TODO: we should get rid of C2K specific setting. setSuplHostPort(properties.getProperty("SUPL_HOST"), @@ -603,7 +603,7 @@ public class GnssLocationProvider implements LocationProviderInterface { ByteArrayOutputStream baos = new ByteArrayOutputStream(4096); properties.store(baos, null); native_configuration_update(baos.toString()); - Log.d(TAG, "final config = " + baos.toString()); + if (DEBUG) Log.d(TAG, "final config = " + baos.toString()); } catch (IOException ex) { Log.e(TAG, "failed to dump properties contents"); } @@ -628,7 +628,7 @@ public class GnssLocationProvider implements LocationProviderInterface { String[] configValues = context.getResources().getStringArray( com.android.internal.R.array.config_gpsParameters); for (String item : configValues) { - Log.d(TAG, "GpsParamsResource: " + item); + if (DEBUG) Log.d(TAG, "GpsParamsResource: " + item); // We need to support "KEY =", but not "=VALUE". String[] split = item.split("="); if (split.length == 2) { @@ -917,11 +917,13 @@ public class GnssLocationProvider implements LocationProviderInterface { long certainty = mNtpTime.getCacheCertainty(); long now = System.currentTimeMillis(); - Log.d(TAG, "NTP server returned: " - + time + " (" + new Date(time) - + ") reference: " + timeReference - + " certainty: " + certainty - + " system time offset: " + (time - now)); + if (DEBUG) { + Log.d(TAG, "NTP server returned: " + + time + " (" + new Date(time) + + ") reference: " + timeReference + + " certainty: " + certainty + + " system time offset: " + (time - now)); + } native_inject_time(time, timeReference, (int) certainty); delay = NTP_INTERVAL; @@ -1633,7 +1635,7 @@ public class GnssLocationProvider implements LocationProviderInterface { if (DEBUG) Log.d(TAG, "GPS_AGPS_DATA_CONN_FAILED"); break; default: - Log.d(TAG, "Received Unknown AGPS status: " + status); + if (DEBUG) Log.d(TAG, "Received Unknown AGPS status: " + status); } } -- 2.11.0