1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-24 14:00:48 +02:00
Commit Graph

375 Commits

Author SHA1 Message Date
Andreas Shimokawa
6f51d96879 bump version, update changelog 2018-11-17 16:43:14 +01:00
Andreas Shimokawa
7cf6a59420 fix everything 2018-11-17 16:35:37 +01:00
Andreas Shimokawa
b228c7b061 bump version, add changelogs 2018-11-15 20:30:15 +01:00
Andreas Shimokawa
59f8e72410 Notification actions refatoring and fixes
- Fixes "Mute, Open, Dismiss" to work again on pebble
- Greatly reduces complexity in PebbleProtocol, since all logic for adding specific reply actions to notification have been moved to generic code

Fixes the rest of #1336 (the part that says "Additionally, dismissing a notification on the watch no longer dismisses it on the Android device")
2018-11-15 15:53:04 +01:00
Andreas Shimokawa
bd874089d0 Ignore group summary of k9 notifications
Fixes part of #1336
2018-11-14 23:59:26 +01:00
Andreas Shimokawa
17a82f09f2 Pebble: Temporarily disable broken autoremove notification feature 2018-11-03 20:49:49 +01:00
Daniele Gobbetti
549dfce2e7 Pebble: generalize handling of incoming actions (from watch)
Also add missing casts back to int in NotificationListener
2018-11-01 19:40:26 +01:00
Andreas Shimokawa
e54f1eaccc SMS: add reply action in generic code (no longer explicitly handled in PebbleProtocol) 2018-11-01 16:58:20 +01:00
Daniele Gobbetti
eede85a9c9 Various improvements and bugfixes to notification handling
Prevent duplicate notifications with a dedicated data structure (not reusing
the anti-burst one) #1062, #657
Pebble: Forward the actions attached to notifications (not only reply)
inspired by the work of dnastase #705
2018-10-31 21:47:12 +01:00
Daniele Gobbetti
b9999edf2a Ignore notifications that are older than the last forwarded one for the
same source.

This reuses the data structure populated to prevent overflow, but avoids
to forward notifications that are older than the reference.
2018-10-29 18:39:38 +01:00
Daniele Gobbetti
29dc806fb1 Ignore notifications that are older than 1 second
In case of grouped notifications, we get multiple notifications
also if the android device shows only one.

This means that with this change the most recently updated chat
will get through, but others will not.

This should help with #1062 and #657
2018-10-28 18:03:01 +01:00
cpfeiffer
08595f4e3d Avoid autoboxing 2018-09-15 22:52:30 +02:00
Johannes Tysiak
d4ea5dfd44 Fix caller ID for incoming calls on Android 9
Fixes #1252
2018-09-05 20:41:01 +02:00
License Bot
696653eabf Update contributors list and license headers. 2018-08-29 21:30:23 +02:00
José Rebelo
fa1e9b8938
Support minimum time between notifications 2018-08-19 11:07:58 +01:00
cpfeiffer
98cd54657a Avoid unnecessary boxing 2018-08-17 00:28:00 +02:00
Daniele Gobbetti
9517fa211e Intercept alarm actions of the google clock application
Implemented blindly based on the information provided in #1199
Fixes #1199
2018-08-10 18:36:29 +02:00
License Bot
225a600aed Update license headers 2018-06-25 18:35:46 +02:00
Daniele Gobbetti
2ca8e4a4e4 Forward notifications marked as local only if they are emitted by skype
Also add skype for business package name.

Blind implementation as I don't have access to these apps.

Fixes #1109
2018-06-18 20:52:26 +02:00
Daniele Gobbetti
4d0020ae1d Add the option the blacklist applications also for Pebble Messages
Fixes #996
2018-06-18 20:38:37 +02:00
Daniele Gobbetti
f1736808cb Auto connect at boot on recent androids respecting the user settings
Automatically connect at boot if gadgetbridge is configured to start at
boot and to attempt an automatic connection when bluetooth is available

Fixes #693 and fixes #891
2018-05-16 19:08:53 +02:00
Daniele Gobbetti
d109630e74 Use TelephonyManager getCallState() instead of the provided extras
According to the documentation the current call state might be not correctly
contained in the extra, and using getCallState() is the right thing to do

Might help for #799 (and #756)
2018-05-16 18:56:36 +02:00
Andreas Shimokawa
3f421facab Always cleanup device and receiver in service when disconnecting
Fixes #1093

I have no idea why the code was like this, so the change might have some bad consequences...
2018-05-11 20:50:29 +02:00
Andreas Shimokawa
965964a6b7 Weather: get wind direction and speed also from CM weather reciver 2018-04-14 21:56:10 +02:00
Daniele Gobbetti
cc83021ae3 Weather (and Pebble Webview): fix name and add wind information to weather data
Wind information are stored and put in the reconstructed OWM response.
A long standing bug (having the "name" field inside "main" instead of at
the root level of the json) has been fixed
Lineage OS receiver and if possible weather notification app receiver will
be added in further commits.

See #482
2018-04-14 19:42:05 +02:00
TaaviE
6be7ee4a96 Fixed a few misspells and extended my name. 2018-03-23 07:26:25 +01:00
License Bot
238bacde9f Update license headers 2018-02-26 14:27:33 +01:00
TaaviE
18cec2087f Changed API version and everything else required.
(cherry picked from commit db1a282)
2018-02-14 21:35:06 +01:00
Daniele Gobbetti
831303aea8 Fix regression introduced by 737578debc
With many thanks to https://github.com/80tf3262p8 who spotted the error

closes #975
2018-02-10 16:54:20 +01:00
Daniele Gobbetti
a29394b96e Omnijaws Weather: correctly pick todays' min and max temperature 2018-02-10 16:53:35 +01:00
Felix Konstantin Maurer
6cbb130bce Enable periodic export after boot 2018-01-09 22:41:27 +01:00
Daniele Gobbetti
888e7fa229 Add support for Omnirom Omnijaws weather service.
This uses a contentobserver and doesn't do anything if it's not available.
Should be feature equivalent to the LineageOS weather receiver.
2017-12-17 22:35:17 +01:00
Andreas Shimokawa
22eb69d1c2 read humidity from CM Weather provider 2017-12-14 15:10:14 +01:00
Andreas Shimokawa
948002dc7c Weather: recreate OWM fake reply from weatherSpec, no not directly create in in Weather Notification receiver
This should bring CM weather on par with Weather Notficication when using background js
2017-12-14 14:54:09 +01:00
Andreas Shimokawa
1752b1b51e fix cm/lineage weather not updating after changing location 2017-12-12 22:36:15 +01:00
Andreas Shimokawa
f0ac296492 Initial support for cyanogenmod/lineage weather provider
TODO:
- also reconstruct json for Pebble background js fake replies
- find a better location for settings
- interatively display candidates when looking up location
- grey out setting on non-cm/los devices
2017-12-11 19:09:37 +01:00
Andreas Shimokawa
0befc1a95e Weather refactoring
No longer save an instance of ParcelableWeather2, rely on our WeatherSpec instead which now has all forecast data and save reconstructed owm weather json in Weather
2017-11-30 10:24:31 +01:00
Andreas Shimokawa
879272deb7 Weather: refactoring and support forecast for more than one day 2017-11-29 23:57:36 +01:00
Zhong Jianxin
b4bbd0323c Combine multipart SMS message into messages by sender
When receive SMS message, instead of generating multiple notifications
by PDU size, after this change, there will be only one notification for
each sender.
2017-11-23 22:26:46 +01:00
Andreas Shimokawa
20208ca7a3 Work around non-working outlook notifications
See #851
2017-11-14 23:27:01 +01:00
Zhong Jianxin
2f443ad419 Allow WeChat notifications
It seems WeChat always mark its notifications as LocalOnly. The reason
may be to avoid double notifications when using Android Wear watches,
since WeChat has a standalone Android Wear app.

Do not ignore WeChat notifications even if they're marked as LocalOnly.
2017-11-11 16:14:35 +01:00
Andreas Shimokawa
9032e6d92c Change debug output in ACL connect receiver, to avoid further confusion 2017-10-25 22:27:41 +02:00
License Bot
8f06e36c00 Update license headers 2017-10-16 09:38:02 +02:00
Frank Slezak
6ec1555178 Add support for dynamic Pebble background colors (#819)
Pebble: Add support for dynamic Pebble background colors
- Add a couple additional icon types
  - Add Lighthouse (currently unused)
  - Add Transit (public transportation app)
- Tweak the colors on existing icon types
- Implement logic to grab primary (vibrant) color from app logo
  - The color will be used when displaying a notification for an app
    that does not have any configs bound to it.
- Alter NotificationType to support a color (named pebbleColor)
- Alter the Pebble notification poster to listen to the color from
  the notification
- Alter the DeviceCommunicationService to allow for color passthrough.
- Add logic to convert HEX or Integer representations of RGB888 colors
  to Pebble RGB222 format.
- make the package name retrieved lowercase.

Fixes: #815
2017-09-19 13:24:31 +02:00
cpfeiffer
962720145e Fix custom language being lost for newly created activities
So we do need to set the language both on change and onCreate()

For some reason, the title bar of the SettingsActivity is not updated on recreate().

Closes #787
2017-09-03 01:04:34 +02:00
Andreas Shimokawa
a5886cbb49 Revert "store UTC in weather timestamp"
It was already in UTC but I sucked

This reverts commit b9eedce13b.
2017-08-26 00:41:36 +02:00
Daniele Gobbetti
8aebf2d9d5 Null extras bundle should not be processed.
Blind attempt to address #778
2017-08-25 22:01:21 +02:00
Andreas Shimokawa
b9eedce13b store UTC in weather timestamp 2017-08-22 00:26:49 +02:00
Daniele Gobbetti
8cce2d1362 Pebble: allow to blacklist certain calendars
As requested in #736, this adds an entry in the settings menu that allows to blacklist certain calendars.
To avoid confusion, all the former blacklist methods and fields have been renamed to apps_blacklist. The new entries are called calendars_blacklist.
Importing the settings has not been tested with the current changes.
Closes #736

Future improvements TODO: The new setting lives in the Pebble section, i believe in the future the blackslist functionality should be centralized and put in the sidebar.
2017-08-18 10:34:42 +02:00
Daniele Gobbetti
737578debc The good parts of "refactor notification management"
- centralize the logic for skipping unwanted notifications
- use *Compat methods wherever possible

Leaving out the problematic parts (persistent IDs and updating)
2017-05-28 18:50:41 +02:00
Andreas Shimokawa
a1690700f4 Revert "Refactor notification management"
This reverts commit cede8a0826.
2017-05-10 22:26:02 +02:00
Andreas Shimokawa
4591f07bcd Revert "Parse the EXTRA_MESSAGE bundle in the notification, if present."
This reverts commit bc28990a96.
2017-05-10 22:25:46 +02:00
Andreas Shimokawa
805a38ae3c Merge branch 'notification-refactor' 2017-05-08 22:22:34 +02:00
Andreas Shimokawa
b475fd2dc7 Just disconnect if bluetooth gets turned off, do not quit all activities. 2017-05-01 17:33:34 +02:00
Daniele Gobbetti
bc28990a96 Parse the EXTRA_MESSAGE bundle in the notification, if present.
This way notifications are updating for the Conversations app.
2017-04-29 23:22:03 +02:00
Daniele Gobbetti
cede8a0826 Refactor notification management
- centralize the logic for skipping over unwanted notifications
- use *Compat methods wherever possible
- use unique and persistent ID (update notifications)
- switch to using BigText style by default (since we can now update existing notifications)
- for Pebble: delete and reinsert notification as updating is not possible
2017-04-28 18:03:19 +02:00
cpfeiffer
f1fbab7dd9 Revert "Revert "Adjust test case setup and fix failing tests""
This reverts commit b0384e90d5.
2017-04-27 07:57:57 +02:00
Andreas Shimokawa
b0384e90d5 Revert "Adjust test case setup and fix failing tests"
This reverts commit d9b0d639b8.
2017-04-27 07:39:36 +02:00
License Bot
8af9054f2d Update license headers 2017-04-26 00:14:25 +02:00
cpfeiffer
d9b0d639b8 Adjust test case setup and fix failing tests
- add missing call super.setUp() in LoggingTest
- make use ofGBApplication's logger and db support instead
  of adding specific test things. Avoids differences between
  the local test things and the global GBApplication instances.
2017-04-25 21:55:06 +02:00
Daniele Gobbetti
fae116d1bd Add Calendar related tests (WIP) 2017-04-24 13:50:53 +02:00
Daniele Gobbetti
f06298a3c8 Fix some lint errors and warnings:
- check the calling Intent action when autostarting
- replace the FAB + image with a vector drawable
2017-04-23 12:43:13 +02:00
cpfeiffer
2003d56190 Cleanup package blacklist handling
Didn't find a cause for #664, though.
2017-04-22 16:59:55 +02:00
Andreas Shimokawa
965ba190a6 Calendar Sync: Fix location not being passed to device code
Now location is displayed on the pebble ;)
2017-04-21 10:51:06 +02:00
Andreas Shimokawa
15fb71337b Calendar Sync: Fix inverted logic when comparing hashes from db
Also improve debug output
2017-04-20 20:08:16 +02:00
Andreas Shimokawa
5717379aec Pebble: change timeline layout to "calendar" for calendaar events and display end time 2017-04-20 10:40:28 +02:00
Andreas Shimokawa
a28d27839f Merge branch 'master' into feature-calendarsync 2017-04-19 20:19:15 +02:00
Daniele Gobbetti
3ef5f5b811 Add support for all day events and add location in the CalendarEventSpec
Further: fix the hashCode method to properly deal nulls fields.
2017-04-19 17:44:02 +02:00
Andreas Shimokawa
546b68ad2d Calendar Sync: detect changed events by hash code 2017-04-19 14:52:07 +02:00
João Paulo Barraca
9f0d260e7a HPlus: Improve connection process (#651)
* Clean HPlus services and characteristics
* Improve connectivity
2017-04-18 10:47:28 +01:00
Andreas Shimokawa
35efa30c4b Calendar Sync: Only enable calendar broadcast receiver when device is initialized
This excludes it from any auto connect logic.
We are now save to sync the calendar once in contructor.
2017-04-17 21:09:29 +02:00
Daniele Gobbetti
1e231e6129 Move the Calendar receiver code in the proper place. 2017-04-17 20:33:39 +02:00
Daniele Gobbetti
61690eb2cc Get notified when calendar events change instead of polling. 2017-04-17 20:26:33 +02:00
Andreas Shimokawa
df0e77f368 Calendar Sync: Make greendao .update() work by adding a PK id :/ 2017-04-16 21:08:49 +02:00
Andreas Shimokawa
9970f8017f Calendar sync: save sync status to db to avoid leakage of deleted events
We now have a per device database that tracks sync states for calendar entries
We still cannot track changed calendar entries that where changed while we were disconnected
2017-04-16 19:37:43 +02:00
Daniel Hauck
ccb58f0f3c Basic calendar sync using additional receiver (#654) 2017-04-16 12:34:37 +02:00
Andreas Shimokawa
742615c6f4 prevent rare NPE in onNotificationRemoved() 2017-04-02 00:04:55 +02:00
Andreas Shimokawa
7a6b0ed2b0 support material fork of K9 2017-03-16 17:24:15 +01:00
License Bot
e392fbfd80 Add license header to all java files. 2017-03-10 14:53:19 +01:00
cpfeiffer
e5d09b9fa2 Automatically start the service on boot (can be turned off)
Fixes #9
2017-02-17 23:24:44 +01:00
Avamander
23f2dd35d4 Extract music shuffle and repeat states and set the song progress to auto-update. (#554) 2017-02-17 09:01:37 +01:00
Avamander
fea31924ba Music data handling improvements (#550)
* Fixed extracting the track length.

* Added current track and total track count.

* Few small changes to make sure everything gets updated properly.

* Remove unnecessary includes.
2017-02-11 09:49:01 +01:00
Andreas Shimokawa
f956d94181 Pebble: make sure to not display "open on phone" and "dismiss" when the source of a notification was our AlarmClockReceiver 2017-02-10 23:11:21 +01:00
cpfeiffer
0042ffc514 Set the notification ID on alarm start 2017-02-10 22:52:55 +01:00
Andreas Shimokawa
f35e3e460d remove K9 receiver as is works better with generic notifications 2017-02-09 17:35:46 +01:00
Andreas Shimokawa
436a7ddb24 Pebble: fix alarm notifications only working one
id -1 means undefined, everything else is liked to a real android notification
2017-02-09 15:07:00 +01:00
cpfeiffer
4f0674d038 Support for alarm clock notifications for Mi1 + Mi2 #538
No support for Pebble and HPlus for now.

Atm relies on the CM deskclock alarm, which nicely broadcasts
events about the current alarm. See
https://github.com/CyanogenMod/android_packages_apps_DeskClock.git
2017-02-07 23:49:10 +01:00
Daniele Gobbetti
b894c01822 Make the media notification receiver more robust.
Sometimes the media notification does not contain the expected components, hence the code covered by the try/catch has been adjusted. This was reported in #533 for VLC.
In the future the whole media handling will probably be refactored.
2017-02-05 15:13:26 +01:00
Daniele Gobbetti
e08a900978 Refactor the MusicPlaybackReceiver and related files
Add actions to the filter (this should help with #536)
Add "copy" constructors to MusicSpec and MusicStateSpec, and use those when receiving an updated intent, this way partial updates do not disrupt the local information.
Iterate over incoming extra keys, explicitly check the incoming type and use only known type. This could help with #533

Possible problem: this code iterates over every key of the incoming bundle.
2017-02-01 22:55:40 +01:00
cpfeiffer
d030ad9400 Ups, remove accidental import from C&P 2017-01-29 23:06:40 +01:00
cpfeiffer
b157f84b83 Log connection attempt when BT is turned on 2017-01-29 22:56:56 +01:00
cpfeiffer
13af1c1e11 Ignore Gadgetbridge's own notifications
Fixes #411
2017-01-27 00:23:45 +01:00
Daniele Gobbetti
26a349210e Pebble: make the text in the dummy weather configuration activity visible. 2017-01-15 18:19:30 +01:00
Andreas Shimokawa
d9d153c463 move WeatherNotificationConfig.java to its previous location to fix a crash 2017-01-15 12:43:26 +01:00
Andreas Shimokawa
ce67bf2c52 Pebble: make the feature to automatically delete notifications from the pebble optional
(This is not pebble specific at all but as long as other devices do not use that it will stay in the Pebble specific preference screen)
2017-01-15 00:10:40 +01:00
cpfeiffer
1e24fa7ad8 Dummy weather notifucation config activity 2017-01-14 00:26:47 +01:00
Andreas Shimokawa
fda317671a Ignore summary information for k9 mail
(#373)
2017-01-09 18:34:22 +01:00
Andreas Shimokawa
8c0f5599a1 Do not try to remove notifications from the device in some obvious cases 2017-01-09 16:49:11 +01:00
Andreas Shimokawa
3644d5e7a6 Pebble: remove notifications when dismissed on the phone (#326)
Most of the code is generic, so it could be implemented by other devices.
I dont know what happens if multiple messages arrive in the same notification.
So, this is experimental.
2017-01-09 16:33:00 +01:00
Hasan Ammar
0ba377bb42 Show K9 message body in notifications 2017-01-02 19:03:02 -05:00
Andreas Shimokawa
984e639e97 Pebble: push current weather to TimeStylePebble again when watchface gets started 2016-12-31 19:17:08 +01:00
Andreas Shimokawa
266c6b8817 Pebble: send weather to Pebble when we get notified by weather notification 2016-12-31 15:56:05 +01:00
Andreas Shimokawa
bcb522d2d0 Merge branch 'master' into feature-weather 2016-12-27 13:51:39 +01:00
Andreas Shimokawa
440a5e071f Try to support "Subsonic" android app (#474) 2016-12-26 23:53:24 +01:00
Andreas Shimokawa
6af95d99be Merge branch 'master' into feature-weather 2016-12-24 23:06:21 +01:00
Andreas Shimokawa
b5225145d4 Fix crash with unknown notification sources on Mi Band (maybe other non-Pebble devices also affected)
Pebble low level code had an own check for notification type being null, no we set it to UNKNOWN early
This regression was introduced in 0.15.0 though "Revamp Notification types Pebble (#453)"

Fixes #468
2016-12-24 22:00:24 +01:00
Andreas Shimokawa
2148b431ea Merge branch 'master' into feature-weather 2016-12-19 23:32:53 +01:00
Daniele Gobbetti
846c74aa86 Forward also group summary notifications, if they contain wearable actions. Hopefully helps with #456
Tested with conversations and there is no regression. Also a specific workaround for telegram was removed, hopefully this does not break #395
2016-12-18 18:00:16 +01:00
Daniele Gobbetti
f1965c7b00 Log the flags also when passing the notification to device #456 2016-12-18 11:03:54 +01:00
Daniele Gobbetti
861c655b5d Log the incoming notification flags.
Should help further diagnosing #456
2016-12-18 10:40:30 +01:00
Andreas Shimokawa
f74bb4e3f3 Merge branch 'master' into feature-weather 2016-12-12 09:05:19 +01:00
Daniele Gobbetti
bb5791485c Add log statements when notifications are not sent to gadget
This should help debuggin #456
2016-12-11 22:48:12 +01:00
Andreas Shimokawa
efb1cd389b Merge branch 'master' into feature-weather 2016-12-09 21:52:55 +01:00
Andreas Shimokawa
17b581022b optimize imports 2016-12-09 20:14:17 +01:00
Kevin Richter
34296c021f Revamp Notification types Pebble (#453)
* Remove notification switches for enum & hashmap
* Fix code style
* Fix null reference exception
* Add whatsapp support
* Remove duplicate entry
2016-12-09 17:54:19 +01:00
Uwe Hermann
0746aaa579 app: Random typo and consistency fixes. 2016-12-01 20:22:12 +01:00
Daniele Gobbetti
16c4f1a5ca Pebble: add toggle to use last known location for sunrise and sunset
This adds the feature discussed in #415, the used location is the last recorded by the network location provider, if it's not available then the stored location is used.
2016-11-06 15:42:52 +01:00
Julien Pivotto
67937dd6ee Mark 3rd party facebook apps notifications as Facebook
- Toffeed: https://f-droid.org/repository/browse/?fdid=me.jakelane.wrapperforfacebook
- Slimsocial: https://f-droid.org/repository/browse/?fdid=it.rignanese.leo.slimfacebook
- MaterialFBook: https://f-droid.org/repository/browse/?fdid=me.zeeroooo.materialfb

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2016-10-28 07:23:54 +02:00
Andreas Shimokawa
cc2b22cfc7 prefer BIG_TEXT extra from notification only for email
(Some messengers accumulate messages in BIG_TEXT)
2016-10-19 18:38:26 +02:00
Andreas Shimokawa
336ffd5bf7 Extract EXTRA_BIG_TEXT instead of EXTRA_TEXT if available.
This makes K9 Mail usable with only using generic notifcations on Android >=5
(It shows the message preview now)
2016-10-18 23:44:00 +02:00
Andreas Shimokawa
cd195a5969 map more apps to notification types (icons and colors on the pebble) 2016-10-11 11:54:52 +02:00
cpfeiffer
92c629c351 Ranem NotificationType.UNDEFINED to UNKNOWN 2016-10-10 23:06:44 +02:00
Daniele Gobbetti
fabc52fdad Don't forward group summary notifications to the wearable, they are meant for the android device only
Possibly also related to #395
2016-09-27 17:33:10 +02:00
Andreas Shimokawa
fd03dac5cd Pebble: try to work around duplicate Telegram messages
(#395)
2016-09-22 09:31:14 +02:00
Andreas Shimokawa
8080734470 Pebble: use telegram icon for telegram messages
also use the facebook icon for the official facebook app
(untested because we would never use facebook)
2016-09-21 21:31:23 +02:00
Andreas Shimokawa
ec1f539267 revert accidentially commited stuff 2016-09-11 00:38:26 +02:00
Andreas Shimokawa
053b9553bc correct changelog (pebble health is also affected by userid and deviceid swapping) 2016-09-11 00:36:04 +02:00
Andreas Shimokawa
e1927733ba remove special handling for conversations (latest release removed pebble messages) 2016-09-10 23:53:24 +02:00
cpfeiffer
f54163faeb centralize quit() functionality in GBApplication 2016-07-08 22:35:52 +02:00
cpfeiffer
233a6155cc Add class DeviceManager that provides access to the list of managed devices
Basically moved code out of ControlCenter to a separate class. Also provides
change events when the device list has changed, or changes to the device
state have occurred.
2016-06-18 23:35:34 +02:00
Andreas Shimokawa
f812fb1b1f Improvements to MusicPlayback receiver
- Also send duration if "duration" extra is present
- If "playing" and "postion" extras are present send a music state update

treat previous state and current state as equal if position delta is <=2 seconds
(Neccessary for some players which update every second - the pebble however counts by itself)
2016-06-11 23:37:03 +02:00
Andreas Shimokawa
d1a62968f6 Do not send new audio metadata to device if nothing has changed
This prevents some players which send a metadata changed intent every second to drain the battery
2016-06-10 23:13:33 +02:00
Andreas Shimokawa
6de002c88b also try to get track number and number of tracks from notifications 2016-06-10 22:20:55 +02:00
Andreas Shimokawa
66b5a21cf2 also gather music info from notifications when screen is off 2016-06-10 00:03:48 +02:00
Andreas Shimokawa
b0fe4b1519 also gather music info from notifications when screen is off 2016-06-09 23:39:00 +02:00
Andreas Shimokawa
9623449b6e Merge branch 'master' into feature-weather 2016-06-09 23:15:23 +02:00
Steffen Liebergeld
c5262869d9 Use names for playstates
These names need to be mapped to device specific constants in the
device code.
2016-06-09 20:02:55 +02:00
Steffen Liebergeld
91f374edec Revert ""duration" parameter in onSetMusicInfo uses microseconds"
The decision on granularity of APIs is up to the maintainers.

This reverts commit 204748c518.
2016-06-09 20:02:55 +02:00
Steffen Liebergeld
204748c518 "duration" parameter in onSetMusicInfo uses microseconds
This is in line with Android, and saves some calculations (and thereby a
tiny little bit of battery life).
2016-06-08 20:43:46 +02:00
Steffen Liebergeld
fb71cdf55b Add handling for media session notifications
Since Android 5.0, media players can have interactive notifications that
reside in the notification area, and offer up to 5 control buttons
(play/pause, next, previous, etc), and information about the currentlu
playing media file.

We use these notifications to get information about the currently
playing media file such as:
- artist
- track (title)
- album
- duration (length of the media file)
- play state (playing, paused, stopped)
- position
- play rate (how fast is the media file being played)

We then send this information up to the device.

On Pebble, the music app will display the title and the artist, as
well as a progress bar showing the current position. The progress bar is
animated when the media file is being played, and if it is being paused,
it displays a pause symbol.

This code will be skipped when GadgetBridge is run on a device with
Android version older than 5.0 (lollipop).
2016-06-08 20:41:43 +02:00
Andreas Shimokawa
98a0774fc2 Merge branch 'master' into feature-weather 2016-06-07 22:53:40 +02:00
Steffen Liebergeld
389a143bdb Set music info for PocketCasts
PocketCasts tells about its current media state via notifications. This
patch tries to parse incoming notifications from PocketCasts and if
successful tells the device about it. Currently supported are track and
artist.
2016-06-07 19:34:37 +02:00
Andreas Shimokawa
a15d07858e Sunset/Sunrise: always use UTC timezone for calendar operations 2016-05-31 13:03:15 +02:00
Andreas Shimokawa
0231e83ea3 try to fix duplicate/missing surise/sunset pins 2016-05-31 00:07:24 +02:00
Andreas Shimokawa
4533c80c95 make sure to only reconnect when device is in "waiting for reconnect state" 2016-05-29 21:44:43 +02:00
Andreas Shimokawa
2e8d96e995 add option to enable sunrise/sunset on the timeline
Also fix a small type Aquire -> Acquire
2016-05-29 21:29:27 +02:00
Andreas Shimokawa
b0e0aec465 fix typo 2016-05-26 15:20:27 +02:00
Andreas Shimokawa
7ef005f6a3 Allow getting the network location within pebble settings for sunrise/sunset calculation
It is also possible to set the location manually
On Android >=6 the required permission will be requested when pressing the button in settings.
2016-05-26 14:39:54 +02:00
Andreas Shimokawa
fa6100fcec Merge branch 'master' into feature-sunrise 2016-05-26 13:11:03 +02:00
andre
bf66c25c7f MusicPlayBackReceiver set track, artist and album to the artist member of MusicSpec.
Now the assignment of artist, track and album is correct
2016-05-24 19:33:12 +02:00
Andreas Shimokawa
55a40f7b06 Sunset/sunrise: rotate ids and reuse the id from two days ago for tomorrow, this way we will have sunrise/sunset for 3 days while sending only sunrise/sunset per day 2016-05-24 14:46:22 +02:00
Andreas Shimokawa
c9c9b420dc Pebble: Send sunrise and sunset events to the pebble every day using AlarmManager 2016-05-24 11:19:57 +02:00
Andreas Shimokawa
ec154c9041 Merge branch 'master' into feature-weather 2016-05-24 11:09:21 +02:00
Andreas Shimokawa
0d7986a5ab Pebble: rework incoming reconnection support
This is now completely generic and should work for other devices also

Fixes #296
2016-05-22 01:19:28 +02:00
Normano64
31eabe9605 Fixed things based on feedback 2016-05-19 23:58:13 +02:00
Normano64
8a91628322 Detects if Do Not Disturb is in use.
Can handle sms and phone calls from priority senders when in Priority
only, but doesn't handle events and reminders.
2016-05-19 16:34:59 +02:00
Andreas Shimokawa
dafdb1008d Merge branch 'master' into feature-weather 2016-05-16 14:15:39 +02:00
cpfeiffer
e35ce978bd Remove now unused imports + fix one more SharedPreferences usage 2016-04-25 23:43:19 +02:00
cpfeiffer
0c715a2669 Wrap access to SharedPreferences with "Prefs"
(to centralize quirk handling)
2016-04-25 23:18:55 +02:00
Andreas Shimokawa
a15b327ff1 Refactoring: get rid of ServiceCommand, use new CallSpec and MusicSpec to pass Call and Music info 2016-04-04 20:08:34 +02:00
cpfeiffer
7a224243a3 Try to quit Gadgetbridge by stopping the service 2016-04-03 00:49:54 +02:00
Andreas Shimokawa
adfef3db42 Prepare code for more music metadata (duration, track count, current track number)
Oh and format code
2016-03-27 17:45:44 +02:00
cpfeiffer
3f39928df5 Some more cursor-related improvements (closing) 2016-03-08 23:48:31 +01:00
cpfeiffer
9643fa6062 s/moveToFirst/moveToNext 2016-03-08 23:29:42 +01:00
cpfeiffer
87023ebdb3 Don't retrieve the column index again and again in a long loop
Also: fix weird iteration logic
2016-03-08 21:33:12 +01:00
Andreas Shimokawa
ed85fd5011 convert byte and short values related to activity tracking to int
This avoids a lot of problems because java
- does not know unsigned values
- jvm and dalvic do not internally support byte and short
- sqlite does not know them either
2016-02-29 20:54:39 +01:00
Andreas Shimokawa
c436c4c055 Pebble: Fix wrong(previous) contact being displayed on the pebble. Fixes #228 2016-02-20 22:20:02 +01:00
Chris Perelstein
60c7e9f6f6 Fix misspelling in exception notification. 2016-02-01 22:05:49 -05:00
Daniele Gobbetti
c08d49d28e Merge remote-tracking branch 'origin/master' into feature-weather 2016-01-25 13:12:30 +01:00
Andreas Shimokawa
e6f68f445a Ignore generic notification when from SMSSecure when SMS Notifications are on.
This should improve (not fix) #214
Still, we cannot decrypt SMS, so if you use SMSSecure as the default SMS App
you should disable SMS Notifications which enables generic notifications for
SMSSecure which are already decrypted.
2016-01-22 21:30:50 +01:00
danielegobbetti
4bb78722b5 Merge branch 'master' of https://github.com/Freeyourgadget/Gadgetbridge into feature-weather 2016-01-09 18:48:39 +01:00
Andreas Shimokawa
0b53f60b0d Pebble: EXPERIMENTAL support for replying to wearable notifications
Tested with Signal, more could work.
2016-01-09 17:54:17 +01:00
danielegobbetti
c7c723134e Add weather singleton (to store the whole data passed by weather notification).
Add weather info for TimeStylePebble.
Add further fields to the ParcelableWeather class.
Add reverse mapping to ParcelableWeather to get back the original OpenWeatherMap API condition codes.
2016-01-03 18:28:32 +01:00
Andreas Shimokawa
e533fdbaa6 Pebble: actually display current whether in WeatherNeat 2015-12-29 22:10:38 +01:00
Andreas Shimokawa
af9ee90383 actually get weather, seems to be the only way 2015-12-28 20:55:59 +01:00
danielegobbetti
aa1014f51c Added dummy configuration file. This way we get data from the weather notification app.
Problem is we probably ned to add it as library, in order to unmarshal the intent. (That's why I commented the offending code in the receiver)
2015-12-28 17:46:16 +01:00
Andreas Shimokawa
7a1a6dbb2b WeatherNotification: Try to dissect the parcelable extra
This is useless, since we do not get the extra at all (only weather skins)

So... this is a dead end...
2015-12-28 11:33:22 +01:00
Andreas Shimokawa
483c435aa5 Commit old weather experiment - might be worth continuing 2015-12-27 19:44:33 +01:00
Andreas Shimokawa
55989c426c fix double SMS on Android 6.0 2015-12-27 19:22:10 +01:00
danielegobbetti
9acdefd5c1 Treat sony SMS app as such for notifications. 2015-12-19 14:30:35 +01:00
Andreas Shimokawa
53fb63781e WIP: Work towards SMS replies / canned replies
- Implement the PebbleProtocol side (2.x and 3.x)
- Add Preferences for canned replies

This can be tested by enabling untested features in Pebble Settings
It lets you see and select the replies set up in "Canned Repies" on the Pebble
You will get a "NOT IMPLENTED" message on your Pebble.

THIS DOES NOT ACTUALLY DO ANYTHING USEFUL YET.
2015-12-13 12:03:57 +01:00
cpfeiffer
159c187e5e On Quit, remove all pending notifications
At least the notifications from #141 don't stay there forever, then.
2015-12-08 21:48:56 +01:00
Andreas Shimokawa
05a8436f7c Treat notifications from Signal as chat messages 2015-12-06 16:10:46 +01:00
Andreas Shimokawa
17ba49374c Fix copy&paste error in K9Receiver.java, update CHANGELOG.md 2015-11-27 23:45:27 +01:00
Andreas Shimokawa
c768107db8 Catch permission errors in K-9 Mail receiver. Closes #175. 2015-11-27 22:42:47 +01:00
cpfeiffer
bd0716ba58 Some more lint warnings fixed 2015-11-23 23:04:46 +01:00
cpfeiffer
95dc67c98d Back to sdk level 19 (#173) 2015-11-23 22:49:11 +01:00
cpfeiffer
81c2f657bd Some lint fixes 2015-11-23 22:46:12 +01:00
cpfeiffer
4616dcc965 Handle case where notification.extras is not available #174 2015-11-23 22:09:47 +01:00
cpfeiffer
394a0905dc Avoid potential, but very unlikely NPE 2015-11-23 21:59:13 +01:00
Andreas Shimokawa
e3533a2b18 Pebble: Allow muting (blacklisting) Apps from within generic notifications on the watch
Closes #113
2015-09-25 00:53:40 +02:00
Andreas Shimokawa
94ad7f2eb9 set type to SMS when receiving an SMS via generic notification listener 2015-09-24 17:26:40 +02:00
Andreas Shimokawa
1d41f2f8e4 Refactoring
The notfification APIs now use NotificationSpec as their only parameter, which
contains all information (required and optional ones).
We no longer have separate methods and actions for SMS/EMAIL/GENERIC anymore.
The type of notification is important now, not how we received them technically.
2015-09-24 14:45:21 +02:00
Andreas Shimokawa
98b1abedac Allow phone call notifications (also in call display) to be disabled in preferences
This will allow Pebble Dialer to handle these #106
2015-09-20 22:04:53 +02:00
Andreas Shimokawa
041bd1a7f4 Treat Conversations messagess as chat messages, even if arrived via Pebble Intents (which is the default) 2015-09-17 23:08:05 +02:00
Andreas Shimokawa
d8c096d931 Handle SMS/MMS as generic notification if disabled
(could serve as a workaround for #127)
2015-09-16 01:09:03 +02:00
Andreas Shimokawa
6e3c839608 Allow to select preferred music player in preferences, closes #112 2015-09-16 00:53:54 +02:00
Andreas Shimokawa
de74a033f6 Try to support controlling multiple music players
This tries to control the last player that played a (new) song.
It is very limited since we cannot get the source of an intent.
Instead we try to guess from the Action.
The problem is that we cannot support players that use only the action "com.android.music.XXXX" and not something own.
Also try to blindly support getting spotify metadata (for testing #112)
2015-09-15 01:36:33 +02:00
Julien Pivotto
21d59b23c1 Allow QKSMS notifications to be handled as a generic notification if SMS notification mode is set to "never"
This makes it possible to use the "Open on Phone" and individial dismiss feature with QKSMS.
2015-09-13 22:51:05 +02:00
Andreas Shimokawa
a73beceb44 Map a few more apps to NotificationKind 2015-09-13 13:48:21 +02:00