Android P中前摄预览界面点击缩略图瞬间,左上角区域会闪现 闪光灯图标

这个问题主要是在前置相机的状态下,点击缩略图进入图库的瞬间或者点击退出的瞬间出现闪光灯的图标出现,解决办法如下:

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 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
                        }
                    }
                }
            });
        }
    }

在前置的状态下不让其显示这个闪光灯的图标,此问题也就解决了。

你可能感兴趣的:(日记)