add isLoggable check to overly verbose PrefCtrlListHelper log statement

Signed-off-by: Dmitrii <bankersenator@gmail.com>
This commit is contained in:
Dmitry Muhomor
2024-11-15 08:18:09 +02:00
committed by Joey
parent 03c1db305c
commit 0637cdfea4

View File

@@ -74,7 +74,9 @@ public class PreferenceControllerListHelper {
try { try {
controller = BasePreferenceController.createInstance(context, controllerName); controller = BasePreferenceController.createInstance(context, controllerName);
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
Log.d(TAG, "Could not find Context-only controller for pref: " + controllerName); if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Could not find Context-only controller for pref: " + controllerName);
}
final String key = metadata.getString(METADATA_KEY); final String key = metadata.getString(METADATA_KEY);
final boolean isWorkProfile = metadata.getBoolean(METADATA_FOR_WORK, false); final boolean isWorkProfile = metadata.getBoolean(METADATA_FOR_WORK, false);
if (TextUtils.isEmpty(key)) { if (TextUtils.isEmpty(key)) {