3347 Commits

Author SHA1 Message Date
F-Droid Translatebot
bfca096775 Pull translation updates from Weblate
Translators:

Franco                    Spanish
Jonatan                   Swedish
Mário Castanheira         Finnish
Mohamad Hasan Al Banna    Indonesian
msrn                      Finnish
2016-04-04 21:44:56 +01:00
Daniel Martí
04914d8d8b Merge branch 'gitlab-with-emulator-23' into 'master'
gitlab-ci: use android-17 emulator for `gradle connectedCheck`

The android-10 emulator does not report test failures so it is pretty useless at the moment.  After lots and lots of trying, the most recent emulator that I could get running on gitlab-ci was 17, so let's hope that turns out to be more useful.  I also had to reduce the RAM that was used, it seems that gitlab-ci does not let the docker images use much RAM.  This might be able to be improved by creating an pre-setup AVD image in the docker image used by this.

As you can see from the history, I tried lots of things to see if it is was possible to get a more recent emulator running on gitlab-ci.

See merge request !241
2016-04-04 20:28:51 +00:00
Hans-Christoph Steiner
37bca5d244 gitlab-ci: use android-17 emulator for gradle connectedCheck
The android-10 emulator does not report test failures so it is pretty
useless at the moment.  After lots and lots of trying, the most recent
emulator that I could get running on gitlab-ci was 17, so let's hope that
turns out to be more useful.  I also had to reduce the RAM that was used,
it seems that gitlab-ci does not let the docker images use much RAM.

This might be able to be improved by creating an pre-setup AVD image in the
docker image used by this.
2016-04-04 21:14:56 +02:00
Hans-Christoph Steiner
409a50fe92 gitlab-ci: upload full build logs to clbin.com
I find that the logs dumped into the gitlab-ci screens are generally
unreadable, so here, only the errors are dumped into the build log, then
the rest are uploaded to clbin, a paste bin, where the whole text can be
viewed and downloaded in a clean, raw format.
2016-04-04 21:13:44 +02:00
Hans-Christoph Steiner
ac2cfe557d Merge branch 'simplify-internal-api-and-tests' into 'master'
Add non-emulator tests and simplify internal API

A lot of the purely internal API is using constructs which are not needed for internal APIs.  The internal API can be viewed and changed by any contributor, so its better to not cover all possible future uses.  Indeed to keep the codebase simple, it should be the opposite: the app's code should reflect what is actually happening now, not what might happen in the future.

This also adds tests that run on the JVM rather than the emulator.

These commits where originally in !248 but I'm submitting them separately since !248 is too big.

See merge request !250
2016-04-04 12:28:45 +00:00
Hans-Christoph Steiner
0bf221383b make RepoUpdater's index URL a property for easy use
Since the DownloaderService's events are all based on the complete download
URLs, and RepoUpdater is where the update URLs are built, this makes the
full download URL into a read-only property of RepoUpdater so it can be
used wherever there is an instance of RepoUpdater

This is also important because having the `final` property highlights
the lifecycle of that variable: it does not change during the entire
life of a RepoUpdater Instance.
2016-04-04 13:21:18 +02:00
Hans-Christoph Steiner
8befba0522 send Downloader progress only via its DownloaderProgressListener
Instead of duplicate APIs, standardize on a single API, and use that
everywhere via the Downloader.LOCAL_ACTION_PROGRESS event that is already
wired in.
2016-04-04 13:21:18 +02:00
Hans-Christoph Steiner
ae0976d24a move HTTP Auth to HttpDownloader to make it testable
This also encapsulates the HTTP Auth stuff better so that it will be easier
to wrap it all into a event-based service.
2016-04-04 13:21:18 +02:00
Hans-Christoph Steiner
591b23b5ab Downloader.cancelDownload() instead of using external Thread logic
This is needed so that downloads can be canceled from within an
IntentService. Since the Downloader classes do not have any Thread logic in
them, they shouldn't use Thread logic within them anyway.

This also removes the unused argument to AsyncDownloader.attemptCancel().
2016-04-04 13:21:18 +02:00
Hans-Christoph Steiner
74274d21b4 move SanitizedFileTest into non-Android tests
It can run in plain java, so might as well.
2016-04-04 10:53:12 +02:00
Hans-Christoph Steiner
bc3d8a89b6 add tests of HttpDownloader 2016-04-04 10:53:12 +02:00
Daniel Martí
f033276f67 Merge branch 'apply-for-android-8' into 'master'
SharedPreferences.Editor.apply() for android 8

Turns out that `SharedPreferences.Editor.apply()` was not added until `android-9`, so this is a little trick to support `android-8` still after the changes in c3b47ecd5a380678dd2df3dc2549155429d28514

See merge request !249
2016-04-02 21:38:57 +00:00
Hans-Christoph Steiner
e021eb5ca7 standardize SDK version test methods
I just took the most common method, using the SDK int value, and applied
that throughout the code to have it consistent.
2016-04-02 22:46:41 +02:00
Hans-Christoph Steiner
610ead83d0 make version of Editor.apply() for SDK 8
This is not pretty, but its the best I could think of.

Fixes this lint error:
Call requires API level 9 (current min is 8): android.content.SharedPreferences.Editor#apply [NewApi]
2016-04-02 22:46:37 +02:00
Daniel Martí
5175eacd6d CHANGELOG: include bugfix notes from stable branch 2016-04-01 16:56:21 +01:00
Hans-Christoph Steiner
4485d7c2cb Merge branch 'random-fixes-2' into 'master'
Gradle fixes, enable PMD unusedcode rules



See merge request !246
2016-04-01 08:39:50 +00:00
Daniel Martí
fddce692db PMD: Get closer to obeying unnecessary
Don't enable it just yet, it's way too pedantic with parenthesis.
2016-03-31 21:54:11 +01:00
Daniel Martí
b4dd9c857e Get closer to obeying PMD's unused code rules 2016-03-31 21:40:33 +01:00
Daniel Martí
0e76a2e1fe Fix source directories after gradle layout switch
'src' works because we're only doing java files under that directory.
But it would be slower than needed, and in the case of PMD it would also
use the test files which wasn't intended at all.
2016-03-31 21:40:33 +01:00
Daniel Martí
52436350c6 Make Android Studio a little happier 2016-03-31 21:40:30 +01:00
Daniel Martí
f34237f333 Remove duplicated commons-io dep
It seems like having it as a compile dependency already works for the
tests. Having it duplicated seems to sometimes trigger errors (e.g. a
user reported a duplicate zip entry due to the duplication) and might
also be problematic if we don't keep the two versions in sync.
2016-03-31 12:01:58 +01:00
Daniel Martí
41d54f7e92 Merge branch 'random-fixes-from-downloaderservice-hacking' into 'master'
Random fixes from DownloaderService hacking

Here are some random fixes that I did in the process of the DownloaderService refactoring.  I don't think anything should be controversial.  Thanks for your rapid code reviews recently @mvdan :)

See merge request !245
2016-03-31 10:43:13 +00:00
Hans-Christoph Steiner
6a1ab2b80a make LocalFileDownloader.close() actually close things
This doesn't fix the stacktrace but at least it makes this class complete
2016-03-31 10:16:39 +02:00
Hans-Christoph Steiner
c3b47ecd5a fix lint warning: CommitPrefEdits: use apply() instead of commit()
"Consider using apply() instead; commit writes its data to persistent
storage immediately, whereas apply will handle it in the background"

commit() is only useful if the code actually checks the return value.
2016-03-31 10:16:39 +02:00
Hans-Christoph Steiner
c67a60271d fix lint errors: StringFormatInvalid: Invalid format string
* Use a % sign that String.format() recognizes, apparently there are more
  than one % signs, in Chinese, its big: %

* a string in lithuanian forgot the %s
2016-03-31 10:16:39 +02:00
Hans-Christoph Steiner
38680d84e3 update some javadoc 2016-03-31 10:16:39 +02:00
Hans-Christoph Steiner
7f6dfb6dfe remove unused IOException from Downloader.close() method
This makes close() easier to use, and the IOException is not used at all.
2016-03-31 10:16:39 +02:00
Hans-Christoph Steiner
6ad9bbd367 Merge branch 'more-downloaderservice-progress' into 'master'
More DownloaderService progress

As part of the incremental approach of moving downloading to an IntentService, here are a few more commits refactoring things into events instead of listerners/callbacks/etc.

ping @pserwylo 

See merge request !240
2016-03-31 08:15:35 +00:00
Paresh Chouhan
df9954ba0b Fixed Cursor initialization deprecation 2016-03-30 23:16:46 +05:30
Hans-Christoph Steiner
29788254dd use background thread for swap icons instead of AsyncTask
An AsyncTask ties into the UI thread for things like onPostExecute(). If it
is run within an AsyncTask, then it freaks out because it can't tie into
the UI thread.  We don't need it to do that here anyway, so just use a
plain Thread, and set the priority to background.
2016-03-30 14:08:21 +02:00
Hans-Christoph Steiner
260b5bb9fb remove unused AsyncDownloadWrapper.MSG_DATA
This is all wired up, but the data is never ultimately used.
2016-03-30 14:08:21 +02:00
Hans-Christoph Steiner
91edad0c31 remove EVENT_DATA_ERROR_TYPE for DownloaderService reorg
As part of the process of moving the APK downloading to an
IntentService, I'm removing and incrementally reorganizing the
existing events so that the code continues to be functional as it is
reorganized.  We might want to include more detail in a download error
to expose to the user, but I think instead what will be more fruitful
is to hide details on errors where there is nothing the user can do
except retry.  Then if there are errors where the user can do
something about it, then F-Droid should instead offer them the option
of doing that, and not just show an error message and walk away.
2016-03-30 14:06:15 +02:00
Hans-Christoph Steiner
d38058497e move ApkDownloader.EXTRA_URL to Intent.setDataString()
This is part of the move to standardizing all internal broadcasts to use
the Intent's Uri field as the standard place for a download URL, and then
using that in IntentFilters to do matching.
2016-03-30 14:06:15 +02:00
Hans-Christoph Steiner
0473ac72da Merge branch 'random-fixes' into 'master'
CI image bump, version bumps, app folder fixes



See merge request !239
2016-03-29 17:25:14 +00:00
Daniel Martí
58c23c0a0e Fix binaryDeps with new app folder
Little remaining breakage in our main build.gradle. Went unnoticed
because we rarely use this. And hopefully we can get rid of it soon.
2016-03-29 17:57:21 +01:00
Daniel Martí
d5456e1bbf Bump ACRA to 4.8.5
Minor bugfix release.
2016-03-29 17:54:24 +01:00
Daniel Martí
3a83f80ab6 CI: Use the new client image
It's now made up of one extra layer. No changes in practice other than
android-23 being updated to rev2.
2016-03-29 17:48:43 +01:00
Daniel Martí
db2aaeaf22 Bump checkstyle to 6.17
No changes were necessary to keep it happy.
2016-03-29 17:46:37 +01:00
Daniel Martí
6a38e18057 Android.mk: Fix apk path
It's app-release-unsigned.apk, not F-Droid-release-unsigned.apk. To make
sure we don't screw up again, just use $(fdroid_dir).
2016-03-29 17:45:11 +01:00
Daniel Martí
858a44173b Add new language to the list 2016-03-29 17:25:02 +01:00
F-Droid Translatebot
c67570541b Pull translation updates from Weblate
Translators:

Marian Hanzel             Slovak
Mohamad Hasan Al Banna    Indonesian
Tobias Bannert            German
Waqar Ahmed               Urdu
2016-03-29 17:11:10 +01:00
Daniel Martí
c1f0414b6c Merge branch 'upgrade-arrow-fix' into 'master'
Fix values-ldrtl placement

Fix rebase error in !235.

See merge request !238
2016-03-29 15:56:55 +00:00
relan
406094b56d Fix values-ldrtl placement 2016-03-29 18:10:00 +03:00
Daniel Martí
7ef4e4245b Merge branch 'upgrade-arrow-rtl' into 'master'
Fix version upgrade string for RTL languages

In right-to-left languages _forward_ is the direction to the left, so leftwards arrow should be used to indicate upgrade:

![upgrade-arrow-rtl](/uploads/238dd85c33c92336e71357e4250aaef3/upgrade-arrow-rtl.png)

For left-to-right languages it remains the same:

![upgrade-arrow-ltr](/uploads/5e06ace9e6bf868ed89684c274f4e813/upgrade-arrow-ltr.png)

Closes #609.

See merge request !235
2016-03-29 13:50:53 +00:00
relan
057f6c167c Skip values-ldrtl while listing languages
ldrtl is a modifier ("layout direction right-to-left"), not a language.
2016-03-29 16:03:59 +03:00
relan
771ac45b8a Add version upgrade string for RTL languages 2016-03-29 15:59:39 +03:00
relan
d54a4b07e5 Move version upgrade arrow string to resources
Hardcoded strings cannot be localized.
2016-03-29 15:59:39 +03:00
Daniel Martí
ec53f4e05c Merge branch 'simplify-downloaders' into 'master'
Simplify Downloaders

This is some groundwork to simplify the Downloader stuff in preparation to moving it to something like an `IntentService`, as part of #601.  This mostly removes unused bits that I've found in the process of writing the `DownloaderService`.  Some of these events will be added back in a more consistent way, so that there is one event type for the same idea throughout the code base.

See merge request !236
2016-03-29 12:46:19 +00:00
Hans-Christoph Steiner
d76d7aa367 remove unused ApkDownloader.EVENT_APK_DOWNLOAD_CANCELLED
This also removes all the related stuff that resulted in
EVENT_APK_DOWNLOAD_CANCELLED being sent. Since EVENT_APK_DOWNLOAD_CANCELLED
ultimately does nothing, that whole bit of plumbing is unused.
2016-03-29 14:13:42 +02:00
Hans-Christoph Steiner
ab709e171a remove ApkDownloader.EXTRA_TYPE, it is entirely unused
This constant is wired up, but ultimately does nothing at all, since all
of the cases in the switch do the exact same thing.
2016-03-29 14:11:40 +02:00