Skip to content

Commit

Permalink
wip - replace existing file management code to support Android 13
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyrat committed Aug 31, 2023
1 parent 31672ad commit 8a411eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
<!-- implicitly READ too. Used for file import / export, attachment export, etc. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<!-- TODO rewrite and try to remove the need for this before Android 13 release -->
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

<!-- TOTP QR scanning -->
<uses-permission android:name="android.permission.CAMERA" />

Expand Down
6 changes: 4 additions & 2 deletions lib/widgets/import_export.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ class _ImportExportWidgetState extends State<ImportExportWidget> {
final vaultCubit = BlocProvider.of<VaultCubit>(context);
final permissionResult = await tryToGetPermission(
context,
Permission.storage,
//TODO: replace existing file management code to support Android 13
Permission.manageExternalStorage,
//Permission.storage,
'Storage',
str.import.toLowerCase(),
str.cancelExportOrImport(str.import.toLowerCase()),
Expand All @@ -256,7 +258,7 @@ class _ImportExportWidgetState extends State<ImportExportWidget> {
type: FileType.any,
withData: true,
);
final cleanupFuture = FilePicker.platform.clearTemporaryFiles(); //TODO:f: concurrently with below
final cleanupFuture = FilePicker.platform.clearTemporaryFiles();

final bytes = result?.files.firstOrNull?.bytes;
if (bytes == null) {
Expand Down

0 comments on commit 8a411eb

Please sign in to comment.