关于获取 android system feature 失败问题

来源:互联网 发布:顶尖数据恢复软件官方 编辑:程序博客网 时间:2024/06/12 18:07

做一了个Torch 小应用,在采用如下方式判断系统是否支持闪光灯时返回false。

hasFlash = getApplicationContext().getPackageManager()

.hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH);


系统中的permission 和 feature 定义在工程如下文件:

1. /mediatek/config/you project name/*.xml

2./ frameworks/base/data/etc


目标机支持的xml 文件可通过如下方式查看:

1. adb shell ls system/etc/permissions

2. out/target/product/ckt75_cu_ics/system/etc/permissions


原因:不知道哪位高手去掉了相应的android.hardware.camera.flash 声名,希望不是MTK,哈哈。

解决方法,在相关的xml 中添加如下内容<feature name="android.hardware.camera.flash" />

原创粉丝点击