最近在做录制视频功能,在找一些资料时发现 要判断是否支持闪关灯,在这记录下来,怕以后忘记
public static boolean isSupportCameraLedFlash(PackageManager pm) {
if (pm != null) {
FeatureInfo[] features = pm.getSystemAvailableFeatures();
if (features != null) {
for (FeatureInfo f : features) {
if (f != null && PackageManager.FEATURE_CAMERA_FLASH.equals(f.name))
return true;
}
}
}
return false;
}