mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-09-01 03:55:47 +02:00
Pebble: remove pebble_enable_pebblekit global preference.
Use device specific third_party_apps_set_settings preference instead.
This commit is contained in:
parent
96a8b9aeae
commit
c3d76477ec
@ -29,10 +29,11 @@ import android.net.Uri;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.preferences.DevicePrefs;
|
||||
|
||||
public class PebbleContentProvider extends ContentProvider {
|
||||
|
||||
@ -65,6 +66,7 @@ public class PebbleContentProvider extends ContentProvider {
|
||||
|
||||
@Override
|
||||
public boolean onCreate() {
|
||||
|
||||
LocalBroadcastManager.getInstance(this.getContext()).registerReceiver(mReceiver, new IntentFilter(GBDevice.ACTION_DEVICE_CHANGED));
|
||||
|
||||
return true;
|
||||
@ -76,12 +78,12 @@ public class PebbleContentProvider extends ContentProvider {
|
||||
MatrixCursor mc = new MatrixCursor(columnNames);
|
||||
int connected = 0;
|
||||
int pebbleKit = 0;
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
if (prefs.getBoolean("pebble_enable_pebblekit", false)) {
|
||||
pebbleKit = 1;
|
||||
}
|
||||
String fwString = "unknown";
|
||||
if (mGBDevice != null && mGBDevice.getType() == DeviceType.PEBBLE && mGBDevice.isInitialized()) {
|
||||
final DevicePrefs deviceSpecificSharedPrefsrefs = GBApplication.getDevicePrefs(mGBDevice.getAddress());
|
||||
if (deviceSpecificSharedPrefsrefs.getBoolean("third_party_apps_set_settings", false)) {
|
||||
pebbleKit = 1;
|
||||
}
|
||||
connected = 1;
|
||||
fwString = mGBDevice.getFirmwareVersion();
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.BluetoothSocket;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.ParcelUuid;
|
||||
import android.webkit.ValueCallback;
|
||||
@ -146,10 +147,11 @@ class PebbleIoThread extends GBDeviceIoThread {
|
||||
|
||||
PebbleIoThread(PebbleSupport pebbleSupport, GBDevice gbDevice, GBDeviceProtocol gbDeviceProtocol, BluetoothAdapter btAdapter, Context context) {
|
||||
super(gbDevice, context);
|
||||
final SharedPreferences deviceSpecificSharedPrefsrefs = GBApplication.getDeviceSpecificSharedPrefs(gbDevice.getAddress());
|
||||
mPebbleProtocol = (PebbleProtocol) gbDeviceProtocol;
|
||||
mBtAdapter = btAdapter;
|
||||
mPebbleSupport = pebbleSupport;
|
||||
mEnablePebblekit = prefs.getBoolean("pebble_enable_pebblekit", false);
|
||||
mEnablePebblekit = deviceSpecificSharedPrefsrefs.getBoolean("third_party_apps_set_settings", false);
|
||||
mPebbleProtocol.setAlwaysACKPebbleKit(prefs.getBoolean("pebble_always_ack_pebblekit", false));
|
||||
mPebbleProtocol.setEnablePebbleKit(mEnablePebblekit);
|
||||
|
||||
|
@ -11,13 +11,6 @@
|
||||
android:summary="@string/pref_summary_enable_outgoing_call"
|
||||
android:title="@string/pref_title_enable_outgoing_call"
|
||||
app:iconSpaceReserved="false" />
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="pebble_enable_pebblekit"
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:summary="@string/pref_summary_enable_pebblekit"
|
||||
android:title="@string/pref_title_enable_pebblekit"
|
||||
app:iconSpaceReserved="false" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="12"
|
||||
android:inputType="number"
|
||||
|
Loading…
Reference in New Issue
Block a user