【问题标题】:Enable Device's Camera App in Android Management API Policy在 Android Management API Policy 中启用设备的相机应用
【发布时间】:2020-03-01 12:20:01
【问题描述】:

我的应用使用以下方式调用设备的相机应用:

Intent pictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);


    if (pictureIntent.resolveActivity(getPackageManager()) != null) {

        File file = null;
        try {
            file = createImageFile();
            Log.d(TAG, "created imagefile ");
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
        Uri photoUri = FileProvider.getUriForFile(this, getPackageName() + ".provider", file);
        Log.d(TAG, "openCamera: " + photoUri);
        pictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoUri);


        startActivityForResult(pictureIntent, MY_PERMISSIONS_REQUEST_CAMERA);
    }

在配置的设备中使用“cameraDisabled”应用程序时:false 我仍然无法加载相机。

我的政策是:

{ “应用程序”:[{ “包裹名字”: ”**************”, "installType": "FORCE_INSTALLED", “defaultPermissionPolicy”:“GRANT” }], “debuggingFeaturesAllowed”:真, “addUserDisabled”:是的, “adjustVolumeDisabled”:真, “outgoingCallsDisabled”:是的, "locationMode": "HIGH_ACCURACY", “cameraDisabled”:假, “screenCaptureDisabled”:是的, "defaultPermissionPolicy": "GRANT", “wifiConfigDisabled”:假, “数据漫游禁用”:假, “smsDisabled”:是的, “factoryResetDisabled”:假, “uninstallAppsDisabled”:是的, “tetheringConfigDisabled”:是的, “shareLocationDisabled”:假, “funDisabled”:是的, "appAutoUpdatePolicy": "WIFI_ONLY", “系统更新”: { “类型”:“窗口”, “开始分钟”:10, “结束分钟”:1430 }, "kioskCustomLauncherEnabled":true, "kioskCustomization": { "deviceSettings": "SETTINGS_ACCESS_ALLOWED" } }

更新: 我最终改用 CameraX 库来创建自己的相机。

【问题讨论】:

    标签: android-management-api


    【解决方案1】:

    您可能在注册二维码期间禁用了系统应用程序。

    现在,对于您的问题,您必须找到设备的default camera app 中的package name,然后在策略中启用它。

    例如,Snapdragon 摄像头是我的 Zebra 设备上的默认设置:

      "applications": [
        {
          "packageName": "org.codeaurora.snapcam",
          "installType": "FORCE_INSTALLED"
        }
      ]
    }
    

    我知道每个设备品牌的相机应用都会有所不同,但在禁用系统应用的情况下,这是我一直在使用的方式。

    【讨论】:

    • 谢谢。我会试试的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-28
    • 2022-06-10
    • 1970-01-01
    • 2019-11-06
    • 2019-03-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多