I don't think it is possible that the app can determine if a device has a 3.5 mm audio jack.
From: https://source.android.com/devices/audio/usb#hostApplications
the line:
There are no APIs specific to USB digital audio.
Doesn't give me much hope especially as in that same document earlier mentions when talking about TRS Mini (audio jack) and USB Audio:
Note: This is an artificial comparison, since a real Android device would probably have both options available.
Which may have been true when the document was first written but as you've noted now less guaranteed.
A scan of the Android Compatibility Definition Document shows in Android CDD Section 7.8.2 Audio that no distinction is made between a 3.5mm audio jack and USB audio connection.
One suggestion is to submit a feature request to the Android Issue Tracker with as detailed use case as to why the legacy headphone jack should be a feature flag.