mirror of
https://github.com/ente-io/ente.git
synced 2025-08-14 02:07:33 +00:00
[mob][photos] Request for ACCESS_MEDIA_LOCATION permission if not granted
This commit is contained in:
@@ -376,7 +376,13 @@ class FileUploader {
|
||||
if (Platform.isAndroid) {
|
||||
final bool hasPermission = await Permission.accessMediaLocation.isGranted;
|
||||
if (!hasPermission) {
|
||||
throw NoMediaLocationAccessError();
|
||||
final permissionStatus = await Permission.accessMediaLocation.request();
|
||||
if (!permissionStatus.isGranted) {
|
||||
_logger.severe(
|
||||
"Media location access denied with permission status: ${permissionStatus.name}",
|
||||
);
|
||||
throw NoMediaLocationAccessError();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user