【发布时间】: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 库来创建自己的相机。
【问题讨论】: