Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b72d1efd authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

CameraDevice: Make sure log tags are within length bounds.

Change-Id: I93c4670c1ee0b0be5956b0ed8cd0f53873257f7c
parent 47ffde25
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -157,7 +157,14 @@ public class CameraDevice implements android.hardware.camera2.CameraDevice {
        mCameraId = cameraId;
        mDeviceListener = listener;
        mDeviceHandler = handler;
        TAG = String.format("CameraDevice-%s-JV", mCameraId);

        final int MAX_TAG_LEN = 23;
        String tag = String.format("CameraDevice-JV-%s", mCameraId);
        if (tag.length() > MAX_TAG_LEN) {
            tag = tag.substring(0, MAX_TAG_LEN);
        }
        TAG = tag;

        DEBUG = Log.isLoggable(TAG, Log.DEBUG);
    }