I think this function means that device is connected by USB cable and that device is configured for debugging( debug mode is set on the device).
Java Compiler on Android Studio reports that 'Debug' is undefined. What is the import package?
Try
import android.os.Debug;
https://developer.android.com/reference/android/os/Debug#isDebuggerConnected()