summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Felipe Leme <felipeal@google.com> 2025-02-14 12:58:59 -0800
committer Felipe Leme <felipeal@google.com> 2025-02-14 13:09:53 -0800
commit263782613783b06cc7807aa5ee5aeef348782ed0 (patch)
tree07481e8895b1e70e0017ddb4bb13695a38561786
parent8f647896aaacbd34fc313daa6f9d8a2a7f1b5cb0 (diff)
Make LocalTransport.DEBUG dynamic.
There's a general recommendation to make such static fields as FALSE on framework code so they're removed by the compiler and don't take space in memory, but LocalTransport is a "debug artifact", so that memory increase is not a problem and the increase in APK size is negligible, hence it's more flexible for developers to be able to turned it on dynamically. Test: adb shell setprop log.tag.LocalTransport VERBOSE && adb logcat LocalTransport:v *:s Bug: 394173116 Flag: EXEMPT changes on debugging components only Change-Id: I11d239f9b2a70de8f94ff7f9f6df0be79fc69d42
-rw-r--r--packages/LocalTransport/src/com/android/localtransport/LocalTransport.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/LocalTransport/src/com/android/localtransport/LocalTransport.java b/packages/LocalTransport/src/com/android/localtransport/LocalTransport.java
index 79c9de49ea4c..5590ca725327 100644
--- a/packages/LocalTransport/src/com/android/localtransport/LocalTransport.java
+++ b/packages/LocalTransport/src/com/android/localtransport/LocalTransport.java
@@ -70,7 +70,7 @@ import java.util.List;
public class LocalTransport extends BackupTransport {
static final String TAG = "LocalTransport";
- static final boolean DEBUG = false;
+ static final boolean DEBUG = Log.isLoggable(TAG, Log.VERBOSE);
private static final String TRANSPORT_DIR_NAME
= "com.android.localtransport.LocalTransport";
@@ -131,7 +131,8 @@ public class LocalTransport extends BackupTransport {
}
public LocalTransport(Context context, LocalTransportParameters parameters) {
- Log.i(TAG, "Creating LocalTransport for user " + context.getUserId());
+ Log.i(TAG, "Creating LocalTransport for user " + context.getUserId()
+ + " (DEBUG=" + DEBUG + ")");
mContext = context;
mParameters = parameters;
makeDataDirs();