这个问题主要是在前置相机的状态下,点击缩略图进入图库的瞬间或者点击退出的瞬间出现闪光灯的图标出现,解决办法如下:
vendor/mediatek/proprietary/packages/apps/Camera2/feature/setting/flash/src/com/mediatek/camera/feature/setting/flash/Flash.java
@Override
public void overrideValues(@Nonnull String headerKey, String currentValue,
List<String> supportValues) {
LogHelper.d(TAG, "[overrideValues] headerKey = " + headerKey
+ " ,currentValue = " + currentValue + ",supportValues = " + supportValues);
if (headerKey.equals("key_scene_mode") && mSettingController.queryValue("key_scene_mode")
.equals("hdr")) {
return;
}
String lastValue = getValue();
if (headerKey.equals("key_hdr") && currentValue != null && (currentValue != lastValue)) {
onFlashValueChanged(currentValue);
}
if (!headerKey.equals("key_hdr")) {
super.overrideValues(headerKey, currentValue, supportValues);
if (!lastValue.equals(getValue())) {
Relation relation = FlashRestriction.getFlashRestriction()
.getRelation(getValue(), true);
mSettingController.postRestriction(relation);
}
mActivity.runOnUiThread(new Runnable() {
public void run() {
if (supportValues != null) {
mFlashViewController.showQuickSwitchIcon(supportValues.size() > 1);
} else {
if (isFlashSupportedInCurrentMode()) {
//add by cy 20190708
int cameraId = Integer.parseInt(mSettingController.getCameraId());
if(cameraId == 0){
mFlashViewController.showQuickSwitchIcon(true);
}else{
mFlashViewController.showQuickSwitchIcon(false);
}
//end by cy 20190708
}
}
}
});
}
}
在前置的状态下不让其显示这个闪光灯的图标,此问题也就解决了。