Commit graph libervia-backend/sat/plugins/plugin_misc_android.py
Author SHA1 Message Date
Goffi
d2685ba11b refactoring: renamed sat package to libervia.backend 2023-06-02 11:49:51 +02:00
Goffi
1781694141 core: renamed messageReceived trigger to message_received 2023-05-29 13:32:08 +02:00
Goffi
6a6f15707a massive refactoring to switch from camelCase to snake_case:
historically, Libervia (SàT before) was using camelCase as allowed by PEP8 when using a
pre-PEP8 code, to use the same coding style as in Twisted.

However, snake_case is more readable and it's better to follow PEP8 best practices, so it
has been decided to move on full snake_case. Because Libervia has a huge codebase, this
ended with a ugly mix of camelCase and snake_case.

To fix that, this patch does a big refactoring by renaming every function and method
(including bridge) that are not coming from Twisted or Wokkel, to use fully snake_case.

This is a massive change, and may result in some bugs.
2023-04-08 13:54:42 +02:00
Goffi
47d258e841 plugin android: use callFromThread instead of callLater:
`callLater` is not made to be called outside of main thread, `callFromThread` is the
method to call in this case.
2021-09-08 11:17:13 +02:00
Goffi
018d09caaa Renamed the project from "Salut à Toi" to "Libervia":
This renaming follows the decision taken at the General Assemblee of January 27th 2021 (cf.
https://repos.goffi.org/sat_docs/raw-file/tip/association/2021-01-27%20-%20compte%20rendu%20de%20l%27AG%20extraordinaire.pdf)
2021-03-20 20:42:04 +01:00
Goffi
dc86957043 date update 2021-03-19 15:45:14 +01:00
Goffi
e573f7f627 plugin android: use certifi SSL root certicates 2020-04-01 22:28:50 +02:00
Goffi
3b64263f3b core: renamed "MessageReceived" trigger to "messageReceived" for consistency. 2020-02-18 18:13:19 +01:00
Goffi
104902f076 core (xmpp), plugin android: fixed DNS, SRV handling on Android:
Android doesn't have a "/etc/resolv.conf" that Twisted expect. As a result, SRV records
can't be checked correctly on connection.

To work around that, DNS servers used on Android are checked when necessary (on Android
plugin startup and on connectivity change), using some hacks, and Twisted is patched to
use them.
2020-02-09 23:56:42 +01:00
Goffi
120289f08f plugin android: attach an action dict to notification:
instead of calling plyer's generic notify, AndroidNotification is now inherited to add a
SàT specific behaviour: a "sat_action" dictionary is now attached, to indicate to the
frontend what to do when the notification is opened.
2020-02-03 13:49:45 +01:00
Goffi
e1a44cf4e4 fixed shebangs 2020-01-29 10:07:00 +01:00
Goffi
a39349fe64 dates update 2020-01-29 09:50:54 +01:00
Goffi
c951c67698 plugin android: reconnect profiles with autoconnect if network is activated:
if network is activated, we check that all profiles with autoconnect are indeed connected,
and reconnect them if necesssary.
2020-01-26 18:08:09 +01:00
Goffi
a485709173 plugin android: added a profileAutoconnectGet method:
this method will be called by frontend to know which profile to connect automatically
(when the frontend has been closed and is reopened, this will avoid to have to go through
the profileManager again).
2020-01-25 21:08:41 +01:00
Goffi
2555649dfb plugin android: sound notification + change settings:
- new notification sound
- vibration and notification sound are now activated depending on ringer mode (normal,
  vibrate or silent)
- notification sound/vibration can be configured in settings.
2020-01-03 13:21:27 +01:00
Goffi
3e07cd6c01 plugin android: removed comment on vibrator bug as it is fixed in dev version of plyer 2019-12-20 12:28:04 +01:00
Goffi
5bfb675a29 plugin android: fixed encoding in states after Python 3 port 2019-10-16 08:39:52 +02:00
Goffi
fbfe96c505 Python 3 port:
/!\ this is a huge commit
/!\ starting from this commit, SàT is needs Python 3.6+
/!\ SàT maybe be instable or some feature may not work anymore, this will improve with time

This patch port backend, bridge and frontends to Python 3.

Roughly this has been done this way:

- 2to3 tools has been applied (with python 3.7)
- all references to python2 have been replaced with python3 (notably shebangs)
- fixed files not handled by 2to3 (notably the shell script)
- several manual fixes
- fixed issues reported by Python 3 that where not handled in Python 2
- replaced "async" with "async_" when needed (it's a reserved word from Python 3.7)
- replaced zope's "implements" with @implementer decorator
- temporary hack to handle data pickled in database, as str or bytes may be returned,
  to be checked later
- fixed hash comparison for password
- removed some code which is not needed anymore with Python 3
- deactivated some code which needs to be checked (notably certificate validation)
- tested with jp, fixed reported issues until some basic commands worked
- ported Primitivus (after porting dependencies like urwid satext)
- more manual fixes
2019-08-13 19:08:41 +02:00
Goffi
303f82d012 plugin android: catch and log exception when using the vibrator:
vibrator is currently not working with plyer, this patch avoid a crash and log the issue.

rel 332
2019-07-20 20:53:52 +02:00
Goffi
30bf1362bb plugin android: check connectivity
use Android API to retrieve connectivity informations (connection availability + kind of connection).
Register to connectivity change broadcast, new client.networkEnabled/client.networkDisabled are called when suitable.
2019-04-06 19:05:58 +02:00
Goffi
7faaa9691b plugin android: fixed csi_timer reset in setActive + crash on call of isActive before session initialisation 2019-04-05 21:22:03 +02:00
Goffi
598f4e465e plugin android: use XEP-0352 to indicate (in)active state:
Client State Indication plugin is used to set state when pause/resume is called.
The state is changed on pause only after a delay (currently 30s), to avoid changing state if use is only checking something quickly on an other app.
2019-03-25 07:08:26 +01:00
Goffi
d58fbe6170 plugin android: workaround to seek() bug, fixing file upload:
seek() is bugged on current version of P4A, arguments are inverted.
More details can be found at https://github.com/kivy/python-for-android/issues/1768
2019-03-25 07:06:41 +01:00
Goffi
8ce1861529 plugin android: don't send notification if message comes from ourself (from an other device) 2019-03-16 14:39:02 +01:00
Goffi
248d771176 plugin android: improved state handling:
state handling is not using mmap anymore but an unix socket instead.
State change can now be managed.
Bridge signals are disabled when frontend is paused.
2019-03-09 16:23:01 +01:00
Goffi
8e338bf913 date update 2019-01-12 12:25:31 +01:00
Goffi
e3f279e718 plugin android: fixed path for .cagou_status 2019-01-04 19:12:43 +01:00
Goffi
744cb0c503 code style reformatting using black 2018-06-27 20:14:46 +02:00
Goffi
80ef13612b core, setup: huge cleaning:
- moved directories from src and frontends/src to sat and sat_frontends, which is the recommanded naming convention
- move twisted directory to root
- removed all hacks from setup.py, and added missing dependencies, it is now clean
- use https URL for website in setup.py
- removed "Environment :: X11 Applications :: GTK", as wix is deprecated and removed
- renamed sat.sh to sat and fixed its installation
- added python_requires to specify Python version needed
- replaced glib2reactor which use deprecated code by gtk3reactor

sat can now be installed directly from virtualenv without using --system-site-packages anymore \o/
2018-04-02 19:44:50 +02:00
Renamed from src/plugins/plugin_misc_android.py (Browse further)