Add final modifier to private static DEBUG constants
Marking final allows the gated debug code (generally logging) to be stripped from production builds. This saves ~20KB from system server. Follow-up work will explore presubmit guards for similar DEBUG cases (including guarding against DEBUG = true). Bug: 203143243 Test: m Change-Id: Ic87a8d8bf183ac0b36c790a2f4a4661ae5e1a87f
This commit is contained in:
@@ -43,7 +43,7 @@ import java.util.List;
|
||||
*/
|
||||
abstract class BaseMediaParceledListSlice<T> implements Parcelable {
|
||||
private static String TAG = "BaseMediaParceledListSlice";
|
||||
private static boolean DEBUG = false;
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
/*
|
||||
* TODO get this number from somewhere else. For now set it to a quarter of
|
||||
|
||||
@@ -108,7 +108,7 @@ import java.util.concurrent.TimeUnit;
|
||||
@SystemService(Context.WALLPAPER_SERVICE)
|
||||
public class WallpaperManager {
|
||||
private static String TAG = "WallpaperManager";
|
||||
private static boolean DEBUG = false;
|
||||
private static final boolean DEBUG = false;
|
||||
private float mWallpaperXStep = -1;
|
||||
private float mWallpaperYStep = -1;
|
||||
private static final @NonNull RectF LOCAL_COLOR_BOUNDS =
|
||||
|
||||
@@ -49,7 +49,7 @@ import dagger.Lazy;
|
||||
|
||||
public class KeyguardDisplayManager {
|
||||
protected static final String TAG = "KeyguardDisplayManager";
|
||||
private static boolean DEBUG = KeyguardConstants.DEBUG;
|
||||
private static final boolean DEBUG = KeyguardConstants.DEBUG;
|
||||
|
||||
private MediaRouter mMediaRouter = null;
|
||||
private final DisplayManager mDisplayService;
|
||||
|
||||
@@ -147,7 +147,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
|
||||
OnCrossProfileWidgetProvidersChangeListener {
|
||||
private static final String TAG = "AppWidgetServiceImpl";
|
||||
|
||||
private static boolean DEBUG = false;
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final String OLD_KEYGUARD_HOST_PACKAGE = "android";
|
||||
private static final String NEW_KEYGUARD_HOST_PACKAGE = "com.android.keyguard";
|
||||
|
||||
@@ -48,7 +48,7 @@ import java.io.PrintWriter;
|
||||
final class DisplayPowerState {
|
||||
private static final String TAG = "DisplayPowerState";
|
||||
|
||||
private static boolean DEBUG = false;
|
||||
private static final boolean DEBUG = false;
|
||||
private static String COUNTER_COLOR_FADE = "ColorFadeLevel";
|
||||
|
||||
private final Handler mHandler;
|
||||
|
||||
@@ -40,7 +40,7 @@ import java.util.Set;
|
||||
* Monitors the state changes of audio players.
|
||||
*/
|
||||
class AudioPlayerStateMonitor {
|
||||
private static boolean DEBUG = MediaSessionService.DEBUG;
|
||||
private static final boolean DEBUG = MediaSessionService.DEBUG;
|
||||
private static String TAG = "AudioPlayerStateMonitor";
|
||||
|
||||
private static AudioPlayerStateMonitor sInstance;
|
||||
|
||||
@@ -86,6 +86,9 @@ public final class TextClassificationManagerService extends ITextClassifierServi
|
||||
|
||||
private static final String LOG_TAG = "TextClassificationManagerService";
|
||||
|
||||
// TODO: consider using device config to control it.
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
private static final ITextClassifierCallback NO_OP_CALLBACK = new ITextClassifierCallback() {
|
||||
@Override
|
||||
public void onSuccess(Bundle result) {}
|
||||
@@ -175,8 +178,6 @@ public final class TextClassificationManagerService extends ITextClassifierServi
|
||||
private final String mDefaultTextClassifierPackage;
|
||||
@Nullable
|
||||
private final String mSystemTextClassifierPackage;
|
||||
// TODO: consider using device config to control it.
|
||||
private boolean DEBUG = false;
|
||||
|
||||
private TextClassificationManagerService(Context context) {
|
||||
mContext = Objects.requireNonNull(context);
|
||||
|
||||
Reference in New Issue
Block a user