Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite auto upload #615

Merged
merged 138 commits into from
Mar 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
b5a2adf
Introduce rewritten auto upload
mario Feb 2, 2017
4151767
Revert a typo
mario Feb 2, 2017
699ca26
Update a comment
mario Feb 2, 2017
13b864a
Enable menu item on 5.0
mario Feb 2, 2017
e4f483c
Silence codacy
mario Feb 3, 2017
8051c67
Remove strange <p> stuff
mario Feb 3, 2017
07981f0
Update copyrights
mario Feb 3, 2017
1973705
Small bugfix
mario Feb 4, 2017
4e90222
Fix a bug with SyncedFolderProvider
mario Feb 4, 2017
7806ff2
Ignore temporary files
mario Feb 4, 2017
9e44de9
First step towards list persistance
mario Feb 5, 2017
a24d14f
Preparation for persistance
mario Feb 5, 2017
8a978a2
Move to approach without reflection
mario Feb 5, 2017
2c92eaf
Add persistence layer on service start
mario Feb 5, 2017
0b9187d
Progress on implementing persistance
mario Feb 5, 2017
37f31c5
Fix a typo with tmp files
mario Feb 5, 2017
6aba87e
Magical magical stuff
mario Feb 5, 2017
fe4c44a
Remove useless conditions
mario Feb 5, 2017
f5f115e
Revert "Remove useless conditions"
mario Feb 5, 2017
c94f782
Fix a bug
mario Feb 5, 2017
eeb72d1
Create new file
mario Feb 5, 2017
5dcdcaf
Fix a serialization bug
mario Feb 5, 2017
c1f896a
Use different models
mario Feb 6, 2017
deb35e5
Revert "Use different models"
mario Feb 6, 2017
e996a3d
Fix persistance
mario Feb 6, 2017
6266be2
Optimize imports
mario Feb 6, 2017
3fdd90c
Attempt to fix HDR issues
mario Feb 6, 2017
cca154a
Fix to aid in HDR stuff processing
mario Feb 6, 2017
0fb06da
Some progress on auto-upload fixes
mario Feb 6, 2017
c8785b7
Partial revert "Some progress on auto-upload fixes"
mario Feb 6, 2017
0c8beeb
Re-arrange things a bit
mario Feb 6, 2017
df50766
Fix a strange issue
mario Feb 6, 2017
172432d
Properly separate auto upload settings by acc
mario Feb 6, 2017
52d3671
Show upload for current account only
mario Feb 6, 2017
b78051c
Fix a typo
mario Feb 6, 2017
2be9cec
Some progress on mitigating persistance issues
mario Feb 6, 2017
54545a9
Progress on fixing persistance disk sync
mario Feb 6, 2017
2a3e38d
Fix a crashing bug
mario Feb 7, 2017
1e90535
Change to onStop
mario Feb 7, 2017
697b05f
Hopefully fix double upload issue
mario Feb 7, 2017
f2d508a
Fix legacy sync folder entries
mario Feb 7, 2017
6ea9d1e
Fix build
mario Feb 7, 2017
123e812
Fix cleanup
mario Feb 7, 2017
3b143a9
Delete from runnable on delete
mario Feb 7, 2017
fbdcfce
Attempt to fix uploads with non-conf folders
mario Feb 8, 2017
7f28c35
:)
mario Feb 8, 2017
4068eb5
Attempt to fix duplicate entries
mario Feb 8, 2017
ee0c112
Increase delay slightly
mario Feb 8, 2017
2015851
Attempt to fix duplicate uploads again :P
mario Feb 10, 2017
050fb09
Backup everything
mario Feb 10, 2017
d1dc7b0
Clean up cleaning
mario Feb 12, 2017
15101bf
Simplify new auto upload code
mario Feb 13, 2017
5e4ad8a
user last modification date for auto upload, e.g. take an image on 31…
tobiasKaminsky Feb 13, 2017
284eba8
New build
mario Feb 13, 2017
8a56201
Small workaround
mario Feb 13, 2017
9fcda73
Attempt a fix
mario Feb 13, 2017
79fb4e8
Use exif tags
mario Feb 13, 2017
623a483
Simplify code
mario Feb 14, 2017
bd9a12a
Persistent upload magic
mario Feb 14, 2017
172da07
Change content text for notification
mario Feb 14, 2017
a568b5d
Remove permanent marker
mario Feb 14, 2017
0ee60c5
Update for codacy warnings
mario Feb 15, 2017
5c3cd5f
Remove content text
mario Feb 15, 2017
91c28ee
Enable auto upload on Android 6+ only :-/
mario Feb 15, 2017
ead3c16
Try to fix Tobias crash
mario Feb 15, 2017
16da980
Update stuff for review
mario Feb 16, 2017
1374320
Don’t add observer if it fails to init
mario Feb 18, 2017
c867b54
Update codacy
mario Feb 18, 2017
4ef5bc8
Wait on shutdown
mario Feb 19, 2017
2d584ad
Fix path for files
mario Feb 20, 2017
7daf7a1
Clean up iterator
mario Feb 20, 2017
6d98473
Revert things to how they were
mario Feb 20, 2017
6032548
Some magics
mario Feb 20, 2017
ebeb520
Fix a tiny bug
mario Feb 20, 2017
a333ead
Remove serializable pair
mario Feb 21, 2017
048b7f7
Use android-job for scheduling
mario Feb 21, 2017
c486b81
Fix a typo
mario Feb 21, 2017
9831918
Fix codacy stuff
mario Feb 21, 2017
38234af
Remove from monitor before destroying
mario Feb 21, 2017
ab266f3
Enforce requirements
mario Feb 21, 2017
d734e8a
Change execution window
mario Feb 21, 2017
9ce087e
Update support lib
mario Feb 21, 2017
717e4b2
Stuff
mario Feb 21, 2017
e4c306a
Do not update current
mario Feb 21, 2017
115c9a7
Change order of things
mario Feb 21, 2017
9901a80
Remove verbose
mario Feb 21, 2017
140f2d9
Remove obsolete stuff
mario Feb 21, 2017
66c2a80
Do not persist
mario Feb 21, 2017
3860b94
Add multidex magic
mario Feb 21, 2017
91257c8
Multidex import
mario Feb 21, 2017
4d6cc11
Update gradle
mario Feb 21, 2017
f95446e
Remove obsolete stuff
mario Feb 22, 2017
5548d17
test new image
MorrisJobke Feb 22, 2017
9960434
Try to fix videos
mario Feb 22, 2017
9ff5f2b
Fix empty stuff
mario Feb 22, 2017
759d0df
Fix it all
mario Feb 22, 2017
602b3c1
Remove stuff we don’t need
mario Feb 22, 2017
8804a01
Try to fix changes between upload behaviour
mario Feb 22, 2017
004cfd5
Revert "Try to fix changes between upload behaviour"
mario Feb 22, 2017
8bfdd00
Attempt to fix stuff
mario Feb 23, 2017
49c27b1
Revert "Attempt to fix stuff"
mario Feb 23, 2017
c935617
Attempt to fix
mario Feb 23, 2017
488c41d
Fix path
mario Feb 23, 2017
4bf833c
Chande delay slightly
mario Feb 23, 2017
3b755d4
Clean up code
mario Feb 23, 2017
96cfa5d
Use stable android-job lib
mario Feb 23, 2017
80de60a
Delete delay for delete
mario Feb 23, 2017
065cbd9
Remove magic
mario Feb 23, 2017
56a9998
Remove play services
mario Feb 23, 2017
e245b1f
Revert "Remove play services"
mario Feb 23, 2017
bdb3a56
rename function to deleteSyncedFoldersNotInList
AndyScherzinger Feb 24, 2017
5e5e9b6
remove warning, adding generic brackets
AndyScherzinger Feb 24, 2017
316554f
added break to switch statement
AndyScherzinger Feb 24, 2017
aa10589
Show all uploads
mario Feb 24, 2017
c09f9e9
Remove vars we don’t use
mario Feb 24, 2017
0be1f75
Remove unused imports
mario Feb 24, 2017
4c86922
Revert "Use stable android-job lib"
mario Feb 24, 2017
1bd5113
cleanup MediaStore on upload behavior "delete"
AndyScherzinger Feb 27, 2017
650a09d
moved legacyClean flag to app's PreferenceManager
AndyScherzinger Feb 27, 2017
8f3c052
remove unnecessary line break
AndyScherzinger Feb 27, 2017
01e9a35
Update dependency
mario Feb 27, 2017
9d45479
Update android job
mario Feb 27, 2017
5de19e2
removed unnecessary line break
AndyScherzinger Feb 27, 2017
b2e8cff
change documentation
AndyScherzinger Feb 27, 2017
62126da
Update stuff according to review
mario Feb 27, 2017
16d81b4
extract pattern to a constant
AndyScherzinger Feb 27, 2017
f13b1f2
minor reformatting and javaDoc fixes
AndyScherzinger Feb 27, 2017
b3e668f
Remove useless import
mario Feb 27, 2017
bb20395
Revert "Revert "Try to fix changes between upload behaviour""
mario Mar 1, 2017
de3fe5e
Attempt to fix move
mario Mar 1, 2017
832f2c4
Put delete file back
mario Mar 1, 2017
35284f9
made expected path a local variable since it is only used in one place
AndyScherzinger Mar 2, 2017
4f461b7
Fix
mario Mar 2, 2017
c974969
Fix a bug
mario Mar 3, 2017
a53e289
This is useless
mario Mar 3, 2017
5fee93d
Declare string where needed
mario Mar 3, 2017
b611874
Changelog for 1.4.2
AndyScherzinger Mar 3, 2017
c5f748d
use latest lib version
AndyScherzinger Mar 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pipeline:
test:
image: nextcloudci/android:android-7
image: nextcloudci/android:android-14
commands:
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 20M
- emulator -avd test -no-window &
Expand Down
14 changes: 9 additions & 5 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="24" />
android:targetSdkVersion="25" />

<!-- GET_ACCOUNTS is needed for API < 23.
For API >= 23 results in the addition of CONTACTS group to the list of permissions that may be
Expand Down Expand Up @@ -61,6 +61,7 @@
android:name=".MainApp"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:fullBackupContent="@xml/backup_config"
android:theme="@style/Theme.ownCloud.Toolbar"
android:manageSpaceActivity="com.owncloud.android.ui.activity.ManageSpaceActivity">
<activity
Expand Down Expand Up @@ -128,10 +129,6 @@
android:name="android.content.SyncAdapter"
android:resource="@xml/syncadapter_files" />
</service>
<service
android:name=".services.SyncedFolderJobService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="true"/>

<provider
android:name=".providers.FileContentProvider"
Expand Down Expand Up @@ -244,6 +241,13 @@
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:name=".services.ShutdownReceiver">
<intent-filter>
<action android:name="android.intent.action.ACTION_SHUTDOWN" />
<action android:name="android.intent.action.QUICKBOOT_POWEROFF" />
</intent-filter>
</receiver>


<service android:name=".services.observer.FileObserverService" />

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 1.4.2 (March , 2017)
- Auto Upload (Android 6+)
- Auto Upload improvements and fixes
- Filtering improvements
- Fix for Android permissions (removed read phone state permission)
- Fix re-upload of files
- Avoid toggling favourite for all selected files
- Link to providers list in the setup screen
- further bugfixes and improvements

## 1.4.1 (January 27, 2017)
- Share URLs to Nextcloud
- Improve performance of Auto Upload view
Expand Down
18 changes: 15 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
buildscript {
repositories {
jcenter()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
Expand All @@ -20,7 +23,7 @@ apply plugin: 'pmd'
apply plugin: 'findbugs'

ext {
supportLibraryVersion = '24.2.1'
supportLibraryVersion = '25.0.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is the reason, why it is not building anymore. Let me check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mario any reason for 25.0.0 (exact version?). I am really happy that we made it to v25 :) Since there is v25.2.0, would it be possible to move to 25.2.0 (could do that in another PR)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there was some kind of conflict at one point in time that doesn't seem to be there anymore. Do you want this change done in this PR or in another one?

Also, should I update this?
compileSdkVersion 24
buildToolsVersion "24.0.2"

Copy link
Member

@AndyScherzinger AndyScherzinger Feb 27, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say we better go for a new one since we can't predict the implications this might have (already had such issues with the 24 or 23 bump where the compile target then changes the behavior since it won't be backwwards compiled for the latest version (there was in issue with file access that time)). So to not potentially create new issues for 1.4.2 I'd say, we postpone this for maybe 1.5.0.

So I's suggest keeping it this way for 1.4.2 and bump everything to latest and greatest in a new PR targeting 1.5.
What so you think @mario @tobiasKaminsky ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

K.


travisBuild = System.getenv("TRAVIS") == "true"

Expand All @@ -40,15 +43,18 @@ repositories {
dependencies {
/// dependencies for app building
compile name: 'touch-image-view'
compile 'com.android.support:multidex:1.0.1'

compile 'com.github.nextcloud:android-library:1.0.11'
compile 'com.github.nextcloud:android-library:1.0.12'
compile "com.android.support:support-v4:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile 'com.jakewharton:disklrucache:2.0.2'
compile "com.android.support:appcompat-v7:${supportLibraryVersion}"
compile 'com.getbase:floatingactionbutton:1.10.1'
compile 'com.google.code.findbugs:annotations:2.0.1'

compile group: 'commons-io', name: 'commons-io', version: '2.4'
compile 'com.google.android.gms:play-services:10.2.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schiessle any opinion on including this dependency?
@mario will this still work for now Google-ized devices?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can remove it if you're absolutely against it - it's not a hard dependency, but allows us to use GCM Network manager if Play services are available on the phone which is a good thing.
I think it would work on phones without Play services as well, and would use Job Scheduler directly (for 5+) and Alarm stuff for 4.x. (once we actually enable 4 and 5)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, let me remove it right away.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed.

compile 'com.github.evernote:android-job:v1.1.7'

/// dependencies for local unit tests
testCompile 'junit:junit:4.12'
Expand Down Expand Up @@ -89,6 +95,11 @@ android {
htmlReport true
htmlOutput file("$project.buildDir/reports/lint/lint.html")
}

dexOptions {
javaMaxHeapSize "4g"
}

compileSdkVersion 24
buildToolsVersion "24.0.2"

Expand All @@ -100,6 +111,7 @@ android {
testInstrumentationRunnerArgument "TEST_PASSWORD", "\"$System.env.OCTEST_APP_PASSWORD\""
testInstrumentationRunnerArgument "TEST_SERVER_URL", "\"$System.env.OCTEST_SERVER_BASE_URL\""

multiDexEnabled true
applicationId "com.nextcloud.client"
}

Expand Down
5 changes: 5 additions & 0 deletions res/xml/backup_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<exclude domain="sharedpref" path="evernote_jobs.xml" />
<exclude domain="database" path="evernote_jobs.db" />
</full-backup-content>
Loading