Skip to content
Snippets Groups Projects
  1. May 03, 2016
  2. May 02, 2016
    • Daniel Martí's avatar
      Merge branch 'cleancacheservice' into 'master' · 3563e586
      Daniel Martí authored
      CleanCacheService
      
      This creates `CleanCacheService` to do all of the cache clean up at the lowest possible priority.  It also adds a preference to set how long to keep cached APKs.
      
      See merge request !260
      3563e586
    • Daniel Martí's avatar
      Merge branch 'updater-speed-improvements' into 'master' · e3ebab9b
      Daniel Martí authored
      Updater speed improvements during "Saving Application Details"
      
      I've been able to reproduce #324 OutOfMemory errors on an emulator with 12MiB of heap space. This branch did _not_ have an OOM error when updating with F-Droid and F-Droid Archive repos enabled. They successfully update without problem.
      
      Fixes #45.
      
      The "Saving Application Details" stage of repository updating is where each apk has its suggested version calculated, icon URLs calculated, etc. These all require [correlated subqueries](https://en.wikipedia.org/wiki/Correlated_subquery) resulting in a full scan of the apk table for each row in the app table. This takes in the order of 25 seconds on my Moto X 2nd Gen.
      
      This branch improves this process by doing the queries in an [sqlite in-memory database](https://sqlite.org/inmemorydb.html), with the results transferred to the database on disk when done. The time required drops from 25 seconds to ~0.5 seconds on my device.
      
      *Note:* I was hoping this would also improve the "Processing ..." Part of the udpater, given it was inserting into an in memory table instead of on disk. If it did have any effect, it was negligible though, so that part is still likely slower than it could be. Each 50 apps (and their associated apks) takes between 150ms and 500ms on my Moto X.
      
      *Secondary Note:* When creating the in memory database, I create indexes for some columns as per before. This technically should slow down the inserts we do, however in practice they had almost no effect. As such, I've left the index creation there because it is required for the correlated subqueries to not suck. 
      
      See merge request !269
      e3ebab9b
    • Hans-Christoph Steiner's avatar
      remove cosmetic changes to security sensitive code: RepoUpdater · 77052c2b
      Hans-Christoph Steiner authored
      Security-sensitive code should not be changed unless there is a good reason
      to do so.  It is too easy to introduce bugs.  This change does not address
      an issue, so I'm reverting it. See comment in javadoc header for the class.
      
      This reverts commit 20747183 for just the
      RepoUpdater.java file.
      77052c2b
    • Hans-Christoph Steiner's avatar
      add preference to set the time to keep cached APKs · cbf1bda4
      Hans-Christoph Steiner authored
      This schedules CleanCacheService to run regularly, and delete files older
      than the value set in the new "Keep cached apps" preference. It auto-
      migrates the old "Cache packages" pref to the new one.  The default cache
      time for people who did not have "Cache packages" enabled is one day.
      cbf1bda4
    • Hans-Christoph Steiner's avatar
      clean up cached files in a low priority IntentService · 83ee0c8f
      Hans-Christoph Steiner authored
      This moves the cache file deletion to a dedicated IntentService that runs
      at the lowest possible priority.  The cache cleanup does not need to happen
      with any kind of priority, so it shouldn't delay the app start or take any
      resources away from foreground processes.
      
      This also changes the logic around the "Cache packages" preference. The
      downloader always saves APKs, then if "Cache packages" is disabled, those
      APKs are deleted when they are older than an hour.
      
      This also simplifies Utils.deleteFiles() since the endswith arg is no
      longer needed.
      83ee0c8f
    • Hans-Christoph Steiner's avatar
      make Utils.getApkCacheDir() more likely to succeed · 6fa84776
      Hans-Christoph Steiner authored
      * if there is a file there, remove it
      
      The paths are all from the system, so are safe. No SanitizedFile is needed.
      Plus, this method was not checking if the original and sanitized versions
      where different, and instead just creating the sanitized version. I worry
      that could cause odd bugs.
      6fa84776
    • Hans-Christoph Steiner's avatar
      move init sequence comments to javadoc comments · 6c47ade3
      Hans-Christoph Steiner authored
      By putting these comments into javadoc, they are directly describing the
      code where it is, and there are many tools in IDEs for searching, viewing,
      sorting, etc. javadoc comments.  Plain comments do not have those tools.
      6c47ade3
    • Hans-Christoph Steiner's avatar
      remove unused arg from FileCompat.setReadable() · 972ef3b0
      Hans-Christoph Steiner authored
      Just trying to keep the code as close to what is actually used as possible.
      972ef3b0
  3. May 01, 2016
  4. Apr 30, 2016
  5. Apr 29, 2016
  6. Apr 28, 2016
  7. Apr 27, 2016
    • Peter Serwylo's avatar
      Don't do a subquery in a subquery in a subquery. · ab248525
      Peter Serwylo authored
      This was there as a workaround for #1, but that has subsequently
      been fixed. Thus, the hack is no longer required. Also removed an
      additional `AND` because it is already performed in the `JOIN`.
      I supsect this last one would've been eliminated by the sqlite
      optimizer anyway, but the query is slightly simpler now.
      
      This fix doesn't improve performance as much as I'd hoped, but it
      is something.
      ab248525
    • Daniel Martí's avatar
      Add Estonian (et, Eesti) to the langs list · fdd441c3
      Daniel Martí authored
      Its first translations were added in the previous commit, pulled from
      Weblate.
      fdd441c3
    • F-Droid Translatebot's avatar
      Pull translation updates from Weblate · 9faa84fa
      F-Droid Translatebot authored
      Translators:
      
      Danial Behzadi            Persian
      fastest noob              Turkish
      Fert Bálint               Hungarian
      Green Lunar               Hebrew
      Jean-Baptiste             French
      Karola Marky              Japanese
      Kristjan Räts             Estonian
      Licaon Kter               Romanian
      Marian Hanzel             Slovak
      Mohamad Hasan Al Banna    Indonesian
      naofum                    Japanese
      Tobias Bannert            German
      YFdyh000                  Simplified Chinese
      9faa84fa
  8. Apr 26, 2016
  9. Apr 25, 2016
  10. Apr 24, 2016
    • Daniel Martí's avatar
      Get rid of Log.d calls in src/main · 87a4cfb2
      Daniel Martí authored
      Also, Log.d in tests don't make much sense - replace by Log.i. This way
      it's easier to limit all Log.d calls to Utils.java.
      87a4cfb2
    • Daniel Martí's avatar
      Fix NPE when clicking on missing app links · 70da6eaa
      Daniel Martí authored
      This happened to me when I clicked on an app link for a new app which
      was already in the repo, but I had not ran an index update yet since the
      app got built. Stack trace prior to the fix follows.
      
      	java.lang.RuntimeException: Unable to destroy activity {org.fdroid.fdroid/org.fdroid.fdroid.AppDetails}: java.lang.NullPointerException:
      	Attempt to invoke virtual method 'void android.support.v4.content.LocalBroadcastManager.unregisterReceiver(android.content.BroadcastReceiver)' on a null
      	object reference
      		at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3865)
      		at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3883)
      		at android.app.ActivityThread.-wrap5(ActivityThread.java)
      		at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1417)
      		at android.os.Handler.dispatchMessage(Handler.java:102)
      		at android.os.Looper.loop(Looper.java:148)
      		at android.app.ActivityThread.main(ActivityThread.java:5461)
      		at java.lang.reflect.Method.invoke(Native Method)
      		at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
      		at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
      	Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void
      	android.support.v4.content.LocalBroadcastManager.unregisterReceiver(android.content.BroadcastReceiver)' on a null object reference
      		at org.fdroid.fdroid.AppDetails.unregisterDownloaderReceivers(AppDetails.java:469)
      		at org.fdroid.fdroid.AppDetails.onDestroy(AppDetails.java:569)
      		at android.app.Activity.performDestroy(Activity.java:6422)
      		at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1143)
      		at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3852)
      		... 9 more
      70da6eaa
    • Daniel Martí's avatar
      CONTRIBUTING: Add Android.mk gradlew note · e8605031
      Daniel Martí authored
      See #632.
      e8605031
  11. Apr 23, 2016
Loading