mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-24 16:21:16 +02:00
Add MY_PACKAGE_REPLACED receiver to manifest, to re-connect after update, especially for users of Nightly releases. Fix #2855
This commit is contained in:
parent
cc44ba4123
commit
6f01dd6514
@ -393,8 +393,8 @@
|
||||
android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
|
@ -30,8 +30,12 @@ public class AutoStartReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (GBApplication.getGBPrefs().getAutoStart() && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
|
||||
Log.i(TAG, "Boot completed, starting Gadgetbridge");
|
||||
|
||||
if (GBApplication.getGBPrefs().getAutoStart() &&
|
||||
(Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction()) ||
|
||||
Intent.ACTION_MY_PACKAGE_REPLACED.equals(intent.getAction())
|
||||
)) {
|
||||
Log.i(TAG, "Boot or reinstall completed, starting Gadgetbridge");
|
||||
if (GBApplication.getPrefs().getBoolean("general_autoconnectonbluetooth", false)) {
|
||||
Log.i(TAG, "Autoconnect is enabled, attempting to connect");
|
||||
GBApplication.deviceService().connect();
|
||||
|
Loading…
Reference in New Issue
Block a user