1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-23 18:36:50 +01:00
 Conflicts:
	GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java
	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/externalevents/NotificationListener.java
	app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/DeviceSupportFactory.java
	app/src/main/res/values-bg/strings.xml
This commit is contained in:
mamutcho 2020-03-13 19:08:34 +02:00
commit 10bf452017
709 changed files with 10748 additions and 1795 deletions

View File

@ -1,5 +1,36 @@
### Changelog
#### Version 0.42.1
* Fix accepting/rejecting calls on Android 9
* Mi Band 3/4, Amazfit Bip/Cor/GTS/GTR: Option to sync calendar events as reminder
#### Version 0.42.0
* Initial iTag support
* Fix indefinitely lasting Bluetooth scans when location permission has not been granted
* Try to stop incoming VoIP call notification when the call is answered
* Vectorize some icons and add a new Mi Scale 2 icon
* Mi Band 4: Make high MTU optional, fixes problems on some phones
* ZeTime: Fix probably broken support (duplicate id used by Fossil)
#### Version 0.41.1
* Huami: allow to have alarms without snooze feature
* Mi Band 2: Properly stop a call notification when text notifications are disabled
* VoIP calls: ignore notifications with only one action, assuming it is an outgoing call
* Try to fix notifications from Business Calendar
#### Version 0.41.0
* JYou Y5: Initial support
* Mi Band 2/Amazfit Bip: Redesign button actions for easy music control setup and support long presses on Bip
* Amazfit Bip: Remove RES file limit (for BipOS)
* Huami: Automatically toggle alarm switch when toggling on the Band/Watch while in Alarm settings in Gadgetbridge
* Recognize Pixart-Messenger as Chat App
#### Version 0.40.1
* Mi Band/Amazfit: Recognize changes when toggling alarm on device (immediately when connected, else when connecting)
* Mi Band/Amazfit: Fix some bugs with stuck connection when re-connecting
* Mi Band 4: Support higher MTU for multiple times faster firmware transfer (probably also Amazfit GTR/GTS)
* Amazfit Cor: Fix setting language to Chinese manually
#### Version 0.40.0
* Fossil Q Hybrid: Initial support
* Bangle.js: Initial support
@ -8,7 +39,7 @@
#### Version 0.39.1
* Try to actively re-connect when a connection gets interrupted (interval grows up to 64 seconds)
* Mi Band2/Amazfip Bip: Make button action settings per-device and enable for Amazfit Bip
* Mi Band2/Amazfit Bip: Make button action settings per-device and enable for Amazfit Bip
#### Version 0.39.0
* Amazfit GTS: Initial and incomplete support, mostly untested
@ -19,14 +50,14 @@
* Amazfit GTR: Initial and incomplete support, mostly untested
* Amazfit Bip: add Portuguese to the list of selectable languages
* Mi Band 4: Enable emoji font setting
* Makibes HR3: Support the english version
* Makibes HR3: Enable bluetooth pairing for working reconnection
* Makibes HR3: Support the English version
* Makibes HR3: Enable Bluetooth pairing for working re-connection
* Work around crash when trying to display changelog
* Sleep detection settings: Rolling 24 hours (existing style) or Noon to noon
* Add alternative color to heartrate in chart settings
* Add alternative color to heart rate in chart settings
#### Version 0.37.1
* Amazfit Bip Lite: Support flashing firmware and watchfaces
* Amazfit Bip Lite: Support flashing firmware and watch faces
#### Version 0.37.0
* Initial Makibes HR3 support
@ -40,7 +71,7 @@
* Show toast in case no app is installed which can handle GPX files
* Mi Band 4/Amazfit Bip Lite: Trim white spaces and new lines from auth key
* Mi Band 4/Amazfit Bip Lite: Display a toast and do not try to pair if there was no auth key supplied
* Skip service scan if supported device could be recognized without uuids during discovery
* Skip service scan if supported device could be recognized without UUIDs during discovery
#### Version 0.36.2
* Amazfit Bip: Untested support for Lite variant
@ -50,7 +81,7 @@
#### Version 0.36.1
* Mi Band 2/3/4, Amazfit Bip/Cor: Add setting to expose the HR sensor to 3rd party apps
* Mi Band 4: Really fix weather location not being updated on the Band
* Mi Band 4: Fix call notifcation not stopping when call gets answered or rejected on the phone
* Mi Band 4: Fix call notification not stopping when call gets answered or rejected on the phone
* Amazfit Bip/Cor: Support for custom emoji font
* ZeTime: Enable emoji support
* ZeTime: Make watch language the same as the phone language by default
@ -64,7 +95,7 @@
* Initial Mijia LYWSD02 support (Smart Clock with Humidity and Temperature Sensor), just for setting the time
* Mi Band 3/4: Allow enabling the NFC menu where supported (useless for now)
* Mi Band 3/4, Amazfit Cor/Bip: Set language immediately when changing it (not only on connect)
* Mi Band 3/4, Amazfir Cor/Bip: Add icons for "swimming" and "exercise"
* Mi Band 3/4, Amazfit Cor/Bip: Add icons for "swimming" and "exercise"
* Mi Band 4: Support flashing the V2 font
* Mi Band 4: Fix weather location not being updated on the Band
* Mi Band 4: remove unsupported DND setting from settings menu
@ -78,11 +109,11 @@
#### Version 0.35.2
* Mi Band 1/2: Crash when updating firmware while phone is set to Spanish
* Mi Band 4: Enable music info support (displays now on the band)
* Mi Band 4: Support setting date format (for built-in watchfaces)
* Mi Band 4: Support setting date format (for built-in watch-faces)
* Amazfit Cor 2: Try to fix empty menu on device
#### Version 0.35.1
* Mi Band 4: Support flashing watchfaces, res and firmware (.ft untested)
* Mi Band 4: Support flashing watch-faces, res and firmware (.ft untested)
#### Version 0.35.0
* Mi Band 4: Initial support (WARNING: INITIAL SETUP NEEDS MI FIT WITH ACCOUNT AND ROOT, NOT A RECOMMENDED DEVICE FOR GADGETBRIDGE)
@ -90,7 +121,7 @@
#### Version 0.34.1
* Mi Band 1: Fix crash when entering per-device settings
* Mi Band 3: Allow setting date format in per-device settings
* ZeTime: Fix timestmaps
* ZeTime: Fix time stamps
* Fix a crash when flashing an non-whitelisted firmware while using Gadgetbridge in Spanish
#### Version 0.34.0
@ -110,14 +141,14 @@
* Mi Band 3: Add Indonesian, Thai, Arabic, Vietnamese, Portuguese, Dutch, Turkish and Ukrainian to language settings
* Mi Band 3: Support flashing latest Japanese-Korean font
* Amazfit Cor 2: Initial experimental support (untested)
* Pebble: Add pebblekit extension for reopening last app
* Casio: Bugfixes and improvements
* Pebble: Add PebbleKit extension for reopening last app
* Casio: Bug fixes and improvements
* Lookup contacts also in work profile
* Fix searching in application name when blacklisting
* Remove misleading title from database management activity when no legacy database is available
#### Version 0.32.4
* Make voip call support optional (disabled by default)
* Make VoIP call support optional (disabled by default)
* Amazfit Bip: GPX export corrections
* ZeTime: Fix setting alarms
* ZeTime: Fix wrong activity timestamps
@ -143,9 +174,9 @@
* Initial support for Casio GB-6900B
* Increase number of alarms and store them per-device
* Support factory reset in debug activity (Mi Band 1/2/3, Bip, Cor)
* Filter out unicode control sequences (fixes problems with Telegram and probably others)
* Filter out Unicode control sequences (fixes problems with Telegram and probably others)
* Fix endless loop resulting in OOM when RTL support is enabled
* Recoginize p≡p as an email app
* Recognize p≡p as an email app
* No longer display Android paired devices in that were not a paired with Gadgetbridge
* Amazfit Bip: Allow flashing latest GPS firmware
* Pebble: Native support for M7S watch face
@ -168,8 +199,8 @@
#### Version 0.31.0
* Pebble: Send all wearable notification actions (not only reply)
* Pebble: Always allow reply action even if untested features are turned off
* Pebble: Temporarily disable broken autoremove notification feature
* Amazfit Bip: Allow flashing latest gps firmware (Mili_dth.gps)
* Pebble: Temporarily disable broken auto remove notification feature
* Amazfit Bip: Allow flashing latest GPS firmware (Mili_dth.gps)
* Mi Band 3/Amazfit Bip/Amazfit Cor: Send Fahrenheit if units are set to imperial
* Roidmi 3: Fix and enable support
* Mi Band 3/Amazfit Bip: fix find phone crash
@ -253,7 +284,7 @@
* Initial support for Mi Band 3 (largely untested, needs to be connected to Mi Fit once)
* Option for automatic activity sync after screen unlock
* Allow hiding activity transfer notification on Android Oreo and above
* Allow blacklisting of pebblekit notifications for individual apps
* Allow blacklisting of PebbleKit notifications for individual apps
* Allow blacklisting all application at once
* Forward Skype notifications to wearable even if "local only" flag is set
* Show Gadgetbridge logo behind cards in main activity
@ -554,7 +585,7 @@
#### Version 0.17.5
* Automatically start the service on boot (can be turned off)
* Pebble: PebbleKit compatibility improvements (Datalogging)
* Pebble: PebbleKit compatibility improvements (Data logging)
* Pebble: Display music shuffle and repeat states for some players
* Pebble 2/LE: Speed up data transfer
@ -562,7 +593,7 @@
* Better integration with android music players
* Privacy options for calls (hide caller name/number)
* Send a notification to the connected if the Android Alarm Clock rings (com.android.deskclock)
* Fixes for cyrillic transliteration
* Fixes for Cyrillic transliteration
* Pebble: Implement notification privacy modes
* Pebble: Support weather for Obisdian watchface
* Pebble: add a dev option to always and immediately ACK PebbleKit messages to the watch
@ -633,7 +664,7 @@
* Mi Band 2: Initial support for firmware update (tested so far: 1.0.0.39)
#### Version 0.14.4
* Pebble 2/LE: Fix multiple bugs in reconnection code, honor reconnect tries from settings
* Pebble 2/LE: Fix multiple bugs in re-connection code, honor reconnect tries from settings
* Mi Band 2: Experimental support for activity recognition
* Mi Band 2: Fix time setting code
@ -678,7 +709,7 @@
* Mi Band 2: Initial support for heart rate readings (Debug activity only)
* Mi Band 2: Support disabled alarms
* Attempt to fix spurious device discovery problems
* Correctly recognize Toffeed, Slimsocial and MaterialFBook as facebook notification sources
* Correctly recognize Toffeed, Slimsocial and MaterialFBook as Facebook notification sources
#### Version 0.13.6
* Mi Band 2: Support for multiple alarms (3 at the moment)
@ -694,10 +725,10 @@
* Mi Band: Support for testing vibration patterns directly from the preferences
* Mi Band: Clean up vibration preferences
* Possibly fix logging to file on certain devices (#406)
* Mi Band 2: Possibly fix weird connection interdependency between Mi 1 and 2 (#323)
* Mi Band 1S: Whitelist firmware 4.16.4.22
* Mi Band 2: Possibly fix weird connection interdependence between Mi 1 and 2 (#323)
* Mi Band 1S: White list firmware 4.16.4.22
* Mi Band: try application level pairing again, in order to support data sharing with Mi Fit (#250)
* Pebble: new icons and colours for certain apps
* Pebble: new icons and colors for certain apps
* Debug-screen: added button to test "new functionality", currently live sensor data for Mi Band 1
#### Version 0.13.3
@ -747,7 +778,7 @@
* Fix a rare crash when, due to Bluetooth problems, when a device has no name
* Fix activity fetching getting stuck when double tapping (#333)
* Mi Band: in the Device Discovery activity, do not display devices that are already paired
* Mi Band: only allow automatic reconnection on disconnect when the device was previously fully connected
* Mi Band: only allow automatic re-connection on disconnect when the device was previously fully connected
* Mi Band: fix a rare crash when reading data fails due to Bluetooth problems
* Mi Band: log full activity sample to help deciphering activity kinds (#341)
* Mi Band 2: improved discovery mechanism to not rely on MAC addresses (#323)
@ -819,7 +850,7 @@
#### Version 0.9.4
* Pebble: support pebble health datalog messages of firmware 3.11 (this adds support for deep sleep!)
* Pebble: try to reconnect on new notifications and phone calls when connection was lost unexpectedly
* Pebble: delay between reconnection attempts (from 1 up to 64 seconds)
* Pebble: delay between re-connection attempts (from 1 up to 64 seconds)
* Fix crash in charts activities when changing the date, quickly (#277)
* Mi Band: preference to enable heart rate measurement during sleep (#232, thanks computerlyrik!)
* Mi Band: display measured heart rate in charts (#232)
@ -875,7 +906,7 @@
* Fix layout of the alarms activity
#### Version 0.7.4
* Refactored the settings activity: User details are now generic instead of miband specific. Old settings are preserved.
* Refactored the settings activity: User details are now generic instead of Mi Band specific. Old settings are preserved.
* Pebble: Fix regression with broken active reconnect since 0.7.0
* Pebble: Support activation and deactivation of Pebble Health. Activation uses the User details as seen above. Insights are NOT activated.
Please be aware that deactivation does NOT delete the data stored on the watch (but it seems to stop the tracking), and we do not know how to switch to metric length units.
@ -893,7 +924,7 @@
* Sort blacklist by package names
#### Version 0.7.1
* Pebble: allow reinstallation of apps in pbw-cache from App Manager (long press menu)
* Pebble: allow re-installation of apps in pbw-cache from App Manager (long press menu)
* Pebble: Fix regression which freezes Gadgetbridge when disconnecting via long-press menu
#### Version 0.7.0
@ -902,7 +933,7 @@
* Pebble: Support replying to SMS form the watch (canned replies)
* Pebble: Allow installing apps compiled with SDK 2.x also on the basalt platform (Time, Time Steel)
* Pebble: Fix decoding strings in appmessages from the pebble (fixes sending SMS from "Dialer for Pebble")
* Pebble: Support incoming reconnections when device returns from "Airplane Mode" or "Stand-By Mode"
* Pebble: Support incoming re-connections when device returns from "Airplane Mode" or "Stand-By Mode"
* Pebble: Fix crash when turning off Bluetooth when connected on Android 6.0
* Mi Band: reserve some alarm slots for alerting when upcoming events begin. NB: the band will vibrate at the start time of the event, android reminders are ignored
* Mi Band: Display unique devices Names, not just "MI"
@ -961,7 +992,7 @@
* Try to prevent service being killed by disallowing backups
#### Version 0.6.2
* Mi Band: support firmware version 1.0.10.14 (and onwards?) vibration
* Mi Band: support firmware version 1.0.10.14 (and onward?) vibration
* Mi Band: get device name from official BT SIG endpoint
* Mi Band: initial support for displaying live activity data, screen stays on
@ -969,12 +1000,12 @@
* Pebble: Allow muting (blacklisting) Apps from within generic notifications on the watch
* Pebble: Detect all known Pebble Versions including new "chalk" platform (Pebble Time Round)
* Option to ignore phone calls (useful for Pebble Dialer)
* Mi Band: Added progressbar for activity data transfer and fixes for firmware transfer progressbar
* Mi Band: Added progress bar for activity data transfer and fixes for firmware transfer progress bar
* Bugfix for app blacklist (some checkboxes where wrongly drawn as checked)
#### Version 0.6.0
* Pebble: WIP implementation of PebbleKit Intents to make some 3rd party Android apps work with the Pebble (eg. Ventoo)
* Pebble: Option to set reconnection attempts in settings (one attempt usually takes about 5 seconds)
* Pebble: Option to set re-connection attempts in settings (one attempt usually takes about 5 seconds)
* Support controlling all audio players that react to media buttons (can be chosen in settings)
* Treat SMS as generic notification if set to "never" (can be blacklisted there also if desired)
* Treat Conversations messages as chat messages, even if arrived via Pebble Intents (nice icon for Pebble FW 3.x)
@ -1024,7 +1055,7 @@
* Fixed slight steps graph distortion through black text labels
* Fixed control center activity and notification showing different device connection state
* Small firmware installation improvements
* Various refactorings and code cleanups
* Various refactoring and code cleanups
#### Version 0.4.5
* Enhancement to activity graphs: new graph showing the number of steps done today and in the last week

View File

@ -15,8 +15,6 @@
*/
package nodomain.freeyourgadget.gadgetbridge.daogen;
import java.util.Date;
import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Index;
@ -45,7 +43,7 @@ public class GBDaoGenerator {
public static void main(String[] args) throws Exception {
Schema schema = new Schema(21, MAIN_PACKAGE + ".entities");
Schema schema = new Schema(24, MAIN_PACKAGE + ".entities");
Entity userAttributes = addUserAttributes(schema);
Entity user = addUserInfo(schema, userAttributes);
@ -72,6 +70,7 @@ public class GBDaoGenerator {
addXWatchActivitySample(schema, user, device);
addZeTimeActivitySample(schema, user, device);
addID115ActivitySample(schema, user, device);
addJYouActivitySample(schema, user, device);
addWatchXPlusHealthActivitySample(schema, user, device);
addWatchXPlusHealthActivityKindOverlay(schema, user, device);
@ -332,6 +331,19 @@ public class GBDaoGenerator {
return activitySample;
}
private static Entity addJYouActivitySample(Schema schema, Entity user, Entity device) {
Entity activitySample = addEntity(schema, "JYouActivitySample");
activitySample.implementsSerializable();
addCommonActivitySampleProperties("AbstractActivitySample", activitySample, user, device);
activitySample.addIntProperty(SAMPLE_STEPS).notNull().codeBeforeGetterAndSetter(OVERRIDE);
activitySample.addIntProperty(SAMPLE_RAW_KIND).notNull().codeBeforeGetterAndSetter(OVERRIDE);
activitySample.addIntProperty("caloriesBurnt");
activitySample.addIntProperty("distanceMeters");
activitySample.addIntProperty("activeTimeMinutes");
addHeartRateProperties(activitySample);
return activitySample;
}
private static Entity addWatchXPlusHealthActivitySample(Schema schema, Entity user, Entity device) {
Entity activitySample = addEntity(schema, "WatchXPlusActivitySample");
activitySample.implementsSerializable();
@ -404,12 +416,14 @@ public class GBDaoGenerator {
alarm.addIndex(indexUnique);
alarm.addBooleanProperty("enabled").notNull();
alarm.addBooleanProperty("smartWakeup").notNull();
alarm.addBooleanProperty("snooze").notNull();
alarm.addIntProperty("repetition").notNull().codeBeforeGetter(
"public boolean isRepetitive() { return getRepetition() != ALARM_ONCE; } " +
"public boolean getRepetition(int dow) { return (this.repetition & dow) > 0; }"
);
alarm.addIntProperty("hour").notNull();
alarm.addIntProperty("minute").notNull();
alarm.addBooleanProperty("unused").notNull();
alarm.addToOne(user, userId);
alarm.addToOne(device, deviceId);
}

View File

@ -38,7 +38,9 @@ vendor's servers.
* Casio GB-6900B
* Fossil Q Hybrid
* HPlus Devices (e.g. ZeBand) [Wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/HPlus)
* iTag
* ID115
* JYou Y5
* Lenovo Watch 9
* Lenovo Watch X (Plus) [Wiki](https://codeberg.org/mamutcho/Gadgetbridge/wiki)
* Liveview
@ -47,13 +49,13 @@ vendor's servers.
* Mi Band 2 [Wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-2)
* Mi Band 3 [Wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-3)
* Mi Band 4 (NOT RECOMMENDED, NEEDS MI FIT WITH ACCOUNT AND ROOT ONCE) [Wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Mi-Band-4)
* Mi Scale 2 (currently only displays a toast after stepping on the scale)
* Mi Scale 2 (Currently only displays a toast after stepping on the scale)
* NO.1 F1
* Pebble, Pebble Steel, Pebble Time, Pebble Time Steel, Pebble Time Round [Wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Pebble)
* Pebble 2 [Wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Pebble)
* Teclast H10, H30
* XWatch (Affordable Chinese Casio-like smartwatches)
* Vibratissimo (experimental)
* Vibratissimo (Experimental)
* ZeTime [Wiki](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/MyKronoz-ZeTime)
@ -83,6 +85,8 @@ Please see [FEATURES.md](https://codeberg.org/Freeyourgadget/Gadgetbridge/src/ma
* Lukas Schwichtenberg (Makibes HR3)
* Daniel Dakhno (Fossil Q Hybrid)
* Gordon Williams (Bangle.js)
* Pavel Elagin (JYou Y5)
* Taavi Eomäe (iTag)
## Contribute
@ -92,6 +96,12 @@ just leave a comment that you're working on one to avoid duplicated work.
Translations can be contributed via https://hosted.weblate.org/projects/freeyourgadget/gadgetbridge/
## Community
If you would like to get in touch with other Gadgetbridge users and developers outside of Codeberg, you can do so via:
* Matrix: #gadgetbridge:matrix.org - The most active channel
* IRC: #gadgetbridge on Freenode
## Do you have further questions or feedback?
Feel free to open an issue on our issue tracker, but please:
@ -109,4 +119,3 @@ Feel free to open an issue on our issue tracker, but please:
4. File an issue at https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/new and possibly provide the logfile
Alternatively you may use the standard logcat functionality to access the log.

View File

@ -22,11 +22,11 @@ android {
defaultConfig {
applicationId "nodomain.freeyourgadget.gadgetbridge"
minSdkVersion 19
targetSdkVersion 27
targetSdkVersion 28
// Note: always bump BOTH versionCode and versionName!
versionName "0.40.0"
versionCode 163
versionName "0.43.0"
versionCode 169
vectorDrawables.useSupportLibrary = true
}
buildTypes {
@ -73,7 +73,7 @@ dependencies {
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.gridlayout:gridlayout:1.0.0"
implementation "com.google.android.material:material:1.0.0"
implementation "com.google.android.material:material:1.1.0"
implementation "androidx.palette:palette:1.0.0"
implementation("com.github.tony19:logback-android-classic:1.1.1-6") {
exclude group: "com.google.android", module: "android"

View File

@ -9,9 +9,26 @@
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Pebble BG-JS
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
-keepclassmembers class nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.webview.JSInterface {
public *;
}
-keepattributes JavascriptInterface
# https://github.com/tony19/logback-android/issues/29
-dontwarn javax.mail.**, javax.naming.Context, javax.naming.InitialContext
# To avoid any stacktrace ambiguity
-keepattributes SourceFile,LineNumberTable
# GreenDAO 2 - http://greenrobot.org/greendao/documentation/technical-faq/
-keepclassmembers class * extends de.greenrobot.dao.AbstractDao {
public static java.lang.String TABLENAME;
}
-keep class **$Properties
-keep class **$Properties { *; }

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="nodomain.freeyourgadget.gadgetbridge">
<!--
Comment in for testing Pebble Emulator
<uses-permission android:name="android.permission.INTERNET" />
@ -12,6 +11,7 @@
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.ANSWER_PHONE_CALLS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_CONTACTS" />
@ -22,7 +22,6 @@
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.VIBRATE" /> <!-- Used for reverse find device -->
<uses-permission android:name="cyanogenmod.permission.ACCESS_WEATHER_MANAGER" />
<uses-permission android:name="cyanogenmod.permission.READ_WEATHER" />
<uses-permission android:name="lineageos.permission.ACCESS_WEATHER_MANAGER" />
@ -44,16 +43,19 @@
android:allowBackup="false"
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/GadgetbridgeTheme">
<activity android:name=".devices.qhybrid.WidgetSettingsActivity"></activity>
<activity
android:name=".activities.ControlCenterv2"
android:label="@string/title_activity_controlcenter"
android:theme="@style/SplashTheme">
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
@ -82,9 +84,9 @@
android:label="@string/activity_summaries"
android:parentActivityName=".activities.ControlCenterv2" />
<activity
android:launchMode="singleTop"
android:name=".activities.appmanager.AppManagerActivity"
android:label="@string/title_activity_appmanager"
android:launchMode="singleTop"
android:parentActivityName=".activities.ControlCenterv2" />
<activity
android:name=".activities.AppBlacklistActivity"
@ -294,7 +296,7 @@
<data android:mimeType="application/octet-stream" />
</intent-filter>
<!-- to receive firmwares from the download content provider if recognized as zip-->
<!-- to receive firmwares from the download content provider if recognized as zip -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
@ -310,7 +312,6 @@
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
@ -335,18 +336,19 @@
<activity android:name=".externalevents.WeatherNotificationConfig">
<intent-filter>
<action android:name="ru.gelin.android.weather.notification.ACTION_WEATHER_SKIN_PREFERENCES"/>
<action android:name="ru.gelin.android.weather.notification.ACTION_WEATHER_SKIN_PREFERENCES" />
</intent-filter>
</activity>
<receiver android:name=".externalevents.AutoStartReceiver"
<receiver
android:name=".externalevents.AutoStartReceiver"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<receiver
android:name=".externalevents.BluetoothStateChangeReceiver"
android:exported="false">
@ -369,16 +371,13 @@
</intent-filter>
</receiver>
<receiver
android:name=".database.PeriodicExporter"
android:enabled="true"
android:name="nodomain.freeyourgadget.gadgetbridge.database.PeriodicExporter"
android:exported="false">
</receiver>
android:exported="false"></receiver>
<!--
forcing the DebugActivity to portrait mode avoids crashes with the progress
dialog when changing orientation
-->
-->
<activity
android:name=".activities.DebugActivity"
android:label="@string/title_activity_debug"
@ -406,10 +405,10 @@
android:label="@string/title_activity_pebble_pairing" />
<activity
android:name=".devices.watch9.Watch9PairingActivity"
android:label="@string/title_activity_watch9_pairing" />
android:label="@string/title_activity_watch9_pairing" />
<activity
android:name=".devices.watch9.Watch9CalibrationActivity"
android:label="@string/title_activity_watch9_calibration" />
android:label="@string/title_activity_watch9_calibration" />
<activity
android:name=".devices.lenovo.LenovoWatchPairingActivity"
android:label="@string/title_activity_watch9_pairing" />
@ -439,8 +438,8 @@
<activity
android:name=".activities.NotificationFilterActivity"
android:label="@string/title_activity_notification_filter"
android:windowSoftInputMode="stateHidden|adjustPan"
android:parentActivityName=".activities.AppBlacklistActivity" />
android:parentActivityName=".activities.AppBlacklistActivity"
android:windowSoftInputMode="stateHidden|adjustPan" />
<activity
android:name=".activities.FindPhoneActivity"
android:label="Find Phone" />
@ -449,7 +448,6 @@
android:name=".contentprovider.PebbleContentProvider"
android:authorities="com.getpebble.android.provider"
android:exported="true" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.screenshot_provider"
@ -460,7 +458,8 @@
android:resource="@xml/shared_paths" />
</provider>
<receiver android:name=".SleepAlarmWidget"
<receiver
android:name=".SleepAlarmWidget"
android:label="@string/appwidget_sleep_alarm_widget_label">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
@ -471,41 +470,41 @@
android:name="android.appwidget.provider"
android:resource="@xml/sleep_alarm_widget_info" />
</receiver>
<receiver
android:name=".Widget"
android:label="@string/widget_listing_label">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<action android:name="nodomain.freeyourgadget.gadgetbridge.WidgetClick" />
</intent-filter>
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_info" />
</receiver>
<activity
android:name=".activities.WidgetAlarmsActivity"
android:excludeFromRecents="true"
android:launchMode="singleInstance"
android:theme="@style/Theme.AppCompat.Light.Dialog"
android:excludeFromRecents="true"/>
android:theme="@style/Theme.AppCompat.Light.Dialog" />
<activity
android:launchMode="singleTask"
android:name=".activities.ExternalPebbleJSActivity"
android:allowTaskReparenting="true"
android:clearTaskOnLaunch="true"
android:name=".activities.ExternalPebbleJSActivity"
android:label="@string/app_configure"
android:launchMode="singleTask"
android:parentActivityName=".activities.appmanager.AppManagerActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="nodomain.freeyourgadget.gadgetbridge.activities.ControlCenterv2" />
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="gadgetbridge" />
</intent-filter>
</activity>
@ -515,6 +514,9 @@
<activity
android:name=".devices.qhybrid.QHybridAppChoserActivity"
android:exported="true" />
<activity
android:name=".devices.qhybrid.HRConfigActivity"
android:exported="true" />
</application>
</manifest>
</manifest>

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Martin, Matthieu Baerts, Normano64, Pavel Elagin, Taavi Eomäe
This file is part of Gadgetbridge.
@ -90,7 +90,7 @@ import static nodomain.freeyourgadget.gadgetbridge.model.DeviceType.MIBAND4;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceType.ZETIME;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceType.fromKey;
import static nodomain.freeyourgadget.gadgetbridge.util.GB.NOTIFICATION_CHANNEL_ID;
import static nodomain.freeyourgadget.gadgetbridge.util.GB.NOTIFICATION_CHANNEL_HIGH_PRIORITY_ID;
/**
* Main Application class that initializes and provides access to certain things like
* logging and DB access.
@ -211,6 +211,14 @@ public class GBApplication extends Application {
notificationManager.createNotificationChannel(channel);
}
NotificationChannel channelHighPr = notificationManager.getNotificationChannel(NOTIFICATION_CHANNEL_HIGH_PRIORITY_ID );
if (channelHighPr == null) {
channelHighPr = new NotificationChannel(NOTIFICATION_CHANNEL_HIGH_PRIORITY_ID,
getString(R.string.notification_channel_high_priority_name),
NotificationManager.IMPORTANCE_HIGH);
notificationManager.createNotificationChannel(channelHighPr);
}
bluetoothStateChangeReceiver = new BluetoothStateChangeReceiver();
registerReceiver(bluetoothStateChangeReceiver, new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED));
}
@ -344,6 +352,10 @@ public class GBApplication extends Application {
return VERSION.SDK_INT >= Build.VERSION_CODES.O;
}
public static boolean isRunningPieOrLater() {
return VERSION.SDK_INT >= Build.VERSION_CODES.P;
}
private static boolean isPrioritySender(int prioritySenders, String number) {
if (prioritySenders == Policy.PRIORITY_SENDERS_ANY) {
return true;

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer, Taavi Eomäe
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer, Taavi Eomäe
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Carsten Pfeiffer, Daniele Gobbetti, Pavel Elagin
/* Copyright (C) 2016-2020 Carsten Pfeiffer, Daniele Gobbetti, Pavel Elagin
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Carsten Pfeiffer
/* Copyright (C) 2015-2020 Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 0nse, Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2016-2020 0nse, Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.
@ -121,7 +121,7 @@ public class SleepAlarmWidget extends AppWidgetProvider {
context.getString(R.string.appwidget_setting_alarm, hours, minutes),
Toast.LENGTH_SHORT, GB.INFO);
Alarm alarm = AlarmUtils.createSingleShot(0,true, calendar);
Alarm alarm = AlarmUtils.createSingleShot(0, true, false, calendar);
ArrayList<Alarm> alarms = new ArrayList<>(1);
alarms.add(alarm);
GBApplication.deviceService().onSetAlarms(alarms);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Andreas Shimokawa, vanous
/* Copyright (C) 2019-2020 Andreas Shimokawa, vanous
This file is part of Gadgetbridge.
@ -66,12 +66,12 @@ public class Widget extends AppWidgetProvider {
return gbApp.getDeviceManager().getSelectedDevice();
}
private int[] getSteps() {
private long[] getSteps() {
Context context = GBApplication.getContext();
Calendar day = GregorianCalendar.getInstance();
if (!(context instanceof GBApplication)) {
return new int[]{0, 0, 0};
return new long[]{0, 0, 0};
}
DailyTotals ds = new DailyTotals();
return ds.getDailyTotalsForAllDevices(day);
@ -114,10 +114,10 @@ public class Widget extends AppWidgetProvider {
}
int[] DailyTotals = getSteps();
long[] dailyTotals = getSteps();
views.setTextViewText(R.id.todaywidget_steps, context.getString(R.string.widget_steps_label, (int) DailyTotals[0]));
views.setTextViewText(R.id.todaywidget_sleep, context.getString(R.string.widget_sleep_label, getHM((long) DailyTotals[1])));
views.setTextViewText(R.id.todaywidget_steps, context.getString(R.string.widget_steps_label, dailyTotals[0]));
views.setTextViewText(R.id.todaywidget_sleep, context.getString(R.string.widget_sleep_label, getHM(dailyTotals[1])));
if (device != null) {
String status = String.format("%1s", device.getStateString());

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Carsten Pfeiffer, Daniele Gobbetti
/* Copyright (C) 2015-2020 Carsten Pfeiffer, Daniele Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Lem Dulfo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, walkjivefly
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2017-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Christian
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Christian
Fischer, Daniele Gobbetti, Lem Dulfo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2017-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Lem Dulfo
This file is part of Gadgetbridge.
@ -38,6 +38,7 @@ public class AlarmDetails extends AbstractGBActivity {
private Alarm alarm;
private TimePicker timePicker;
private CheckedTextView cbSmartWakeup;
private CheckedTextView cbSnooze;
private CheckedTextView cbMonday;
private CheckedTextView cbTuesday;
private CheckedTextView cbWednesday;
@ -57,6 +58,7 @@ public class AlarmDetails extends AbstractGBActivity {
timePicker = findViewById(R.id.alarm_time_picker);
cbSmartWakeup = findViewById(R.id.alarm_cb_smart_wakeup);
cbSnooze = findViewById(R.id.alarm_cb_snooze);
cbMonday = findViewById(R.id.alarm_cb_monday);
cbTuesday = findViewById(R.id.alarm_cb_tuesday);
cbWednesday = findViewById(R.id.alarm_cb_wednesday);
@ -71,6 +73,11 @@ public class AlarmDetails extends AbstractGBActivity {
((CheckedTextView) v).toggle();
}
});
cbSnooze.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
((CheckedTextView) v).toggle();
}
});
cbMonday.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
((CheckedTextView) v).toggle();
@ -115,6 +122,10 @@ public class AlarmDetails extends AbstractGBActivity {
int smartAlarmVisibility = supportsSmartWakeup() ? View.VISIBLE : View.GONE;
cbSmartWakeup.setVisibility(smartAlarmVisibility);
cbSnooze.setChecked(alarm.getSnooze());
int snoozeVisibility = supportsSnoozing() ? View.VISIBLE : View.GONE;
cbSnooze.setVisibility(snoozeVisibility);
cbMonday.setChecked(alarm.getRepetition(Alarm.ALARM_MON));
cbTuesday.setChecked(alarm.getRepetition(Alarm.ALARM_TUE));
cbWednesday.setChecked(alarm.getRepetition(Alarm.ALARM_WED));
@ -133,6 +144,14 @@ public class AlarmDetails extends AbstractGBActivity {
return false;
}
private boolean supportsSnoozing() {
if (device != null) {
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(device);
return coordinator.supportsAlarmSnoozing();
}
return false;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
@ -146,6 +165,7 @@ public class AlarmDetails extends AbstractGBActivity {
private void updateAlarm() {
alarm.setSmartWakeup(supportsSmartWakeup() && cbSmartWakeup.isChecked());
alarm.setSnooze(supportsSnoozing() && cbSnooze.isChecked());
int repetitionMask = AlarmUtils.createRepetitionMassk(cbMonday.isChecked(), cbTuesday.isChecked(), cbWednesday.isChecked(), cbThursday.isChecked(), cbFriday.isChecked(), cbSaturday.isChecked(), cbSunday.isChecked());
alarm.setRepetition(repetitionMask);
alarm.setHour(timePicker.getCurrentHour());

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 abettenburg, Andreas Shimokawa, Carsten Pfeiffer,
/* Copyright (C) 2015-2020 abettenburg, Andreas Shimokawa, Carsten Pfeiffer,
Daniele Gobbetti, Lem Dulfo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017-2019 Carsten Pfeiffer, Daniele Gobbetti
/* Copyright (C) 2017-2020 Carsten Pfeiffer, Daniele Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,5 +1,5 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Lem Dulfo
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Lem Dulfo, vanous
This file is part of Gadgetbridge.
@ -17,18 +17,23 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.activities;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.annotation.NonNull;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.adapter.GBAlarmListAdapter;
@ -40,6 +45,7 @@ import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.entities.User;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceService;
import nodomain.freeyourgadget.gadgetbridge.util.AlarmUtils;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
@ -59,6 +65,10 @@ public class ConfigureAlarms extends AbstractGBActivity {
setContentView(R.layout.activity_configure_alarms);
IntentFilter filterLocal = new IntentFilter();
filterLocal.addAction(DeviceService.ACTION_SAVE_ALARMS);
LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver, filterLocal);
gbDevice = getIntent().getParcelableExtra(GBDevice.EXTRA_DEVICE);
mGBAlarmListAdapter = new GBAlarmListAdapter(this);
@ -136,7 +146,7 @@ public class ConfigureAlarms extends AbstractGBActivity {
}
private Alarm createDefaultAlarm(@NonNull Device device, @NonNull User user, int position) {
return new Alarm(device.getId(), user.getId(), position, false, false,0, 6, 30);
return new Alarm(device.getId(), user.getId(), position, false, false, false, 0, 6, 30, false);
}
@Override
@ -165,4 +175,25 @@ public class ConfigureAlarms extends AbstractGBActivity {
private void sendAlarmsToDevice() {
GBApplication.deviceService().onSetAlarms(mGBAlarmListAdapter.getAlarmList());
}
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
switch (action) {
case DeviceService.ACTION_SAVE_ALARMS: {
updateAlarmsFromDB();
break;
}
}
}
};
@Override
protected void onDestroy() {
LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver);
super.onDestroy();
}
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Johannes Tysiak, Taavi Eomäe, vanous
This file is part of Gadgetbridge.
@ -343,6 +343,8 @@ public class ControlCenterv2 extends AppCompatActivity
wantedPermissions.add(Manifest.permission.READ_CONTACTS);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_DENIED)
wantedPermissions.add(Manifest.permission.CALL_PHONE);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ANSWER_PHONE_CALLS) == PackageManager.PERMISSION_DENIED)
wantedPermissions.add(Manifest.permission.ANSWER_PHONE_CALLS);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CALL_LOG) == PackageManager.PERMISSION_DENIED)
wantedPermissions.add(Manifest.permission.READ_CALL_LOG);
if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_DENIED)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Alberto, Andreas Shimokawa, Carsten Pfeiffer,
/* Copyright (C) 2016-2020 Alberto, Andreas Shimokawa, Carsten Pfeiffer,
Daniele Gobbetti, vanous
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Frank Slezak, ivanovlev, Kasha, Lem Dulfo, Pavel Elagin, Steffen
Liebergeld, vanous

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, boun, Carsten Pfeiffer, Daniel
/* Copyright (C) 2015-2020 Andreas Shimokawa, boun, Carsten Pfeiffer, Daniel
Dakhno, Daniele Gobbetti, JohnnySun, jonnsoft, Lem Dulfo, Taavi Eomäe,
Uwe Hermann
@ -53,6 +53,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -303,7 +304,13 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
registerReceiver(bluetoothReceiver, bluetoothIntents);
startDiscovery();
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
GB.toast(DiscoveryActivity.this, getString(R.string.error_no_location_access), Toast.LENGTH_SHORT, GB.ERROR);
LOG.error("No permission to access coarse location!");
checkAndRequestLocationPermission();
} else {
startDiscovery();
}
}
@Override
@ -667,6 +674,7 @@ public class DiscoveryActivity extends AbstractGBActivity implements AdapterView
bondingDevice = deviceCandidate;
break;
case BluetoothDevice.BOND_BONDED:
bondingDevice = deviceCandidate;
handleDeviceBonded();
break;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Lem Dulfo, Uwe Hermann
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2018-2019 Andreas Shimokawa, Carsten Pfeiffer, Cre3per,
/* Copyright (C) 2018-2020 Andreas Shimokawa, Carsten Pfeiffer, Cre3per,
Daniele Gobbetti
This file is part of Gadgetbridge.
@ -17,6 +17,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.activities;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@ -39,6 +40,7 @@ import java.io.IOException;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
public class FindPhoneActivity extends AbstractGBActivity {
@ -84,6 +86,9 @@ public class FindPhoneActivity extends AbstractGBActivity {
}
});
NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel( GB.NOTIFICATION_ID_PHONE_FIND );
vibrate();
playRingtone();
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Lem Dulfo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Carsten Pfeiffer, Dikay900
/* Copyright (C) 2016-2020 Carsten Pfeiffer, Dikay900
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2018-2019 abettenburg, AndrewBedscastle, Carsten Pfeiffer,
/* Copyright (C) 2018-2020 abettenburg, AndrewBedscastle, Carsten Pfeiffer,
Daniele Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 0nse, Andreas Shimokawa, Carsten Pfeiffer,
/* Copyright (C) 2015-2020 0nse, Andreas Shimokawa, Carsten Pfeiffer,
Daniel Dakhno, Daniele Gobbetti, Felix Konstantin Maurer, José Rebelo,
Martin, Normano64, Pavel Elagin, Sebastian Kranz, vanous

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 vanous
/* Copyright (C) 2019-2020 vanous
This file is part of Gadgetbridge.
@ -135,7 +135,7 @@ public class WidgetAlarmsActivity extends Activity implements View.OnClickListen
this.getString(R.string.appwidget_setting_alarm, hours, minutes),
Toast.LENGTH_SHORT, GB.INFO);
Alarm alarm = AlarmUtils.createSingleShot(0, true, calendar);
Alarm alarm = AlarmUtils.createSingleShot(0, true, false, calendar);
ArrayList<Alarm> alarms = new ArrayList<>(1);
alarms.add(alarm);
GBApplication.deviceService().onSetAlarms(alarms);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Konrad Iturbe, Lem Dulfo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa
/* Copyright (C) 2016-2020 Andreas Shimokawa
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Daniele Gobbetti
/* Copyright (C) 2016-2020 Andreas Shimokawa, Daniele Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa
/* Copyright (C) 2016-2020 Andreas Shimokawa
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 0nse, Andreas Shimokawa, Carsten Pfeiffer,
/* Copyright (C) 2015-2020 0nse, Andreas Shimokawa, Carsten Pfeiffer,
Daniele Gobbetti, Dikay900, Pavel Elagin, vanous, walkjivefly
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 0nse, Alberto, Andreas Shimokawa, Carsten Pfeiffer,
/* Copyright (C) 2015-2020 0nse, Alberto, Andreas Shimokawa, Carsten Pfeiffer,
Daniele Gobbetti, Pavel Elagin, vanous
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Pavel Elagin, vanous, Vebryn
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Dikay900, Pavel Elagin
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Andreas Shimokawa, vanous
/* Copyright (C) 2019-2020 Andreas Shimokawa, vanous
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, vanous, Vebryn
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Carsten Pfeiffer
/* Copyright (C) 2016-2020 Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, vanous
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, vanous
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo,
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Lem Dulfo,
vanous
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Cre3per,
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Cre3per,
Daniele Gobbetti, Dikay900, Pavel, Pavel Elagin
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Carsten Pfeiffer
/* Copyright (C) 2015-2020 Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Q-er
/* Copyright (C) 2019-2020 Q-er
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 0nse, Andreas Shimokawa, Carsten Pfeiffer,
/* Copyright (C) 2015-2020 0nse, Andreas Shimokawa, Carsten Pfeiffer,
Daniele Gobbetti, Dikay900, Pavel Elagin, Q-er, vanous
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 0nse, Andreas Shimokawa, Carsten Pfeiffer,
/* Copyright (C) 2015-2020 0nse, Andreas Shimokawa, Carsten Pfeiffer,
Daniele Gobbetti, Vebryn
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Carsten Pfeiffer
/* Copyright (C) 2016-2020 Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017-2019 Andreas Shimokawa, Carsten Pfeiffer, Pavel
/* Copyright (C) 2017-2020 Andreas Shimokawa, Carsten Pfeiffer, Pavel
Elagin, vanous
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 0nse, Andreas Shimokawa, Carsten Pfeiffer,
/* Copyright (C) 2015-2020 0nse, Andreas Shimokawa, Carsten Pfeiffer,
Daniele Gobbetti, Pavel Elagin, vanous
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Andreas Shimokawa
/* Copyright (C) 2019-2020 Andreas Shimokawa
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Andreas Shimokawa
/* Copyright (C) 2019-2020 Andreas Shimokawa
This file is part of Gadgetbridge.
@ -22,4 +22,7 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_WEARLOCATION = "wearlocation";
public static final String PREF_SCREEN_ORIENTATION = "screen_orientation";
public static final String PREF_RESERVER_ALARMS_CALENDAR = "reserve_alarms_calendar";
public static final String PREF_ALLOW_HIGH_MTU = "allow_high_mtu";
public static final String PREF_SYNC_CALENDAR = "sync_calendar";
public static final String PREF_USE_CUSTOM_DEVICEICON = "use_custom_deviceicon";
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2019 Andreas Shimokawa, Cre3per
/* Copyright (C) 2019-2020 Andreas Shimokawa, Cre3per
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017-2019 Carsten Pfeiffer, Daniele Gobbetti
/* Copyright (C) 2017-2020 Carsten Pfeiffer, Daniele Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017-2019 abettenburg, AndrewBedscastle, Carsten Pfeiffer,
/* Copyright (C) 2017-2020 abettenburg, AndrewBedscastle, Carsten Pfeiffer,
Daniele Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.
@ -27,12 +27,13 @@ import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.ConfigureAlarms;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
@ -71,7 +72,7 @@ public class GBAlarmListAdapter extends RecyclerView.Adapter<GBAlarmListAdapter.
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
public void onBindViewHolder(@NonNull final ViewHolder holder, final int position) {
final Alarm alarm = alarmList.get(position);
@ -82,7 +83,7 @@ public class GBAlarmListAdapter extends RecyclerView.Adapter<GBAlarmListAdapter.
holder.alarmDayFriday.setChecked(alarm.getRepetition(Alarm.ALARM_FRI));
holder.alarmDaySaturday.setChecked(alarm.getRepetition(Alarm.ALARM_SAT));
holder.alarmDaySunday.setChecked(alarm.getRepetition(Alarm.ALARM_SUN));
holder.container.setAlpha(alarm.getUnused() ? 0.5f : 1.0f);
holder.isEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
@ -97,6 +98,16 @@ public class GBAlarmListAdapter extends RecyclerView.Adapter<GBAlarmListAdapter.
((ConfigureAlarms) mContext).configureAlarm(alarm);
}
});
holder.container.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
alarm.setUnused(!alarm.getUnused());
holder.container.setAlpha(alarm.getUnused() ? 0.5f : 1.0f);
updateInDB(alarm);
return true;
}
});
holder.alarmTime.setText(DateTimeUtils.formatTime(alarm.getHour(), alarm.getMinute()));
holder.isEnabled.setChecked(alarm.getEnabled());
if (alarm.getSmartWakeup()) {

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, José Rebelo, Lem Dulfo, maxirnilian
This file is part of Gadgetbridge.
@ -291,8 +291,7 @@ public class GBDeviceAdapterv2 extends RecyclerView.Adapter<GBDeviceAdapterv2.Vi
return;
}
GBApplication.deviceService().onFindDevice(true);
//TODO: extract string resource if we like this solution.
Snackbar.make(parent, R.string.control_center_find_lost_device, Snackbar.LENGTH_INDEFINITE).setAction("Found it!", new View.OnClickListener() {
Snackbar.make(parent, R.string.control_center_find_lost_device, Snackbar.LENGTH_INDEFINITE).setAction(R.string.find_lost_device_you_found_it, new View.OnClickListener() {
@Override
public void onClick(View v) {
GBApplication.deviceService().onFindDevice(false);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, JohnnySun
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti, Felix Konstantin Maurer, JohnnySun
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2018-2019 Carsten Pfeiffer, Felix Konstantin Maurer
/* Copyright (C) 2018-2020 Carsten Pfeiffer, Felix Konstantin Maurer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa
/* Copyright (C) 2016-2020 Andreas Shimokawa
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa
/* Copyright (C) 2016-2020 Andreas Shimokawa
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017-2019 protomors
/* Copyright (C) 2017-2020 protomors
This file is part of Gadgetbridge.

View File

@ -0,0 +1,39 @@
/* Copyright (C) 2017-2020 Andreas Shimokawa, protomors
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.database.schema;
import android.database.sqlite.SQLiteDatabase;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
import nodomain.freeyourgadget.gadgetbridge.entities.AlarmDao;
import nodomain.freeyourgadget.gadgetbridge.entities.No1F1ActivitySampleDao;
public class GadgetbridgeUpdate_22 implements DBUpdateScript {
@Override
public void upgradeSchema(SQLiteDatabase db) {
if (!DBHelper.existsColumn(AlarmDao.TABLENAME, AlarmDao.Properties.Unused.columnName, db)) {
String ADD_COLUMN_UNUSED = "ALTER TABLE " + AlarmDao.TABLENAME + " ADD COLUMN "
+ AlarmDao.Properties.Unused.columnName + " INTEGER NOT NULL DEFAULT 0;";
db.execSQL(ADD_COLUMN_UNUSED);
}
}
@Override
public void downgradeSchema(SQLiteDatabase db) {
}
}

View File

@ -0,0 +1,40 @@
/* Copyright (C) 2017-2020 Andreas Shimokawa, protomors
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.database.schema;
import android.database.sqlite.SQLiteDatabase;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
import nodomain.freeyourgadget.gadgetbridge.entities.AlarmDao;
public class GadgetbridgeUpdate_23 implements DBUpdateScript {
@Override
public void upgradeSchema(SQLiteDatabase db) {
if (!DBHelper.existsColumn(AlarmDao.TABLENAME, AlarmDao.Properties.Snooze.columnName, db)) {
// Setting default value of SNOOZE column to 1 (true), so that existing MiBand2 alarms
// behave as before
String ADD_COLUMN_SNOOZE = "ALTER TABLE " + AlarmDao.TABLENAME + " ADD COLUMN "
+ AlarmDao.Properties.Snooze.columnName + " INTEGER NOT NULL DEFAULT 1;";
db.execSQL(ADD_COLUMN_SNOOZE);
}
}
@Override
public void downgradeSchema(SQLiteDatabase db) {
}
}

View File

@ -0,0 +1,35 @@
/* Copyright (C) 2017-2020 Andreas Shimokawa, protomors
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.database.schema;
import android.database.sqlite.SQLiteDatabase;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
import nodomain.freeyourgadget.gadgetbridge.entities.AlarmDao;
public class GadgetbridgeUpdate_24 implements DBUpdateScript {
@Override
public void upgradeSchema(SQLiteDatabase db) {
// Probably it isbetter to hardcode then using constants since constants could change after refactoring and potentially break migration
db.execSQL("UPDATE DEVICE SET Type=170 where (Type=80 and Manufacturer like 'Fossil%')");
}
@Override
public void downgradeSchema(SQLiteDatabase db) {
}
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer, Daniele
Gobbetti
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa
/* Copyright (C) 2015-2020 Andreas Shimokawa
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2015-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, Daniele Gobbetti, José Rebelo
/* Copyright (C) 2015-2020 Andreas Shimokawa, Daniele Gobbetti, José Rebelo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Böhler, Andreas Shimokawa
/* Copyright (C) 2015-2020 Andreas Böhler, Andreas Shimokawa
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2016-2019 Andreas Shimokawa, Carsten Pfeiffer
/* Copyright (C) 2016-2020 Andreas Shimokawa, Carsten Pfeiffer
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa
/* Copyright (C) 2015-2020 Andreas Shimokawa
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, José Rebelo
/* Copyright (C) 2015-2020 Andreas Shimokawa, José Rebelo
This file is part of Gadgetbridge.

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015-2019 Andreas Shimokawa, José Rebelo
/* Copyright (C) 2015-2020 Andreas Shimokawa, José Rebelo
This file is part of Gadgetbridge.

Some files were not shown because too many files have changed in this diff Show More