mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-25 19:36:50 +01:00
Merge remote-tracking branch 'origin/master' into feature-weather
This commit is contained in:
commit
c08d49d28e
@ -1,5 +1,9 @@
|
|||||||
###Changelog
|
###Changelog
|
||||||
|
|
||||||
|
####Version 0.7.3
|
||||||
|
* Pebble: Report connection state to PebbleKit companion apps via content provider. NOTE: Makes Gadgetbridge mutual exclusive with the original Pebble app.
|
||||||
|
* Ignore generic notification when from SMSSecure when SMS Notifications are on
|
||||||
|
|
||||||
####Version 0.7.2
|
####Version 0.7.2
|
||||||
* Pebble: Allow replying to generic notifications that contain a wearable reply action (tested with Signal)
|
* Pebble: Allow replying to generic notifications that contain a wearable reply action (tested with Signal)
|
||||||
* Pebble: Support seting up a common suffix for canned replies (defaults to " (canned reply)")
|
* Pebble: Support seting up a common suffix for canned replies (defaults to " (canned reply)")
|
||||||
|
@ -14,8 +14,8 @@ android {
|
|||||||
targetSdkVersion 23
|
targetSdkVersion 23
|
||||||
|
|
||||||
// note: always bump BOTH versionCode and versionName!
|
// note: always bump BOTH versionCode and versionName!
|
||||||
versionName "0.7.2"
|
versionName "0.7.3"
|
||||||
versionCode 38
|
versionCode 39
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
@ -1,11 +1,21 @@
|
|||||||
package nodomain.freeyourgadget.gadgetbridge.contentprovider;
|
package nodomain.freeyourgadget.gadgetbridge.contentprovider;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.ContentProvider;
|
import android.content.ContentProvider;
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.MatrixCursor;
|
import android.database.MatrixCursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.v4.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
|
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||||
|
|
||||||
public class PebbleContentProvider extends ContentProvider {
|
public class PebbleContentProvider extends ContentProvider {
|
||||||
|
|
||||||
@ -24,8 +34,22 @@ public class PebbleContentProvider extends ContentProvider {
|
|||||||
static final String URL = "content://" + PROVIDER_NAME + "/state";
|
static final String URL = "content://" + PROVIDER_NAME + "/state";
|
||||||
static final Uri CONTENT_URI = Uri.parse(URL);
|
static final Uri CONTENT_URI = Uri.parse(URL);
|
||||||
|
|
||||||
|
private GBDevice mGBDevice = null;
|
||||||
|
|
||||||
|
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
||||||
|
@Override
|
||||||
|
public void onReceive(Context context, Intent intent) {
|
||||||
|
String action = intent.getAction();
|
||||||
|
if (action.equals(GBDevice.ACTION_DEVICE_CHANGED)) {
|
||||||
|
mGBDevice = intent.getParcelableExtra(GBDevice.EXTRA_DEVICE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreate() {
|
public boolean onCreate() {
|
||||||
|
LocalBroadcastManager.getInstance(this.getContext()).registerReceiver(mReceiver, new IntentFilter(GBDevice.ACTION_DEVICE_CHANGED));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -33,7 +57,17 @@ public class PebbleContentProvider extends ContentProvider {
|
|||||||
public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
|
||||||
if (uri.equals(CONTENT_URI)) {
|
if (uri.equals(CONTENT_URI)) {
|
||||||
MatrixCursor mc = new MatrixCursor(columnNames);
|
MatrixCursor mc = new MatrixCursor(columnNames);
|
||||||
mc.addRow(new Object[]{1, 1, 0, 3, 8, 0, "Gadgetbridge"});
|
int connected = 0;
|
||||||
|
int appMessage = 0;
|
||||||
|
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this.getContext());
|
||||||
|
if (sharedPrefs.getBoolean("pebble_enable_pebblekit", false)) {
|
||||||
|
appMessage = 1;
|
||||||
|
}
|
||||||
|
if (mGBDevice != null && mGBDevice.getType() == DeviceType.PEBBLE && mGBDevice.isInitialized()) {
|
||||||
|
connected = 1;
|
||||||
|
}
|
||||||
|
mc.addRow(new Object[]{connected, appMessage, 0, 3, 8, 2, "Gadgetbridge"});
|
||||||
|
|
||||||
return mc;
|
return mc;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
@ -196,8 +196,11 @@ public class NotificationListener extends NotificationListenerService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source.equals("com.moez.QKSMS") || source.equals("com.android.mms") ||
|
if (source.equals("com.moez.QKSMS") ||
|
||||||
source.equals("com.sonyericsson.conversations") || source.equals("com.android.messaging")) {
|
source.equals("com.android.mms") ||
|
||||||
|
source.equals("com.sonyericsson.conversations") ||
|
||||||
|
source.equals("com.android.messaging") ||
|
||||||
|
source.equals("org.smssecure.smssecure")) {
|
||||||
if (!"never".equals(sharedPrefs.getString("notification_mode_sms", "when_screen_off"))) {
|
if (!"never".equals(sharedPrefs.getString("notification_mode_sms", "when_screen_off"))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -236,6 +239,7 @@ public class NotificationListener extends NotificationListenerService {
|
|||||||
case "com.android.mms":
|
case "com.android.mms":
|
||||||
case "com.android.messaging":
|
case "com.android.messaging":
|
||||||
case "com.sonyericsson.conversations":
|
case "com.sonyericsson.conversations":
|
||||||
|
case "org.smssecure.smssecure":
|
||||||
notificationSpec.type = NotificationType.SMS;
|
notificationSpec.type = NotificationType.SMS;
|
||||||
break;
|
break;
|
||||||
case "eu.siacs.conversations":
|
case "eu.siacs.conversations":
|
||||||
|
Loading…
Reference in New Issue
Block a user