Merge branch 'main' into develop
This commit is contained in:
commit
c42ca981e3
@ -39,7 +39,7 @@ allprojects {
|
||||
ext {
|
||||
androidApplicationId = 'org.cryptomator'
|
||||
androidVersionCode = getVersionCode()
|
||||
androidVersionName = '1.6.0-SNAPSHOT'
|
||||
androidVersionName = '1.6.0'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
@ -120,17 +120,6 @@ class CryptomatorApp : MultiDexApplication(), HasComponent<ApplicationComponent>
|
||||
}, BIND_AUTO_CREATE)
|
||||
}
|
||||
|
||||
fun startAutoUpload() {
|
||||
val sharedPreferencesHandler = SharedPreferencesHandler(applicationContext())
|
||||
if(sharedPreferencesHandler.usePhotoUpload()) {
|
||||
val vault = applicationComponent.vaultRepository().load(sharedPreferencesHandler.photoUploadVault())
|
||||
if(vault.isUnlocked) {
|
||||
val cloud = applicationComponent.cloudRepository().decryptedViewOf(vault)
|
||||
applicationContext().startService(AutoUploadService.startAutoUploadIntent(applicationContext(), cloud))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupLogging() {
|
||||
setupLoggingFramework()
|
||||
setup()
|
||||
|
@ -212,7 +212,7 @@ public class AutoUploadService extends Service {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
Timber.tag("AutoUploadService").d("created");
|
||||
notification = new AutoUploadNotification(this, 0);
|
||||
notification = new AutoUploadNotification(this, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -13,7 +13,6 @@ import android.net.Uri
|
||||
import android.os.Handler
|
||||
import android.provider.MediaStore
|
||||
import org.cryptomator.domain.exception.FatalBackendException
|
||||
import org.cryptomator.presentation.CryptomatorApp
|
||||
import org.cryptomator.presentation.R
|
||||
import org.cryptomator.presentation.util.FileUtil
|
||||
import org.cryptomator.presentation.util.ResourceHelper
|
||||
@ -39,8 +38,6 @@ class PhotoContentJob : JobService() {
|
||||
|
||||
runningParams = params
|
||||
|
||||
var filesCaptured = false
|
||||
|
||||
params.triggeredContentAuthorities?.let {
|
||||
if (params.triggeredContentUris != null) {
|
||||
val ids = getIds(params)
|
||||
@ -52,8 +49,6 @@ class PhotoContentJob : JobService() {
|
||||
fileUtil.addImageToAutoUploads(dir)
|
||||
Timber.tag("PhotoContentJob").i("Added file to UploadList")
|
||||
Timber.tag("PhotoContentJob").d(String.format("Added file to UploadList %s", dir))
|
||||
|
||||
filesCaptured = true
|
||||
} catch (e: FatalBackendException) {
|
||||
Timber.tag("PhotoContentJob").e(e, "Failed to add image to auto upload list")
|
||||
} catch (e: SecurityException) {
|
||||
@ -70,10 +65,6 @@ class PhotoContentJob : JobService() {
|
||||
}
|
||||
} ?: Timber.tag("PhotoContentJob").w("No photos content")
|
||||
|
||||
if(filesCaptured && SharedPreferencesHandler(applicationContext).usePhotoUploadInstant()) {
|
||||
(application as CryptomatorApp).startAutoUpload()
|
||||
}
|
||||
|
||||
handler.post(worker)
|
||||
return false
|
||||
}
|
||||
|
@ -244,8 +244,6 @@
|
||||
<string name="screen_settings_section_auto_photo_upload_vault">Choose vault for upload</string>
|
||||
<string name="screen_settings_section_auto_photo_upload_toggle">Activate</string>
|
||||
<string name="screen_settings_section_auto_photo_upload_toggle_summary">Capture images in the background and once the selected vault is unlocked, start upload</string>
|
||||
<string name="screen_settings_section_auto_photo_upload_toggle_instant_upload">Upload instant</string>
|
||||
<string name="screen_settings_section_auto_photo_upload_toggle_instant_upload_summary">Upload directly if the vault is unlocked</string>
|
||||
<string name="screen_settings_section_auto_photo_upload_only_wifi_toggle">Upload only using WIFI</string>
|
||||
<string name="screen_settings_section_auto_photo_upload_including_videos">Upload videos</string>
|
||||
|
||||
|
@ -105,12 +105,6 @@
|
||||
android:summary="@string/screen_settings_section_auto_photo_upload_toggle_summary"
|
||||
android:title="@string/screen_settings_section_auto_photo_upload_toggle" />
|
||||
|
||||
<androidx.preference.SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="photoUploadInstant"
|
||||
android:summary="@string/screen_settings_section_auto_photo_upload_toggle_instant_upload_summary"
|
||||
android:title="@string/screen_settings_section_auto_photo_upload_toggle_instant_upload" />
|
||||
|
||||
<androidx.preference.SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="photoUploadOnlyUsingWifi"
|
||||
|
@ -129,18 +129,14 @@ constructor(context: Context) : SharedPreferences.OnSharedPreferenceChangeListen
|
||||
defaultSharedPreferences.clear()
|
||||
}
|
||||
|
||||
fun usePhotoUpload(): Boolean {
|
||||
return defaultSharedPreferences.getValue(PHOTO_UPLOAD, false)
|
||||
}
|
||||
|
||||
fun usePhotoUploadInstant(): Boolean {
|
||||
return defaultSharedPreferences.getValue(PHOTO_UPLOAD_INSTANT, true)
|
||||
}
|
||||
|
||||
fun autoPhotoUploadOnlyUsingWifi(): Boolean {
|
||||
return defaultSharedPreferences.getValue(PHOTO_UPLOAD_ONLY_USING_WIFI)
|
||||
}
|
||||
|
||||
fun usePhotoUpload(): Boolean {
|
||||
return defaultSharedPreferences.getValue(PHOTO_UPLOAD, false)
|
||||
}
|
||||
|
||||
fun photoUploadVault(): Long {
|
||||
return defaultSharedPreferences.getValue(PHOTO_UPLOAD_VAULT, 0)
|
||||
}
|
||||
@ -253,7 +249,6 @@ constructor(context: Context) : SharedPreferences.OnSharedPreferenceChangeListen
|
||||
const val SECURE_SCREEN = "secureScreen"
|
||||
const val SCREEN_STYLE_MODE = "screenStyleMode"
|
||||
const val PHOTO_UPLOAD = "photoUpload"
|
||||
const val PHOTO_UPLOAD_INSTANT = "photoUploadInstant"
|
||||
const val PHOTO_UPLOAD_ONLY_USING_WIFI = "photoUploadOnlyUsingWifi"
|
||||
const val PHOTO_UPLOAD_VAULT = "photoUploadVault"
|
||||
const val PHOTO_UPLOAD_FOLDER = "photoUploadFolder"
|
||||
|
Loading…
x
Reference in New Issue
Block a user