Skip to content

Commit 0e87370

Browse files
author
Daniel Lehmann
committed
Remove the country detector logging
Bug:6156714 Change-Id: Id0ff60b0530142e2bce055ee8cf8dde94e974aa5
1 parent f4ae6aa commit 0e87370

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

services/java/com/android/server/CountryDetectorService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ public ICountryListener getListener() {
8181

8282
private final static String TAG = "CountryDetector";
8383

84+
/** Whether to dump the state of the country detector service to bugreports */
85+
private static final boolean DEBUG = false;
86+
8487
private final HashMap<IBinder, Receiver> mReceivers;
8588
private final Context mContext;
8689
private ComprehensiveCountryDetector mCountryDetector;
@@ -206,8 +209,10 @@ boolean isSystemReady() {
206209
return mSystemReady;
207210
}
208211

212+
@SuppressWarnings("unused")
209213
@Override
210214
protected void dump(FileDescriptor fd, PrintWriter fout, String[] args) {
215+
if (!DEBUG) return;
211216
try {
212217
final Printer p = new PrintWriterPrinter(fout);
213218
p.println("CountryDetectorService state:");

services/java/com/android/server/location/ComprehensiveCountryDetector.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private void addToLogs(Country country) {
202202
if (mDebugLogs.size() >= MAX_LENGTH_DEBUG_LOGS) {
203203
mDebugLogs.poll();
204204
}
205-
if (Log.isLoggable(TAG, Log.DEBUG)) {
205+
if (DEBUG) {
206206
Slog.d(TAG, country.toString());
207207
}
208208
mDebugLogs.add(country);
@@ -394,7 +394,7 @@ protected boolean isAirplaneModeOff() {
394394
private void notifyIfCountryChanged(final Country country, final Country detectedCountry) {
395395
if (detectedCountry != null && mListener != null
396396
&& (country == null || !country.equals(detectedCountry))) {
397-
if (Log.isLoggable(TAG, Log.DEBUG)) {
397+
if (DEBUG) {
398398
Slog.d(TAG, "" + country + " --> " + detectedCountry);
399399
}
400400
notifyListener(detectedCountry);

0 commit comments

Comments
 (0)