273 Commits

Author SHA1 Message Date
Daniel Martí
a2e1ce0fe2 Simplify if (cond) return true; else return false; 2015-04-16 19:12:44 +02:00
Daniel Martí
8737f4a9fc Remove more unused imports 2015-04-16 19:08:17 +02:00
Daniel Martí
250749a3cd Remove unused variable left from the intent rewrite 2015-04-16 19:08:00 +02:00
Daniel Martí
39c2aeb19a updateEmptyRepos is now in views/fragments/AppListFragment 2015-04-16 19:04:14 +02:00
Daniel Martí
5e7146d19a Drop unnecessary elses after returns 2015-04-16 18:51:29 +02:00
Daniel Martí
e1a6e2386f Style all switches equally, without indentation 2015-04-16 18:41:39 +02:00
Daniel Martí
d6a8ef9e59 Compact very simple getters in a single line 2015-04-16 18:35:22 +02:00
Daniel Martí
33fd77e3b8 style fix: no spaces before post-increment 2015-04-16 18:25:13 +02:00
Daniel Martí
9c6a652a02 Avoid NPE when fetching the Wifi SSID
Fixes #220
2015-04-16 16:49:39 +02:00
Peter Serwylo
0dd31c287c Merge branch 'defaultValues' into 'master'
Change some "defaultValue"s

Key "theme": I also use the dark version of F-Droid but I think the most users would prefer the light version. This is also standard in the
most used apps on Android, I think, see GApps, Flym, K-9, Telegram, ...

Key "localRepoBonjour": I never used this function and I think it's better, if the user manually activates it when he wants to use it.

Key "localRepoHttps": I see no reason why it should not use https over http, it's better of security view, I think.

Key "cacheDownloaded": The most smartphones today have enough storage available to allow to enable this function. This would decrease the
traffic on both sides, as the user does not have to download a app and the F-Droid server does not have to send it multiple
times.

This is somehow related to #221, I think.

See merge request !67
2015-04-15 21:29:29 +00:00
Peter Serwylo
6568f9fcbc Fixed crash on slow device due to database being locked.
The error below was happening on my crappy slow phone, I suspect because
the database upgrade check was locking the database, while this was
scheduled and started running on a different thread. Given it is a very
low priority task (it notifies F-Droid if apps were installed by a method
other than F-Droid) it is now delayed by 10 seconds.

E  FATAL EXCEPTION: AsyncTask #1
E  java.lang.RuntimeException: An error occured while executing doInBackground()
E      at android.os.AsyncTask$3.done(AsyncTask.java:200)
E      at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
E      at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
E      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
E      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
E      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
E      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
E      at java.lang.Thread.run(Thread.java:1019)
E  Caused by: android.database.sqlite.SQLiteException: database is locked: BEGIN EXCLUSIVE;
E      at android.database.sqlite.SQLiteDatabase.native_execSQL(Native Method)
E      at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1763)
E      at android.database.sqlite.SQLiteDatabase.beginTransactionWithListener(SQLiteDatabase.java:527)
E      at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:481)
E      at org.fdroid.fdroid.data.FDroidProvider.applyBatch(FDroidProvider.java:58)
E      at android.content.ContentProvider$Transport.applyBatch(ContentProvider.java:217)
E      at android.content.ContentProviderClient.applyBatch(ContentProviderClient.java:95)
E      at android.content.ContentResolver.applyBatch(ContentResolver.java:639)
E      at org.fdroid.fdroid.data.InstalledAppCacheUpdater.updateCache(InstalledAppCacheUpdater.java:98)
E      at org.fdroid.fdroid.data.InstalledAppCacheUpdater.update(InstalledAppCacheUpdater.java:64)
E      at org.fdroid.fdroid.data.InstalledAppCacheUpdater$Worker.doInBackground(InstalledAppCacheUpdater.java:163)
E      at org.fdroid.fdroid.data.InstalledAppCacheUpdater$Worker.doInBackground(InstalledAppCacheUpdater.java:159)
E      at android.os.AsyncTask$2.call(AsyncTask.java:185)
E      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
E      ... 4 more
2015-04-16 07:24:58 +10:00
Peter Serwylo
de3e34060c Fixed issue #226 - preferences don't crash.
Use custom code rather than "Locale.forLanguageTag" (which is android-21
specific). Also fixed the actual setting of the language, by modifying
the code in FDroidApp to respect the country code (rather than just the
language code).
2015-04-16 07:08:39 +10:00
Daniel Martí
f69985d8df Log messages of waiting threads belong to Log.d
Fixes #227
2015-04-15 18:15:57 +02:00
Daniel Martí
e36ed7f941 FileNotFoundException is already part of IOException 2015-04-15 18:06:44 +02:00
Daniel Martí
1d16a6edee Remove some useless null checks 2015-04-15 18:02:09 +02:00
Daniel Martí
801ec4e7fa sendBt might be null 2015-04-15 18:00:45 +02:00
Daniel Martí
fae80fbb26 swapRepos are never used 2015-04-15 17:58:52 +02:00
Daniel Martí
2365d314c6 Simplify some catch logic 2015-04-15 17:56:40 +02:00
Daniel Martí
13c9a14a50 Remove unused imports 2015-04-15 17:49:21 +02:00
Nico Alt
ccc9978540 change some "defaultValue"s
Key "theme": I also use the dark version of F-Droid but I think the most users would prefer the light version. This is also standard in the
most used apps on Android, I think, see GApps, Flym, K-9, Telegram, ...

Key "localRepoBonjour": I never used this function and I think it's better, if the user manually activates it when he wants to use it.

Key "localRepoHttps": I see no reason why it should not use https over http, it's better of security view, I think.

Key "cacheDownloaded": The most smartphones today have enough storage available to allow to enable this function. This would decrease the
traffic on both sides, as the user does not have to download a app and the F-Droid server does not have to send it multiple
times.
2015-04-14 23:32:40 +02:00
Peter Serwylo
0174b4ca00 Don't show empty list message until cursor finishes loading.
Also forceably hid the "update all" button in the update tab.
This is because on my crapy LG Tracphone android-10 device, it is slow
enough that I can see that button appear and then disappear.
2015-04-12 10:48:02 +10:00
Peter Serwylo
7f929f96a1 Added en-US locale to preferences.
Also changed the way locales are loaded. Now it deals well with language
codes that are followed by country codes (e.g. "en-US" rather than just
"en").
2015-04-11 23:04:37 +10:00
Peter Serwylo
04a05e3c52 Merge branch 'fix155' into 'master'
Change client language from the app options (#155)

Bug: ActionBar Language does not change.

Edit: To make it more clear, you have to restart the app manually for the action bar language to be changed.

See merge request !65
2015-04-11 06:04:24 +00:00
Peter Serwylo
15b0beba17 Wifi swap client now requests swap server to connect back.
It does this by sending a HTTP POST request to /request-swap on the
swap server. That listens for a POST to this path, and responds by
popping open a confirmation message to the user on the server device.
2015-04-11 10:55:48 +10:00
Daniel Martí
3e9aca4137 Logging fixes
* Make expensive Log.d calls (inside loops) only in DEBUG
* Always make TAG private to make sure it doesn't use a parent's TAG
2015-04-10 13:58:26 +02:00
Daniel Martí
8f0488aa6a Some minor cleanups 2015-04-09 23:55:02 +02:00
Peter Serwylo
1a114c6c45 Show app categories correctly. Fixes #214.
The categories were previously selected in the Spinner, then passed
directly to the database. Once the categories became translated, this
meant we were sending the translated category to the database.
However, the database only knows about English categories, and so we
instead need to look up the English translation for the selected
category before passing to the database. This is done by keeping
a list of original category names which is indexed the same as the
translated ones.
2015-04-09 15:47:00 +10:00
Daniel Martí
db19842ce0 Add support for amazon search links 2015-04-09 00:17:21 +02:00
Daniel Martí
c52262a405 Handle all app and search links via the main activity
Closes #208.
2015-04-09 00:13:40 +02:00
Nico Alt
14adb2a302 change client language from the app options (#155)
Bug: ActionBar Language does not change.
2015-04-08 20:53:04 +02:00
Daniel Martí
b751594bfe Centralise int and date parsing and formatting in Utils 2015-04-07 15:00:34 +02:00
Daniel Martí
c92970a3ed Use switches more often 2015-04-07 12:57:17 +02:00
Daniel Martí
c54c905d2e Some more small code refactors 2015-04-07 12:38:21 +02:00
Daniel Martí
0f18a0979d Run Android Studio's import optimizer
* Remove all wildcard imports
* Reorder alphabetically and by source
* Remove unused imports
2015-04-07 11:58:22 +02:00
Daniel Martí
e3175530ed Apply a bunch of Android Studio fixes 2015-04-07 11:43:07 +02:00
Daniel Martí
a67fdfeb89 Remove overrides that didn't do anything 2015-04-07 11:21:56 +02:00
Daniel Martí
0a11c4cd3e Optimize imports a bit 2015-04-07 10:47:24 +02:00
Daniel Martí
c7b16c6713 Only use 3.X workarounds on 3.X 2015-04-07 10:44:33 +02:00
Daniel Martí
2f80d37c24 Add name for 5.1 (22) 2015-04-07 10:44:33 +02:00
Daniel Martí
b18231c25d Don't shadow PreferenceFragment class name
I chose PreferencesFragment (plural) in concordance with PreferencesActivity.
2015-04-07 10:44:28 +02:00
Daniel Martí
dc86129cca More final keywords 2015-04-06 17:54:28 +02:00
Daniel Martí
822a75258c Shorten some logging tags 2015-04-02 09:46:32 +02:00
Peter Serwylo
d62a3c711d Correctly select swappable apps from list.
Previously, there was a bug with an off-by-one error, as android-11
or later was treating the headerView different to android-10 and
earlier. They now both have the same understanding about the header
view.
2015-04-02 16:20:23 +11:00
Peter Serwylo
ead4f449d6 Fix #211 - don't force every incoming intent to be a repo intent. 2015-04-02 09:42:48 +11:00
Daniel Martí
9e82463e46 More final keywords 2015-04-01 17:12:52 +02:00
Daniel Martí
05aa6a39fa Small cursor null, count and close() 2015-04-01 17:04:51 +02:00
Daniel Martí
0506160f7b Make use of List.contains(o) since it already does .equals() 2015-04-01 16:57:16 +02:00
Daniel Martí
ea559d0675 Add some final keywords
Especially in constants within classes, which allows for inlining.
2015-04-01 16:17:34 +02:00
Daniel Martí
bdbb6ce03a Outdent all switch cases 2015-04-01 13:27:23 +02:00
Daniel Martí
1295158de2 Small style fix to the last commit 2015-04-01 13:14:28 +02:00