Because it is mandatory as of nov 2018:
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
As the default Notification.Builder constructor is deprecated in API 26,
this change also adds the use of the new constructor, which requires a
notification channel Id.
Note: since the users are now in full-control of the notifications,
they can now choose to completely block the auto-upload notification
channel. Given that the main goal of the notification was to keep the
app in memory in order for auto-upload to work, one could expect that
blocking the channel would defeat the notification's purpose. However,
as far as I could test, auto-uploading seems to still be working even
after disabling the channel, and letting the activity die (tip: in
devoloper options, one can tick "Don't keep activities"). In fact,
Perkeep Uploader still always runs as a service.
Also build pk-put shipped in the app with Go 1.11.
Fixes#1202
Change-Id: I8f98e0df742915cb504b6c1cfaa42ca6dc7b6189
As far as I understood, for the auto-uploading to work reliably, the
file observers need to be permanently referenced, so they can watch for
new file creations constantly. It seems that it was not the case, as
they are referenced by the upload service, which itself was meant to be
stopped as soon as it's done uploading.
Moreover, as android memory management is getting more aggressive, it is
apparently getting more likely that the service would get killed anyway,
even if it did not stop itself.
This change is therefore two-fold:
1) The service does not try to stop itself anymore when it's done
uploading. Also, the activity starts it before binding to it (because
otherwise a service that has been automatically "bound-started" gets
destroyed as soon as all its binders disconnect from it).
2) The service is declared to run on the foreground, to make it the
least likely possible for the system to kill it. That means adding a
notification to which it is tied. The notification action leads to the
settings page, so that the auto-uploading can be toggled on/off.
At first I tried creating a new service class, that would be the
smallest possible (having only the file observers), to reduce the size
of what would have to be in the foreground. But it proved harder than I
thought and would require more time to rework the app as a whole, and
I'm not sure that's the best thing to do right now. Which is why I
resorted to make the whole UploadService a foreground one. I do not know
yet whether this is an acceptable trade-off.
In addition, this CL tries harder to find the directories with
interesting files to upload, by trying directories on the SD card too.
Fixes#1049
Change-Id: I311f31acc0a1db43791a7502a45a9f2da92cf39a
-android plugin 3.0.1
-gradle 4.1 (requirement for the above)
-gomobile to 069be623eb8e75049d64f1419849b3e92aab1c81
-go 1.9.3
-removed permission to write on storage from the manifest
-added permission to read from storage on the manifest
-added permission checking code for reading files on storage, which is
compulsory with modern android APIs.
-add missing code to update textByteStatus and textFileStatus TextViews
Notes:
-the app won't work with a server older than rev
6e8a5930c9 as the server/client protocol
to check for existing files on the server changed at this point.
-i think with Android O there's a much higher chance that the
CamliFileObserver gets garbage collected, which breaks the
auto-uploader. We probably need to switch to a different architecture,
like running as a Foreground Service, or using the Job Scheduler to
regularly fire up the file observer. In another CL.
Updates #1049
Change-Id: I079da8e5df5be820c3985749a9e109cf0775b495
Part of the project renaming, issue #981.
After this, users will need to mv their $GOPATH/src/camlistore.org to
$GOPATH/src/perkeep.org. Sorry.
This doesn't yet rename the tools like camlistored, camput, camget,
camtool, etc.
Also, this only moves the lru package to internal. More will move to
internal later.
Also, this doesn't yet remove the "/pkg/" directory. That'll likely
happen later.
This updates some docs, but not all.
devcam test now passes again, even with Go 1.10 (which requires vet
checks are clean too). So a bunch of vet tests are fixed in this CL
too, and a bunch of other broken tests are now fixed (introduced from
the past week of merging the CL backlog).
Change-Id: If580db1691b5b99f8ed6195070789b1f44877dd4
Android Studio requires newer versions of the Android SDK Build-Tools
and Gradle to build the uploader application.
In this commit, Gradle is updated to version 3.3 (as suggested by
Android Studio) and the Android SDK Build-Tools to the most recent
release.
Change-Id: Ief04ec56a6fffb0b46bd28820134c8e7a1ebbede
Android applications nowadays are supposed to be developped with Android
Studio, which uses gradle as the build system, with the android plugin.
This change modifies the app setup and file tree layout so it can be
built with gradle (in docker by default) instead of with ant.
The initial motivation for this change is to make changes to the app in
Go, using 'gomobile bind' to call the Go code from java. As the canonical
example at golang.org/x/mobile/example/bind/hello uses gradle, the
first step was to migrate the app to gradle.
Even if we don't end up using gomobile, this change is interesting as it
makes it easier for android apps developpers to contribute to the app if
it uses the recommended "modern" way.
Change-Id: I8386012db640324b62e18ffc128b68ba971fa953