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

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值