5206 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
5ec9789e73 switch minSdkVersion to 14 (Android 4.0)
#1379
2018-04-19 11:28:27 +02:00
Hans-Christoph Steiner
38a3ccda17 Merge branch 'update-scheduling' into 'master'
modernize update scheduling

See merge request fdroid/fdroidclient!416
2018-04-18 22:04:55 +00:00
Hans-Christoph Steiner
9e0de9ac69 rudimentary support for JobScheduler to run updates
The new JobScheduler API can opportunitistically run a job based on whether
there is good internet, connected to power, etc.  This is very useful for
running updates.  Ideally, updates would always happen in the background
while on unmetered internet and connected to power.

#588
2018-04-18 23:07:36 +02:00
Hans-Christoph Steiner
e36d7719b3 trigger an update after joining good wifi without JobSchedule
Each time the device connects to a wifi network, this waits for 2 minutes,
then if the wifi is still connected, it re-schedules the index update to
happen now.  The goal is to favor unmetered networks as much as possible
when downloading the index and any automatic app updates.

This is only needed on older platforms, JobScheduler handles this for us on
android-21+
2018-04-18 23:07:36 +02:00
Hans-Christoph Steiner
7d9f5e880c move update scheduling entirely to AlarmManager
This changes the flow of the update triggering so that any Intent sent to
UpdateService can potentially trigger an update, depending only on the
state of the internet and the "Only on WiFi" preference.  Instead of having
a timer that checks every hour to see if it is time to run the update, just
let AlarmManager send a trigger Intent based on the timing in the
"Update Interval" setting.

The update schedule is reset each time F-Droid restarts, and also each time
the user returns from the settings, so if AlarmManager fails us in the time
being, the updates will be rescheduled next time F-Droid is restarted, the
device is rebooted, etc.

refs #662
2018-04-18 22:04:52 +02:00
Hans-Christoph Steiner
5f3e952958 move "Update Interval" pref handling to Preferences class
Basically all of the settings are handled in the Preferences class now,
this was an outlier.
2018-04-18 21:56:14 +02:00
Hans-Christoph Steiner
552da24d30 fix HttpDownloaderTest after refactoring
HttpDownloaderTest doesn't get run in gitlab-ci since it was too flaky with
internet connections in the emulator.  So these were missed until I manually
ran the tests.

688057b3e7e214db49566b84d5b3dcd0db30dc2b
195aaae7e52dc1c47741965904ed17bdc816a71c
df08e84e7829652d7999eee5451080a012b00a1e
2018-04-18 20:29:27 +02:00
Hans-Christoph Steiner
d917d6d007 version code 1002051 2018-04-18 20:21:23 +02:00
Hans-Christoph Steiner
6a86762cd2 update CHANGELOG 2018-04-18 20:20:58 +02:00
Antón Méixome
e7bc6f1fd7 Translated using Weblate (Galician)
Currently translated at 96.8% (405 of 418 strings)
2018-04-18 20:15:08 +02:00
ezjerry liao
7ce639f4dd Translated using Weblate (Chinese (Traditional))
Currently translated at 100.0% (418 of 418 strings)
2018-04-18 20:15:06 +02:00
Hans-Christoph Steiner
ce8d089dc7 Merge branch 'weblate' into 'master'
Weblate

See merge request fdroid/fdroidclient!675
2018-04-18 18:16:21 +00:00
Hans-Christoph Steiner
9b8f60c4fe Weblate 2018-04-18 18:16:21 +00:00
Hans-Christoph Steiner
9a33a751a1 Merge branch '1.2.1-polish' into 'master'
1.2.1 polish

Closes #577 and #440

See merge request fdroid/fdroidclient!674
2018-04-18 17:57:09 +00:00
Hans-Christoph Steiner
2615c461f2 debounce incoming "WiFi Connected" events for reliable status
Some devices send multiple copies of given events, like a Moto G often
sends three {@code CONNECTED} events.  So they have to be debounced to
keep the {@link #BROADCAST} useful.
2018-04-18 17:14:22 +02:00
Hans-Christoph Steiner
045fc1a35e make "Scan QR" immediately show the QR screen, not "Select Apps" 2018-04-18 17:14:22 +02:00
Hans-Christoph Steiner
fa1331139f delete all swap repos when before swap starts and after it stops
For now, swap repos are only trusted as long as swapping is active.  They
should have a long lived trust based on the signing key, but that requires
that the repos are stored in the database by fingerprint, not by URL
address.

#295
#703
2018-04-18 17:14:22 +02:00
Hans-Christoph Steiner
b9c247e2b1 if WifiManager fails to return netmask, directly query net interfaces
Google broke returning the netmask somewhere around android-21. This could
be done using more official APIs, but this reuses stuff that needs to be
there anyway.

closes #577
https://code.google.com/p/android/issues/detail?id=82477#c5
https://issuetracker.google.com/issues/37015180
2018-04-18 17:14:22 +02:00
Hans-Christoph Steiner
3fd1b055b3 tame debug logging in CompatibilityChecker
It makes a huge dump on every index refresh, making troubleshooting other
things around the index hard.
2018-04-18 17:14:22 +02:00
Hans-Christoph Steiner
eb77f72cd2 store last working mirror per repo
For mirroring to work on multiple repos, this must be stored and used per-
repo.  The timeout and number of tries seem fine to keep global to reduce
the total amount of mirror churn when this logic is searching.
2018-04-18 09:53:16 +02:00
Hans-Christoph Steiner
21e3124b5f prevent crash when starting swap on devices without Bluetooth/WiFi
This was introduced in f90b030e76ddb03e00bc0d46977c01c1bae3936d
2018-04-18 09:53:16 +02:00
Hans-Christoph Steiner
c42d7164cf exclude ROM apps from default swap app listing
Apps that are built as part of the ROM and signed by the platform keys
should very rarely be swapped.  This removes them from the default
list by comparing the signing keys.

This filter is deliberately only included on the list function and not on
the search function.  If people want to share system apps, they'll be able
to find them with the search function, but the system apps won't show up
by default.

https://source.android.com/devices/tech/ota/sign_builds#certificates-keys

closes #440
2018-04-18 09:53:16 +02:00
Hans-Christoph Steiner
59ec2a7751 Merge branch 'blank-versionName' into 'master'
handle Blank versionName

Closes #1418

See merge request fdroid/fdroidclient!673
2018-04-17 20:21:02 +00:00
Hans-Christoph Steiner
36c76070e5 Apk.versionName can be null, and the code should handle it
closes #1418
db-version/79
2018-04-17 15:30:56 +02:00
Hans-Christoph Steiner
94818e36bf fix swap to work with APKs with blank versionNames
fdroidclient#1418
fdroiddata!3061
2018-04-17 15:30:56 +02:00
Hans-Christoph Steiner
eac85e725f debug logging in release builds for disappearing F-Droid 2018-04-16 17:00:23 +02:00
Hans-Christoph Steiner
c327cd788b update changelogs 1.2 2018-04-13 21:42:56 +02:00
Hans-Christoph Steiner
2cba07b117 version code 1002050 2018-04-13 21:39:37 +02:00
Hans-Christoph Steiner
714a44ad5d Merge branch 'first-swap-overhaul' into 'master'
First swap overhaul

Closes #656, #612, and #586

See merge request fdroid/fdroidclient!671
2018-04-13 07:45:43 +00:00
Hans-Christoph Steiner
b0d11abc4e Merge branch 'weblate' into 'master'
Weblate

See merge request fdroid/fdroidclient!672
2018-04-12 23:26:12 +00:00
Hans-Christoph Steiner
601e6f6e45 Weblate 2018-04-12 23:26:12 +00:00
Hans-Christoph Steiner
c770d4ef18 prefer WiFi in Send F-Droid when the conditions dictate that 2018-04-13 00:26:54 +02:00
Hans-Christoph Steiner
f07e5c040c when user selects WiFi over Hotspot, make sure WiFi is enabled 2018-04-13 00:20:55 +02:00
Hans-Christoph Steiner
444ecd024b when user turns on swap WiFi visibility, ensure that WiFi is on 2018-04-13 00:20:55 +02:00
Hans-Christoph Steiner
570b532bd6 prompt user for WRITE_SETTINGS permission when setting up Hotspot
closes #656
2018-04-13 00:20:55 +02:00
Hans-Christoph Steiner
f90b030e76 save and restore Bluetooth/WiFi swap state and previous state
This should make swap remember if Bluetooth/WiFi was disabled when swapping
started, then automatically disable it when swapping is done. This also
makes swapping remember the swap "visibility" that the user set, and restore
that when the user starts swapping again.  There are logic bugs elsewhere
in the whole thing that prevent this from always working, but the state
should be set and stored properly.
2018-04-13 00:20:55 +02:00
Hans-Christoph Steiner
3fca7c7153 disable swap "visible" checkboxes by default, they get dynamically set
If users click these fast, then its easy to get caught in a loop fighting
the dynamic setting of them.
2018-04-13 00:20:54 +02:00
Hans-Christoph Steiner
57e4315e18 quit BluetoothServer when Bluetooth is disabled 2018-04-13 00:20:54 +02:00
Hans-Christoph Steiner
73ad5bd6b3 update to latest jmDNS for more reliable detection
closes #612
2018-04-13 00:20:54 +02:00
Hans-Christoph Steiner
6b4b85d396 entirely purge AndroidHttpClient from the code base.
closes #586
2018-04-13 00:20:54 +02:00
Hans-Christoph Steiner
9cb53e93d0 allow Bluetooth swap to work when there is no available internet
#1393
2018-04-13 00:20:54 +02:00
Hans-Christoph Steiner
615e559ce1 only prompt to swap back to proper swap URLs
Before, it was possible to annoy the user by sending HTTP POST with any
repo URL in it.
2018-04-13 00:20:52 +02:00
Hans-Christoph Steiner
f181e41338 Merge branch '1.2-polish' into 'master'
1.2 polish

See merge request fdroid/fdroidclient!670
2018-04-11 15:05:57 +00:00
Hans-Christoph Steiner
86e128b7e8 document F-Droid's use of HTTP 2018-04-11 11:34:12 +02:00
Hans-Christoph Steiner
b523ecc969 check redelivered Intents whether they completed while we were killed
If F-Droid gets killed during the install/update process, then the install
procedure would keep getting readded and redownloaded since it is a sticky
Intent.  The test is very specific so that this does not block things like
installing updates with the same versionCode, which happens sometimes, and
is allowed by Android.

#1271
2018-04-11 11:34:12 +02:00
Hans-Christoph Steiner
1413c35342 use standard method for basic installed app queries
Makes easy to track where these lookups are happening, and hopefully
simplifies the code a bit.
2018-04-11 11:34:09 +02:00
Hans-Christoph Steiner
1e6fb13ebc register to receive gitlab nightly URLs
They have one more path segment than the others, e.g.:
https://gitlab.com/fdroid/fdroidclient-nightly/raw/master/fdroid/repo
2018-04-11 11:26:55 +02:00
Hans-Christoph Steiner
af509e431e reformat localrepo code in using Android Studio Ctrl-Alt-L 2018-04-11 11:26:55 +02:00
Hans-Christoph Steiner
00cfaa572f version code 1002001 1.2-alpha1 2018-04-06 18:53:32 +02:00
Hans-Christoph Steiner
facf251cd1 update CHANGELOG 2018-04-06 18:53:32 +02:00