422 Commits

Author SHA1 Message Date
Daniel Martí
8669fddd70 Properly log exceptions 2015-08-20 19:21:50 -07:00
Daniel Martí
ce8c928337 Move some Log.i to debug logs
These don't look like they will be useful to users at all.
2015-08-20 19:09:27 -07:00
Daniel Martí
c9cdc1a5dc Remove all Log.d calls from release builds 2015-08-20 18:59:14 -07:00
Daniel Martí
d04f26b6e4 Raise some log message priorities 2015-08-20 18:59:13 -07:00
Daniel Martí
96014a7365 Simplify debugging logging via Utils 2015-08-20 18:37:25 -07:00
Daniel Martí
2d14e3c1c4 Temporarily work-around for repo update crashes
On certain locales, F-Droid would crash at startup due to #334.

This isn't a proper fix, but rather a workaround that logs what happened and
links to the issue, instead of making F-Droid crash entirely.
2015-08-20 17:49:57 -07:00
Daniel Martí
05285d23b7 Replace fdroid.org with f-droid.org 2015-08-20 10:06:01 -07:00
Daniel Martí
e4527da122 Prepare for sdk level 23 2015-08-20 09:56:57 -07:00
Peter Serwylo
133cabeed8 Let user select wifi network. Prevent "Send F-Droid" if no bluetooth.
Include support for libaccesspoint to control the WiFiAP of a device.

Selecting wifi networks i snow possible by touching the name of the
wifi network in the "Start Swap" screen (sometimes it will say
"No network yet"). This exhibits the same behaviour as the "Join Wifi"
screen used to (and still does) do.

On emulators (is there other devices too?), Bluetooth is unavailable,
but the "Send F-Droid" is still there. I could remove it, but then
people may get confused as to why it is not there. Instead, there is
now a dialog which explains why it can't be sent (no Bluetooth).
2015-08-20 21:46:07 +10:00
Daniel Martí
3f5b5ffc93 Avoid package receiver NPE crashes. Fixes #380. 2015-08-19 11:19:59 -07:00
Daniel Martí
780f77dab9 Don't show menu item to enable NFC if not available
Follow-up to #379
2015-08-18 14:16:50 -07:00
Daniel Martí
fd7f942595 Avoid NPE crash on devices without NFC. Fixes #379. 2015-08-18 13:14:13 -07:00
Peter Serwylo
b05080bbd9 Enable "Send F-Droid" in main swap screen. 2015-08-18 19:26:48 +10:00
Peter Serwylo
a82032d5d0 Fixing lint errors in swap WIP branch but not master. 2015-08-17 22:59:51 +10:00
Peter Serwylo
2008708cd9 Change bluetooth response to remove deprecated warning.
The StringBufferInputStream is deprecated, because it doesn't know the
encoding of the string it is buffering. This has been changed to use
a ByteArrayInputStream with UTF-8 encoding now.

Also made use of previously unused mimeType parameter to set the
Content-Type header of the response.
2015-08-17 17:15:42 +10:00
Peter Serwylo
99ebc84a91 Show message when touching the QRCode button, but swap isn't enabled.
Also cleaned up a doc comment in the swap activity, and minor
formatting of swap related strings in strings.xml.
2015-08-17 17:15:08 +10:00
Peter Serwylo
930c906460 Allow bluetooth:// URLs to be parsed by java.net.URL.
Sets a stream handler in FDroidApp which understands bluetooth://
URLs and returns a non-functioning URL handler for such URLs.
The reason it is  non-funcitoning is because the openConnection()
function is not being used by the BluetoothDownloader at this point.

In the absense of this, a MalformedURLException is thrown.

The bluetooth stuff is still broken, but it is not broken in
this way any more.
2015-08-17 08:08:49 +10:00
Peter Serwylo
6bfd76caf2 Search now works when choosing swapped apps to install.
Was incorrectly parsing the URI in order to build a query for the database.
2015-08-17 00:00:30 +10:00
Peter Serwylo
e53a56f7b2 Show "preparing local repo" stuff in activity, not dialog.
Use the same view as when downloading a swap index. This means
no more progress dialogs, and no more Toasts when finished, which
is good.
2015-08-16 23:32:37 +10:00
Peter Serwylo
1ea35f6977 Remove unused AppDetails subclass. Show download progress for swap.
The AppDetails subclass used to be used when you couldn't install apps
directly from the swap workflow. Now we don't send people to app
details, so the activity is unneeded.

The swap progress also now listens for progress broadcasts, rather than
showing an indeterminant progress bar.
2015-08-16 17:29:56 +10:00
Peter Serwylo
2868e3c4f1 Allow apks to be installed from swap. Show feedback while downloading.
Seems to work pretty-alright even when installing multiple apps.
Shows a progress (indeterminent at this stage) bar for each downloading
item, and hides the install button.
2015-08-16 11:31:02 +10:00
Peter Serwylo
d672983a90 Refactor toolbar colours, fix notification for < 4.1 devices.
InnerView.getToolbarColour() was expecting a @ColorRes, except all views
were returning integers which were the colour value, not a pointer to
the resource as they should have been. Now only one place requires a
call to getResources().getColor() whereas before it was in each view.

Notifications on pre 4.1 devices require a pending intent to work. This
is so that when you touch the intent, it takes you somewhere meaningfull.
Without it, the update process crashes.
2015-08-16 08:34:05 +10:00
Daniel Martí
d9ed0ffb0d Merge branch 'installer-patches' 2015-08-15 14:01:03 -07:00
Daniel Martí
0e3172b277 Use mkdir -p instead of mkdir to not error if already existing
See #364
2015-08-12 13:41:13 -07:00
Daniel Martí
98117b19c0 Make sure that our system folder is 755
See #364
2015-08-12 13:41:02 -07:00
Daniel Martí
e434f39839 Android Studio fixes 2015-08-12 13:33:43 -07:00
Daniel Martí
e895d1f0d3 Merge branch 'master' into 'master'
Add timeout for Http request

The timeout of HttpURLConnection is 0, which means the request would never return if either connection or read timeouts, and the code would never catch these exceptions.

This patch set explicit timeout value (10s for connection timeout and 40s for read timeout), so the code would catch and handle timeout exceptions as you would expect.

Best,

See merge request !117
2015-08-11 00:20:17 +00:00
Daniel Martí
14cd500121 Remove unnecessary uses of getString(int) 2015-08-10 17:11:51 -07:00
Daniel Martí
eab27d402b Update install/uninstall internal error codes to 5.1 2015-08-10 17:11:51 -07:00
Daniel Martí
816bd4b2e6 Start reporting proper install/uninstall error messages 2015-08-10 17:11:50 -07:00
Daniel Martí
79b1396e4a Disable uninstall button if the app cannot be uninstalled
Fixes #329
2015-08-10 17:11:50 -07:00
Daniel Martí
ba54e8b798 SystemInstaller: don't try to remove system apps without updates 2015-08-10 17:11:50 -07:00
Daniel Martí
4e0808449d InstallIntoSystem: Apks are fine being 644, no need for 655
See #364
2015-08-10 17:08:01 -07:00
Daniel Martí
052f411433 InstallIntoSystem: add missing trailing '/'
See #364
2015-08-10 16:54:50 -07:00
Daniel Martí
ddb94cc831 Cleanup "Downloading..." icon if download fails 2015-08-10 14:56:33 -07:00
Miku Nyan
a4fe44437a fix #361 2015-08-10 21:44:20 +03:00
Daniel Martí
d6dcf6bf7b Don't prompt users to install into system until it's stable
Right now there are multiple issues - #294, #346, #347, #348 - so telling
people to go through the process at startup should not happen yet.
2015-08-09 12:12:41 -07:00
Daniel Martí
56ff9d1353 Re-add lightWithDarkActionBar enum item (fixes #340)
Added it in the same position as it was originally.
2015-08-09 12:12:28 -07:00
Daniel Martí
9cafe80763 Merge branch 'betaUpdates' into 'master'
Prompt for beta updates

Ready to get merged. 👍

~~This MR is ready to get merged, the last thing that needs to be fixed is [this](72ed814a73 (note_1726274)).~~

This closes #313.

See merge request !112
2015-08-09 18:33:09 +00:00
Peter Serwylo
0b160d2e04 WIP: hooking up ApkDownloader to swap apps. 2015-08-09 22:12:56 +10:00
Peter Serwylo
ba6d2e7793 WIP: Fixing styles and removing unused styles. 2015-08-09 22:12:55 +10:00
Peter Serwylo
5ee8307703 Merge branch 'master' into new-swap--updated-downloader
Fixed multiple conflicts to do with the repo updater moving to
broadcasts from the previous progress listeners.
2015-08-09 22:12:09 +10:00
Peter Serwylo
2b8a882933 Merge branch 'integration/mr-102-and-107' into 'master'
Integration branch containing both MR 102 and 107

Given both MR !102 and !107 both stood on eachothers feet to some extent, this branch contains all commits from both in an integration branch. If both @Nutomic and @eighthave are happy that it faithfully kept their changes during the minor merge conflict resolutions, then we can merge this instead of those two branches. 

* !102 changed download progress from events + listeners to broadcasts + receivers.
* !107 made use of download progress events + listeners to show a downloading UI that was embedded in the activity, rather than shown as a modal dialog.

The conflicts which arose while I merged these branches together were in `AppDetails`. I made it so that, to the best of my ability, it uses broadcast receivers instead of progress listeners when updating the progress bar. Other than that, the only other conflict was both trying to store a reference to the main button from the UI. The only changes were in naming (mainButton vs btMain) and also in the place where the local variable was assigned (onCreate() vs setupViews() which is called during onCreate() anyway).

After merging, I did some minor cleanups. This is because in the process of checking that my conflict resolution compiled, I thought it best to remove a bunch of warnings from `AppDetails` and others. Turns out that by doing so, I found a bug due to the integration (to do with the `AppDetails` querying the downloader for status in `onResume()` rather than waiting for a broadcast event) so I'm glad I did so.

Let me know what you think, and then after the next stable, we can go ahead and merge this if people are happy.

p.s. I have no idea why GitLab is showing @eighthave's commit at the top of the list of commits, after my integration related commits.

See merge request !114
2015-08-09 06:09:54 +00:00
xinxin
e3140573ac Add timeout for Http request 2015-08-08 19:04:16 -07:00
Daniel Martí
f1901d75ac Remove leftover lightWithDarkActionBar enum item 2015-08-03 17:52:31 -07:00
Daniel Martí
bdb71d828f Have the light theme as the default throughout
It was changed in preferences.xml, but not in the manifest and in the default
case in the Java code.
2015-08-03 17:45:32 -07:00
Peter Serwylo
cbd8c977e2 Use annotations to remove lint warnings.
Also removed undocumented java doc.
2015-08-03 22:59:47 +10:00
Peter Serwylo
215dcc0dd9 Don't use Notification class, but rather NotificationCompat. 2015-08-03 22:59:46 +10:00
Peter Serwylo
f3a9581d89 Fix warnings in app details (remove progress thingo).
AppCompat no longer supports progress indicators in the action bar. So
this is not your everyday "Deprecated, but sure, keep using it" job.
Rather, it is "deprecated, and no, we wont even let you use it."

Also removed unused argument and extended AppCompatActivity.
2015-08-03 22:59:46 +10:00
Peter Serwylo
a0bf49d1ea Reinstate code to allow resumed activity to query download status (rather than wait for broadcasts). 2015-08-03 22:59:46 +10:00