mirror of
https://github.com/ente-io/ente.git
synced 2025-08-13 17:57:31 +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) {
|
if (Platform.isAndroid) {
|
||||||
final bool hasPermission = await Permission.accessMediaLocation.isGranted;
|
final bool hasPermission = await Permission.accessMediaLocation.isGranted;
|
||||||
if (!hasPermission) {
|
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