Skip to content

Commit

Permalink
#108: Zip-file export/backup: Started BackupActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
k3b committed Dec 16, 2018
1 parent 76e02fb commit 162278e
Show file tree
Hide file tree
Showing 15 changed files with 485 additions and 600 deletions.
8 changes: 5 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?><!--
/*
* Copyright (c) 2015-2018 by k3b.
* Copyright (c) 2015-2019 by k3b.
*
* This file is part of AndroFotoFinder.
*
Expand Down Expand Up @@ -60,8 +60,10 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

<!-- after app crash the logcat is written to /mnt/sdcard/copy/log/androFotofinder.logcat*.txt -->
<uses-permission android:name="android.permission.READ_LOGS" />
<!-- after app crash the logcat is written to /mnt/sdcard/copy/log/androFotofinder.logcat*.txt
on old android versions this allows to read logcat -->
<uses-permission android:name="android.permission.READ_LOGS"
tools:ignore="ProtectedPermissions" />

<!--
permissions inherited from a lib that the app does not need.
Expand Down
26 changes: 25 additions & 1 deletion app/src/main/java/de/k3b/android/androFotoFinder/AffUtils.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 by k3b.
* Copyright (c) 2018-2019 by k3b.
*
* This file is part of AndroFotoFinder.
*
Expand All @@ -25,6 +25,7 @@
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;

import de.k3b.android.androFotoFinder.queries.FotoSql;
import de.k3b.io.collections.SelectedFiles;
Expand Down Expand Up @@ -68,6 +69,18 @@ public static SelectedFiles getSelectedFiles(Bundle data) {
}
return null;
}
public static SelectedFiles getSelectedFiles(Properties data) {
if (data != null) {
String selectedIDs = data.getProperty(EXTRA_SELECTED_ITEM_IDS);
String selectedFiles = data.getProperty(EXTRA_SELECTED_ITEM_PATHS);
String selectedDates = data.getProperty(EXTRA_SELECTED_ITEM_DATES);

if ((selectedIDs != null) && (selectedFiles != null)) {
return SelectedFiles.create(selectedFiles, selectedIDs, selectedDates);
}
}
return null;
}

public static boolean putSelectedFiles(Intent destination, SelectedFiles selectedFiles) {
if ((destination != null) && (selectedFiles != null) && (selectedFiles.size() > 0)) {
Expand All @@ -91,6 +104,17 @@ public static boolean putSelectedFiles(Bundle destination, SelectedFiles selecte
return false;
}

public static boolean putSelectedFiles(Properties destination, SelectedFiles selectedFiles) {
if ((destination != null) && (selectedFiles != null) && (selectedFiles.size() > 0)) {
destination.put(EXTRA_SELECTED_ITEM_IDS, selectedFiles.toIdString());
destination.put(EXTRA_SELECTED_ITEM_PATHS, selectedFiles.toString());
final String dateString = selectedFiles.toDateString();
if (dateString != null) destination.put(EXTRA_SELECTED_ITEM_DATES, dateString);
return true;
}
return false;
}

/** converts internal ID-list to string array of filenNames via media database. */
public static SelectedFiles querySelectedFiles(Context context, SelectedItems items) {
if ((items != null) && (items.size() > 0)) {
Expand Down
Loading

0 comments on commit 162278e

Please sign in to comment.