Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/image_picker/android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
package="io.flutter.plugins.imagepicker">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA"/>

<application>
<provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ public class ImagePickerDelegate
@VisibleForTesting static final int REQUEST_CODE_CHOOSE_IMAGE_FROM_GALLERY = 2342;
@VisibleForTesting static final int REQUEST_CODE_TAKE_IMAGE_WITH_CAMERA = 2343;
@VisibleForTesting static final int REQUEST_EXTERNAL_IMAGE_STORAGE_PERMISSION = 2344;
@VisibleForTesting static final int REQUEST_CAMERA_IMAGE_PERMISSION = 2345;
@VisibleForTesting static final int REQUEST_CODE_CHOOSE_VIDEO_FROM_GALLERY = 2352;
@VisibleForTesting static final int REQUEST_CODE_TAKE_VIDEO_WITH_CAMERA = 2353;
@VisibleForTesting static final int REQUEST_EXTERNAL_VIDEO_STORAGE_PERMISSION = 2354;
@VisibleForTesting static final int REQUEST_CAMERA_VIDEO_PERMISSION = 2355;

@VisibleForTesting final String fileProviderName;

Expand Down Expand Up @@ -212,12 +210,6 @@ public void takeVideoWithCamera(MethodCall methodCall, MethodChannel.Result resu
return;
}

if (!permissionManager.isPermissionGranted(Manifest.permission.CAMERA)) {
permissionManager.askForPermission(
Manifest.permission.CAMERA, REQUEST_CAMERA_VIDEO_PERMISSION);
return;
}

launchTakeVideoWithCameraIntent();
}

Expand Down Expand Up @@ -268,12 +260,6 @@ public void takeImageWithCamera(MethodCall methodCall, MethodChannel.Result resu
return;
}

if (!permissionManager.isPermissionGranted(Manifest.permission.CAMERA)) {
permissionManager.askForPermission(
Manifest.permission.CAMERA, REQUEST_CAMERA_IMAGE_PERMISSION);
return;
}

launchTakeImageWithCameraIntent();
}

Expand Down Expand Up @@ -347,16 +333,6 @@ public boolean onRequestPermissionsResult(
launchPickVideoFromGalleryIntent();
}
break;
case REQUEST_CAMERA_IMAGE_PERMISSION:
if (permissionGranted) {
launchTakeImageWithCameraIntent();
}
break;
case REQUEST_CAMERA_VIDEO_PERMISSION:
if (permissionGranted) {
launchTakeVideoWithCameraIntent();
}
break;
default:
return false;
}
Expand Down